Burning more bridges (mostly numeric ones)

Carter Charbonneau zcarterc at gmail.com
Mon Feb 24 03:13:36 UTC 2014


The Burning Bridges thread got lots done, but seemed to miss a few things, and
didn't even touch on the Numeric classes. The Numeric classes should be fixed
at some point, and sooner is better than later. However, it would be a large
change and would go nicely with a major version bump in base. 5 is coming
up soon. Proposals, ordered from relatively controversial to insanely so
(at least IMO):

1. Replace (.) and id from versions from Control.Category in Prelude
   This is a small change, and has close to the same effect as the Foldable/
   Traversable change. The key difference is that this is a much smaller change
   and there is little current use for the versions from Control.Category
   However, historically they have seen use with the other lens-ish libraries,
   and AFAICT are the reason the lenses in `lens` are "backwards", or at least
   called so my some.

1.2 Use Semigroupoid for (.) and Ob for id instead. Personally, I really like
    this idea, but I think it would be much more controversial.

2. Move Semigroup into Prelude

2.1 Make Monoid depend on Semigroup.

3. Do something with the Numeric classes. This isn't so much of a proposal as a
   request for discussion from people more experienced than me, but I still
   think a general idea if people think that doing *anything* is a good idea
   would be useful.

3.1 Split each numeric operation into it's own class. Say no to 3.2 and 
yes here
    for no hierarchy in them/ConstraintKinds/empty classes.
    Pros: EDSLs, convenience.
    Cons: Would be major breakage, would need ConstraintKinds/empty classes to
          have a hierarchy.

3.2 Hierarchy. the classes are TBD, this is here for a straw poll.




More information about the Libraries mailing list