4cba8281ca414b72d9783d6f048f83c381ab2b70
[ghc.git] / testsuite / tests / dependent / should_compile / KindEqualities.hs
1 {-# LANGUAGE TypeInType, GADTs, ExplicitForAll #-}
2 {-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
3
4 module KindEqualities where
5
6 import Data.Kind
7
8 data TyRep1 :: * -> * where
9 TyInt1 :: TyRep1 Int
10 TyBool1 :: TyRep1 Bool
11
12 zero1 :: forall a. TyRep1 a -> a
13 zero1 TyInt1 = 0
14 zero1 TyBool1 = False
15
16 data Proxy (a :: k) = P
17
18 data TyRep :: forall k. k -> * where
19 TyInt :: TyRep Int
20 TyBool :: TyRep Bool
21 TyMaybe :: TyRep Maybe
22 TyApp :: TyRep a -> TyRep b -> TyRep (a b)
23
24 zero :: forall (a :: *). TyRep a -> a
25 zero TyInt = 0
26 zero TyBool = False
27 zero (TyApp TyMaybe _) = Nothing