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

Coproducts are defined inductively #105

Open
jnape opened this issue Oct 30, 2020 · 3 comments
Open

Coproducts are defined inductively #105

jnape opened this issue Oct 30, 2020 · 3 comments

Comments

@jnape
Copy link
Member

jnape commented Oct 30, 2020

No description provided.

@nomicflux
Copy link
Contributor

Would this be like Purescript's Coproduct.Nested: https://github.com/purescript/purescript-functors/tree/master/src/Data/Functor/Coproduct?

(In that case, would it be useful to add something like Coproduct.Inject and a Project to the higher-order function wishlist?)

@jnape
Copy link
Member Author

jnape commented Nov 2, 2020

The similarities to me seem to end with the idea that they'd both be inductively defined. I have extreme contempt for Const Void in any type signature, and the utility of either an inductive or terminal data constructor of CP1 is a dubious proposition for me, at best. I'm also not a huge fan of the set differentiation falling to higher kind and some perverse contortions like type CP2 a b = Coproduct (Const a) Identity b in order to satisfy the functor itch while also providing the ability to yield an a or a b.

@jnape
Copy link
Member Author

jnape commented Nov 2, 2020

I don't implicitly find either Inject or Project to be hateful concepts, so I'm certainly open to them.

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