-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Always use QuantifiedConstraints, support inductive GADTs #17
base: develop
Are you sure you want to change the base?
Conversation
…phic instances." This reverts commit 5c50d96.
3c5d8c9
to
5a49608
Compare
Co-Authored-By: Alexandre Esteves <2335822+alexfmpe@users.noreply.github.com>
Anywhere we get an `Extract` we do it ultimately via `argDictAll`, so the `ArgDict f` constraint must already be satified in scope.
Thanks! Co-Authored-By: Elliot Cameron <3noch@users.noreply.github.com>
Is it necessary to drop support for ghc < 86? |
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. |
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.
079af12
to
2283ddc
Compare
-- @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) |
There was a problem hiding this comment.
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:
argDictAll :: f a -> Dict (Extract f a) | |
argDictAll :: f a -> Dict (forall c. ConstraintsFor f c => c a)) |
There was a problem hiding this comment.
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))
I put a manual instance in the README, but we could do it with TH later.