Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

add foldl1 in foundation's Collection.Collection.Foldable. #318

Open
NicolasDP opened this issue Jun 10, 2017 · 2 comments
Open

add foldl1 in foundation's Collection.Collection.Foldable. #318

NicolasDP opened this issue Jun 10, 2017 · 2 comments
Labels
C - collection collection stuff D - easy Difficulty easy for beginners

Comments

@NicolasDP
Copy link
Member

NicolasDP commented Jun 10, 2017

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.

@ndmitchell
Copy link
Contributor

foldl1' is probably a better idea.

@ThreeFx
Copy link
Contributor

ThreeFx commented Jun 11, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C - collection collection stuff D - easy Difficulty easy for beginners
Projects
None yet
Development

No branches or pull requests

4 participants