snoyberg / mono-traversable

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

Fix foldl1 not being "a strict left fold" as advertised. #115

Closed nh2 closed 7 years ago

nh2 commented 7 years ago

An example of this is Combinators.minimum, which until now would thunk up min(_, min(...)), instead of demanding each min result, leading to non-constant memory usage.

I haven't checked if other functions need a similar change.

snoyberg commented 7 years ago

Thanks!