summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/PolyKinds13.hs
blob: a7546833241fc9e8c3e5bf3b75a620c50fe39a23 (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 PolyKinds          #-}
{-# LANGUAGE FlexibleInstances  #-}

module PolyKinds13 where


data Proxy a = Proxy

instance Show (Proxy a) where
  show _ = "Proxy"

instance Functor Proxy where
  fmap _ Proxy = Proxy


data TypeRep = TypeRep

class MyTypeable t where
-- MyTypeable :: forall k. k -> Constraint
  myTypeOf :: Proxy t -> TypeRep
  myTypeOf _ = TypeRep

data Apply f t = Apply (f t)
-- Apply :: forall k.  (k -> *) -> k -> * 

instance MyTypeable Apply
-- df :: forall k. MyTypeable ((k -> *) -> k -> *) (Apply k)
instance MyTypeable Int
instance MyTypeable Maybe