What stops Data.Foldable from having foldl1'?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

What stops Data.Foldable from having foldl1'?

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
latest to have been released:
https://hackage.haskell.org/package/base-4.10.1.0/docs/Data-Foldable.html

Thank you.
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: What stops Data.Foldable from having foldl1'?

Andrew Martin
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.

On Tue, Mar 6, 2018 at 11:30 AM, sonne <[hidden email]> wrote:
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.
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries



--
-Andrew Thaddeus Martin

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: What stops Data.Foldable from having foldl1'?

Tony Morris-4
In reply to this post by sonne
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.


On 07/03/18 02:30, sonne wrote:

> 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.
> _______________________________________________
> Libraries mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries


_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

signature.asc (499 bytes) Download Attachment