Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accidentally the same library #1

Open
int-index opened this issue Apr 17, 2016 · 8 comments
Open

Accidentally the same library #1

int-index opened this issue Apr 17, 2016 · 8 comments

Comments

@int-index
Copy link

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

int-index/union#3

:)

@ElvishJerricco
Copy link
Owner

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
Copy link
Author

You can surely define this newtype:

newtype Applied a f = Applied (f a)

and then use

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

@ElvishJerricco
Copy link
Owner

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

@ElvishJerricco
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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 VinylRecords/Vinyl#41

@ElvishJerricco
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants