summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T19094.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/polykinds/T19094.hs')
-rw-r--r--testsuite/tests/polykinds/T19094.hs29
1 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/polykinds/T19094.hs b/testsuite/tests/polykinds/T19094.hs
new file mode 100644
index 0000000000..7b2b03e713
--- /dev/null
+++ b/testsuite/tests/polykinds/T19094.hs
@@ -0,0 +1,29 @@
+{-# Language RankNTypes, TypeApplications, PolyKinds, DataKinds, TypeOperators, StandaloneKindSignatures, TypeFamilies, FlexibleInstances, MultiParamTypeClasses #-}
+
+module T19094 where
+
+import Data.Type.Equality
+import Data.Kind
+
+type PolyKinded :: Type -> Type
+type PolyKinded res = (forall (k :: Type). k -> res)
+
+infix 4
+ ===
+type
+ (===) :: PolyKinded (PolyKinded Bool)
+type family
+ a === b where
+ a === a = True
+ _ === _ = False
+
+type TryUnify :: Bool -> PolyKinded (PolyKinded Constraint)
+class (a === b) ~ cond
+ => TryUnify cond a b
+instance (a === b) ~ False
+ => TryUnify False @k a @j b
+instance {-# Incoherent #-}
+ ( (a === b) ~ True
+ , a ~~ b
+ )
+ => TryUnify True @k a @j b