spl / dlist

Difference lists in Haskell
https://hackage.haskell.org/package/dlist
BSD 3-Clause "New" or "Revised" License
65 stars 15 forks source link

Semigroup instance #25

Closed spl closed 8 years ago

spl commented 8 years ago

Semigroup will be in base from GHC >= 8.0 (GHC #10365). We should now probably add an instance for it, since we can do it without adding another dependency. This may also involve revisiting #11.

spl commented 8 years ago

@gregwebs Since Semigroup is in base for GHC 8.0, I think it makes sense to have an instance for it in dlist. What would you like to do about dlist-instances? Would it make sense to put an upperbound on the base dependency for dlist-instances so that the two packages do not conflict? Alternatively, you don't have to do anything. I think users of dlist will need to add CPP anyways if they want to support dlist with dlist-instances and dlist with the Semigroup instance.

gregwebs commented 8 years ago

Seems like dlist-instances should include CPP To exclude the instance for GHC 8. That will make it possible for some users not to change anything

spl commented 8 years ago

Good idea. I'll put in the change sometime in the next few weeks.

hvr commented 8 years ago

Btw, there's also the option (assuming @ekmett is ok with it) to have the semigroups package provide non-orphan DList instances for GHC<8 (semigroups already does this for a few other packages whose authors prefered to not add a dependency on semigroups)

ekmett commented 8 years ago

I'm open to it. Toss me a patch.

spl commented 8 years ago

Finally got around to dealing with this.

@gregwebs See #27 (in particular f031b66) for how I'm doing the Semigroup instance. This is going into dlist-0.8. I suppose it would make sense to use CPP with !MIN_VERSION_dlist(0,8,0) wrapping the instance.

@ekmett Since there is already dlist-instances with an orphan instance of Semigroup for DList and people are using it, I think it can remain as the source for that instance.

ekmett commented 7 years ago

@spl Given that the problem will clear up over a couple of ghc releases and fade into obscurity I can blissfully ignore the orphan issue. shrug