foundation
foundation copied to clipboard
add `foldl1` in foundation's Collection.Collection.Foldable.
It would look like the following:
foldl1' :: Foldable col => (Element col -> Element col -> Element col)
-> NonEmpty col
-> Element col
Edit: don't implement a the lazy version of this function.
foldl1'
is probably a better idea.
Is it wise to force any Foldable
to also provide fold1
? I am worried that this might prevent some types from having a Foldable
instance.