List comprehensions
A nice syntax for constructing lists from generators and guards
[ expr | var <- expr, …, … boolExpr, …]
[ f x | x <- xs ]
[(x,y) | x <- xs, y <- ys)]
[y | y <- ys, y > 10 ]
Previous slide
Next slide
Back to first slide
View graphic version