blob: 91a3272a920965152335b3c12e864a497d4f7954 (
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
|
{-# LANGUAGE Rank2Types #-}
-- These ones failed with 5.04. They need a coercion
-- in the pattern matching compiler, so they are a bit
-- tricky.
-- GHC 6.3: these are back to failures, because we no longer do
-- type subsumption in pattern-matching
-- GHC 7.0: back to success
module ShouldCompile where
newtype Bug s a = Bug a
runBug :: (forall s. Bug s a) -> a
runBug (Bug _) = undefined
newtype BugN s a = BugN a
runBugN :: (forall s. BugN s a) -> a
runBugN (BugN _) = undefined
data Foo a b = Foo { foo :: a -> b }
baz :: String -> (forall a b . Foo a b) -> IO ()
baz s (Foo { foo = foo }) = putStrLn s
|