|
|
|
|
|
by linkdd
1867 days ago
|
|
`every()` returns true if every item in a collection verify a predicate (this is the `foldl1 (||)` part of the example). `map()` applies a function to every item in a collection and returns a new collection. What I confuses me about the Haskell example is `$x`. Where does it come from? why isn't it referenced anywhere afterwards? Is the `$` an operator of some sort that names a variable in the later block? Why is it `tests` and not `$tests` then? |
|
In general in Haskell if you have an infix operator `OP` then `(OP x)` means the same thing as `\y -> y OP x`. (Additionally in this case you need to know that `$` is defined by `f $ x = f x`.)