3 ms·
`map` covers the majority of what for-loops are used in imperative languages. There's also `foreach`, which is a `map` that doesn't give you a new list back. Yo
by hassy 18y ago
`map` covers the majority of what for-loops are used in imperative languages. There's also `foreach`, which is a `map` that doesn't give you a new list back. You've also got list comprehensions if you prefer them over `map`.
Then there are also `filter`, `all`, `any` and others.
The rest of your iteration needs can be covered by the `fold` functions.
Sure, these functions use tail-recursion internally, but you never have to care about that.