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