blob: d63db880ea47e0c3d7f73e51fda28251253af3af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
{-# Language RankNTypes, TypeApplications, PolyKinds, DataKinds, TypeOperators, StandaloneKindSignatures, TypeFamilies, FlexibleInstances, MultiParamTypeClasses #-}
module T19092 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 -> forall k. k -> forall j. j -> 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
|