snoyberg / mono-traversable

Type classes for mapping, folding, and traversing monomorphic containers
153 stars 63 forks source link

Specialize traverse_ and for_, better traverse_ default implementation #121

Closed snoyberg closed 6 years ago

andersk commented 7 years ago

(Copying this here from my comment on your blog.) This implementation is insufficiently lazy: otraverse_ putStrLn ("hello" : "world" : ⊥) now evaluates to putStrLn "hello" *> ⊥ instead of putStrLn "hello" *> putStrLn "world" *> ⊥.