Usually for type checking
case e of
K1 ... -> e1
K2 ... -> e2
...
all expressions are required to eihave a common type.
GADT, , T ~ T', , , . , , ei , , , , .
:
f :: T a -> a -> a
f x y = -- we know x :: T a , y :: a
case x of
T0 _ -> -- provides a ~ Bool
True -- has type Bool
T1 -> -- provides a ~ a (useless)
y -- has type a
Bool ~ a, , , a ~ Bool. !
( , - ,
, ,
( ) - . GADT .)
, GADT - , , -, .