Let's say we want to test whether the list [1,2,3,4,5]
contains 2
.
We could do this by turning the list of integers [1,2,3,4,5]
into a list of Booleans [False, True, False, False, False]
indicating,
for each element in the original list, whether it is equal to 2
.
λ> x = map (== 2) [1..5]