The H2 Wiki


why-do-we-like-lazy-lists

Why do we like lazy lists?

https://www.reddit.com/r/haskell/comments/6h84vg/when_do_we_really_need_lazy_lists/diwnhua/

fmap f (x : xs) = f x : fmap f xs fmap _ [] = []

traverse and basically any function that builds a list will similarly suffer, e.g toList, many, some etc.

https://www.reddit.com/r/haskell/comments/6h84vg/when_do_we_really_need_lazy_lists/dizksf1/

https://www.reddit.com/r/haskell/comments/6h84vg/when_do_we_really_need_lazy_lists/diwhzwf/

Lennart’s points

any :: (a -> Bool) -> [a] -> Bool any p = or . map p