Open int-index opened 8 years ago
As far as I can tell, these are similar, but not quite the same. The purpose of this library is to provide a union over types of kind * -> *
. That is, Union '[f, g, h] a == Either (f a) (Either (g a) (h a))
. It's the * -> *
types that are being unionized, not the *
types.
You can surely define this newtype:
newtype Applied a f = Applied (f a)
and then use
Union (Applied a) '[f, g, h]
Ohh interesting. I'll give this a spin. Looks like I'll have to finally learn lenses though.
So mine is clearly the weakest of the three of these libraries. And on first glance, I think yours is the strongest. So I won't be publishing this to Hackage. But what do you think about the existence of two nearly identical libraries (yours and Andrew's)? Are there changes that could be done to one to obsolete the other? Is the relationship between vinyl-plus
and vinyl
not worth having?
Are there changes that could be done to one to obsolete the other?
Eventually I'd like to see the RElem
and UElem
classes unified, and my union
merged into vinyl
itself. But first I'll have to get rid of lens
as a dependency.
Is that something you would like to move towards? I can get to work exploring all of this and see what I can do in a pull request. It'd be a good learning experience for me.
Yes, the lens
dependency in union
can be reduced to profunctors
without loss of functionality, as per Lens without depending on lens. Then I'll be able to propose it as a solution to https://github.com/VinylRecords/Vinyl/issues/41
Cool. Looks like I've got a lot of reading to do. Thanks for everything.
http://hackage.haskell.org/package/union
https://github.com/int-index/union/issues/3
:)