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

(:-) a closed category? #68

Open
Zemyla opened this issue Nov 15, 2017 · 3 comments
Open

(:-) a closed category? #68

Zemyla opened this issue Nov 15, 2017 · 3 comments

Comments

@Zemyla
Copy link

Zemyla commented Nov 15, 2017

It seems to be. There is an exponential, which is (:=>), and apply and uncurry combinators:

apply :: forall a b. (a :=> b, a) :- b
apply = Sub $ (Dict :: Dict b) \\ (ins :: a :- b)

uncurry :: forall a b c. (a :- (b :=> c)) -> ((a, b) :- c)
uncurry s = unmapDict $ \Dict -> (Dict :: Dict c) \\ ((ins :: b :- c) \\ s)

But there should also be a curry combinator:

curry :: forall a b c. ((a, b) :- c) -> (a :- (b :=> c))
curry = ???

And it seems like that can't be implemented without unsafe operations.

@Zemyla
Copy link
Author

Zemyla commented Nov 19, 2017

I just realized that :=> isn't the canonical exponential type, because it induces a functional dependency. There could be a type family, something like ==>, which is a constraint but doesn't have the same dependency.

@Icelandjack
Copy link
Contributor

These things can be implemented with Simon's -XQuantifiedConstraints branch

@Icelandjack
Copy link
Contributor

Icelandjack commented Mar 6, 2018

Is found here https://github.com/ghc/ghc/tree/wip/T2893, I made tickets for curry and uncurry

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