Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / dependent / should_fail / T13601.hs
1 {-# LANGUAGE TypeFamilies, DataKinds, PolyKinds #-}
2
3 import GHC.Exts
4 import Prelude (Bool(True,False),Integer,Ordering,undefined)
5 import qualified Prelude
6 import Data.Kind
7
8 --------------------
9 -- class hierarchy
10
11 type family
12 Rep (rep :: RuntimeRep) :: RuntimeRep where
13 -- Rep IntRep = IntRep
14 -- Rep DoubleRep = IntRep
15 -- Rep PtrRepUnlifted = IntRep
16 -- Rep PtrRepLifted = PtrRepLifted
17
18 class Boolean (Logic a) => Eq (a :: TYPE rep) where
19 type Logic (a :: TYPE rep) :: TYPE (Rep rep)
20 (==) :: a -> a -> Logic a
21
22 class Eq a => POrd (a :: TYPE rep) where
23 inf :: a -> a -> a
24
25 class POrd a => MinBound (a :: TYPE rep) where
26 minBound :: () -> a
27
28 class POrd a => Lattice (a :: TYPE rep) where
29 sup :: a -> a -> a
30
31 class (Lattice a, MinBound a) => Bounded (a :: TYPE rep) where
32 maxBound :: () -> a
33
34 class Bounded a => Complemented (a :: TYPE rep) where
35 not :: a -> a
36
37 class Bounded a => Heyting (a :: TYPE rep) where
38 infixr 3 ==>
39 (==>) :: a -> a -> a
40
41 class (Complemented a, Heyting a) => Boolean a
42
43 (||) :: Boolean a => a -> a -> a
44 (||) = sup
45
46 (&&) :: Boolean a => a -> a -> a
47 (&&) = inf