Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / simplCore / should_run / T12689a.hs
1 data T1 = MkT1Bad | MkT1Good deriving Show
2 data T2 = MkT2Bad Int | MkT2Good Int deriving Show
3 data T3 = MkT3Bad {-# UNPACK #-} !Int | MkT3Good {-# UNPACK #-} !Int deriving Show
4 data T4 = MkT4Bad Int | MkT4Good Int deriving Show
5 data T5 = MkT5Bad {-# UNPACK #-} !Int | MkT5Good {-# UNPACK #-} !Int deriving Show
6
7 {-# RULES
8
9 "T1" app MkT1Bad = MkT1Good
10 "T2" forall x. app (MkT2Bad x) = MkT2Good x
11 "T3" forall x. app (MkT3Bad x) = MkT3Good x
12 "T4" app MkT4Bad = MkT4Good
13 "T5" app MkT5Bad = MkT5Good
14 #-}
15
16 app = id
17 {-# NOINLINE app #-}
18
19 main = do
20 print (app MkT1Bad)
21 print (app (MkT2Bad 42))
22 print (app (MkT3Bad 42))
23 print (app MkT4Bad 42)
24 print (app MkT5Bad 42)