Remove the type-checking knot.
[ghc.git] / testsuite / tests / polykinds / PolyKinds13.hs
1 {-# LANGUAGE PolyKinds #-}
2 {-# LANGUAGE FlexibleInstances #-}
3
4 module PolyKinds13 where
5
6
7 data Proxy a = Proxy
8
9 instance Show (Proxy a) where
10 show _ = "Proxy"
11
12 instance Functor Proxy where
13 fmap _ Proxy = Proxy
14
15
16 data TypeRep = TypeRep
17
18 class MyTypeable t where
19 -- MyTypeable :: forall k. k -> Constraint
20 myTypeOf :: Proxy t -> TypeRep
21 myTypeOf _ = TypeRep
22
23 data Apply f t = Apply (f t)
24 -- Apply :: forall k. (k -> *) -> k -> *
25
26 instance MyTypeable Apply
27 -- df :: forall k. MyTypeable ((k -> *) -> k -> *) (Apply k)
28 instance MyTypeable Int
29 instance MyTypeable Maybe