Merge branch 'master' into atomics
[ghc.git] / testsuite / tests / simplCore / should_compile / simpl010.hs
1
2 {-# LANGUAGE ExistentialQuantification #-}
3
4 -- This tests an interaction between GADTs and join points
5 -- The case-of-case transformation can pretty easily result
6 -- in a type mis-match, because the join point does not see
7 -- the refinement from the case branch
8
9 module ShouldCompile( h ) where
10
11 data T a = forall b. T b [a] | T2
12
13 f :: a -> T a -> [a]
14 f x (T _ a) = a ++ a ++ a ++ [x]
15 f x T2 = [x]
16
17 h :: a -> Bool -> T a -> T a -> [a]
18 h x b p q = f x (case b of { True -> p; False -> q })
19