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

Always use QuantifiedConstraints, support inductive GADTs #17

Draft
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

Ericson2314
Copy link
Member

I put a manual instance in the README, but we could do it with TH later.

Ericson2314 and others added 3 commits September 12, 2019 12:44
Co-Authored-By: Alexandre Esteves <[email protected]>
Anywhere we get an `Extract` we do it ultimately via `argDictAll`, so
the `ArgDict f` constraint must already be satified in scope.
README.md Outdated Show resolved Hide resolved
Thanks!

Co-Authored-By: Elliot Cameron <[email protected]>
README.md Outdated Show resolved Hide resolved
@ali-abrar
Copy link
Member

Is it necessary to drop support for ghc < 86?

@Ericson2314
Copy link
Member Author

There might be a way, but only with copious CPP.

I like what this PR does, but it is a solution in search of a problem. I think eventually we'll want it (e.g. IV debugging constraints), but for now we can just leave open.

@ali-abrar ali-abrar changed the title Always use QuantifiedConstraints, support inductive GADTs WIP: Always use QuantifiedConstraints, support inductive GADTs Oct 1, 2019
It is only allowed with GHC 8.6, and doesn't work very well there I'm
told. https://gitlab.haskell.org/ghc/ghc/-/issues/14860 tracks the
underlying issue.
@Ericson2314 Ericson2314 changed the base branch from develop to aa-travis December 12, 2020 16:46
@Ericson2314 Ericson2314 changed the base branch from aa-travis to develop December 12, 2020 16:46
@Ericson2314 Ericson2314 changed the title WIP: Always use QuantifiedConstraints, support inductive GADTs Always use QuantifiedConstraints, support inductive GADTs Dec 13, 2020
@Ericson2314 Ericson2314 marked this pull request as draft December 2, 2021 03:15
-- @argDict@ is sufficient for most tasks, but this is slightly more powerful
-- in that this discharges the quantified constraints which are useful when
-- the GADT indices are not finite.
argDictAll :: f a -> Dict (Extract f a)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N.B. This wants to be:

Suggested change
argDictAll :: f a -> Dict (Extract f a)
argDictAll :: f a -> Dict (forall c. ConstraintsFor f c => c a))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The big question is, is the following weaker?

argDictAll :: f a -> forall c. Dict (ConstraintsFor f c => c a))

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

Successfully merging this pull request may close these issues.

5 participants