ElvishJerricco / dependent-open-union

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Accidentally the same library #1

Open int-index opened 8 years ago

int-index commented 8 years ago

http://hackage.haskell.org/package/union

https://github.com/int-index/union/issues/3

:)

ElvishJerricco commented 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.

int-index commented 8 years ago

You can surely define this newtype:

newtype Applied a f = Applied (f a)

and then use

Union (Applied a) '[f, g, h]

ElvishJerricco commented 8 years ago

Ohh interesting. I'll give this a spin. Looks like I'll have to finally learn lenses though.

ElvishJerricco commented 8 years ago

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?

int-index commented 8 years ago

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.

ElvishJerricco commented 8 years ago

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.

int-index commented 8 years ago

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

ElvishJerricco commented 8 years ago

Cool. Looks like I've got a lot of reading to do. Thanks for everything.