Proposal: Add Foldable1 from 'semigroupoids' to base
andrew.thaddeus at gmail.com
Thu Jun 7 19:22:37 UTC 2018
You allude to the possibility of a name change at the end of the email.
Progress on that is being tracked on this issue:
https://github.com/ekmett/semigroupoids/issues/26. It seems like there is
reasonable agreement that renaming Foldable1 (and several other classes
from semigroupoids) would be good.
I'm in favor of moving this into base under the name Semifoldable (after it
has been renamed in semigroupoids). Longer term, I think there's some
interested stuff that could be done with fixing foldr1 and foldl1, which
currently suffer a sad existence as partial functions.
On Thu, Jun 7, 2018 at 3:12 PM, Daniel Cartwright <chessai1996 at gmail.com>
> For those of you unfamiliar with 'Foldable1', it is a typeclass for
> nonempty foldable structures, that centres around Semigroup instead of
> I have made a differential on Phabricator for the change here:
> Some discussion at the following links also:
> Note: foldl1 and foldr1 are currently typeclass methods of 'Foldable' and
> not 'Foldable1', and even though I think they should be, they probably (and
> shouldn't) be removed in this change, though I hope that eventually they
> can be moved to Foldable1.
> Foldable1 is also unfortunately named due to the suffix '1' being
> connotated with the conventions surrounded Data.Functor.Classes (Show1,
> Eq1, etc.). If this naming is seen as sufficiently unfortunate/confusing
> because of that, then perhaps the name should be changed to something like
> 'SemiFoldable'. The name change would most likely have to be made in
> 'semigroupoids' first if that is the case.
> Libraries mailing list
> Libraries at haskell.org
-Andrew Thaddeus Martin
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libraries