Discussion:
What stops Data.Foldable from having foldl1'?
sonne
2018-03-06 16:30:58 UTC
Permalink
Good evening.

I notice Data.Foldable ain't got no `foldl1'`, while `foldl'` and
`foldl1` are both there. Is there a reason? What will it take to have
it introduced?

I refer to this specific version, which is to my understanding the
latest to have been released:
https://hackage.haskell.org/package/base-4.10.1.0/docs/Data-Foldable.html

Thank you.
Andrew Martin
2018-03-06 17:08:59 UTC
Permalink
I think that introducing foldl1' would be a step in the wrong direction.
It's unfortunate that Foldable was brought into base with the partial
functions foldl1, foldr1, maximum, and minimum. If anything, I would argue
that we should try to relegate them to
http://hackage.haskell.org/package/semigroupoids-5.2.2/docs/Data-Semigroup-Foldable.html
where they belong.
Post by sonne
Good evening.
I notice Data.Foldable ain't got no `foldl1'`, while `foldl'` and
`foldl1` are both there. Is there a reason? What will it take to have
it introduced?
I refer to this specific version, which is to my understanding the
https://hackage.haskell.org/package/base-4.10.1.0/docs/Data-Foldable.html
Thank you.
_______________________________________________
Libraries mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
--
-Andrew Thaddeus Martin
Tony Morris
2018-03-06 20:19:26 UTC
Permalink
foldl1 on Foldable is not a friendly function :)

You want Data.Foldable1
https://hackage.haskell.org/package/semigroupoids-5.2.1/docs/Data-Semigroup-Foldable.html

Note that this one is friendly.
Post by sonne
Good evening.
I notice Data.Foldable ain't got no `foldl1'`, while `foldl'` and
`foldl1` are both there. Is there a reason? What will it take to have
it introduced?
I refer to this specific version, which is to my understanding the
https://hackage.haskell.org/package/base-4.10.1.0/docs/Data-Foldable.html
Thank you.
_______________________________________________
Libraries mailing list
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Loading...