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
Generalise kind of ForallT #54
Comments
It's certainly possible. This patch would suffice: diff --git a/src/Data/Constraint/Forall.hs b/src/Data/Constraint/Forall.hs
index 3932f29..f628993 100644
--- a/src/Data/Constraint/Forall.hs
+++ b/src/Data/Constraint/Forall.hs
@@ -139,11 +139,11 @@ class Forall (R p t a) => Q (p :: k3 -> Constraint) (t :: k1 -> k2 -> k3) (a ::
instance Forall (R p t a) => Q p t a
-- | A representation of the quantified constraint @forall f a. p (t f a)@.
-class Forall (Q p t) => ForallT (p :: k4 -> Constraint) (t :: (k1 -> k2) -> k3 -> k4)
+class Forall (Q p t) => ForallT (p :: k3 -> Constraint) (t :: k1 -> k2 -> k3)
instance Forall (Q p t) => ForallT p t
-- | Instantiate a quantified @'ForallT' p t@ constraint at types @f@ and @a@.
-instT :: forall (p :: k4 -> Constraint) (t :: (k1 -> k2) -> k3 -> k4) (f :: k1 -> k2) (a :: k3). ForallT p t :- p (t f a)
+instT :: forall (p :: k3 -> Constraint) (t :: k1 -> k2 -> k3) (f :: k1) (a :: k2). ForallT p t :- p (t f a)
instT = Sub $
case inst :: Forall (Q p t) :- Q p t f of { Sub Dict ->
case inst :: Forall (R p t f) :- R p t f a of The question is whether this would be desirable from a kind inference perspective. I'm guessing the current kind signature of But perhaps if you're using |
It could also be given a different name (the |
I initially implemented the new system's |
I'm no longer using But of course it might break something else. I guess |
Can the kind of
ForallT
be generalisedI need this to model
PipeKit
from Faster Coroutine PipelinesWorks by removing kind annotations
The text was updated successfully, but these errors were encountered: