love-haskell / coercible-utils

Utility functions for Coercible types
https://hackage.haskell.org/package/coercible-utils
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Add newtype support #14

Closed treeowl closed 4 years ago

treeowl commented 4 years ago

@chessai You seemed interested in this too.

treeowl commented 4 years ago

I realized I can loosen some of the Newtype constraints to Coercible ones without losing the inference that is this module's raison d'être.

treeowl commented 4 years ago

By the way: the module name is totally up for grabs.

treeowl commented 4 years ago

Once #13 is merged, I can replace the implementations in this module with calls to the more-polymorphic versions.

sjakobi commented 4 years ago

How about we actually replace the existing combinators in CoercibleUtils with these?

I'm mostly concerned about offering two very similar APIs in the same package – I think that would be confusing.

Thoughts @chessai?

chessai commented 4 years ago

The competing APIs thing seems like it might be a problem to me. The new API requires a generic instance, which I'm not sure is that much of a problem. It also doesn't work with UnliftedNewtypes.

I'm tempted to say keep both for now. But I'm not sure yet.

treeowl commented 4 years ago

@sjakobi and @chessai, I think this is ready to go wherever you want it to go and with whatever name you wish to give it. Can we get it done? Creating yet another package with such similar functionality seems a bit silly to me, but I guess I can do that if necessary....

sjakobi commented 4 years ago

As I'm not aware of any actual users of the combinators in CoercibleUtils, I don't see the point of keeping them around if we now have better versions of them. UnliftedNewtypes hasn't even been released yet.

If anyone wants to get the old ones back, I'm sure we can figure something out.

Unless you protest @chessai, I'd merge this as-is and move things into CoercibleUtils.

chessai commented 4 years ago

Ok. Agreed. My unlifted newtypes criticism wasnt very sensical.

treeowl commented 4 years ago

Thanks!