Examples
ints_from n = n : ints_from (n+1)
--same as [n..]
nats = ints_from 0;
squares = map (^2) nats
[0,1,4,9,16,25…]
fibs = 0 : 1 :
[a+b | (a,b) <- zip fibs
(tail fibs)]
[0,1,1,2,3,5,8,13,21,34,55,…]
Previous slide
Next slide
Back to first slide
View graphic version