Could someone explain to me why this
doesn't work
test l =
hs where hs = map (\x -> [x]) [0..abs(l `div` hLen)] hLen = length $ head hs whereas this does
test l =
hs where hs = map (\x -> [x]) (0:[1..abs(l `div` hLen)]) hLen = length $ head hs I would have thought laziness would allow
the compiler to know that hs would contain at least one element and therefore
calculate hLen.
Dominic.
|
- Re: Laziness Dominic Steinitz
- Re: Laziness Jon Fairbairn