an unexpected (to me) difference between lists:map/2 and list comprehension

James Hague james.hague@REDACTED
Tue Aug 8 16:02:52 CEST 2006

> Just remember that the <- construct is a filter,
> and the LHS is where some operation is applied
> to the selection.

Except that you can also add filters elsewhere, like:

[X || X <- [1,2,3,4], X > 2]

(I honestly had no idea that the "<-" worked as a filter until I read
this thread.)

More information about the erlang-questions mailing list