Merge branch 'master' of http://darcs.haskell.org//testsuite
[ghc.git] / testsuite / tests / simplCore / should_compile / simpl014.hs
1 {-# LANGUAGE RankNTypes, GADTs, FlexibleContexts #-}
2 {-# OPTIONS_GHC -O2 #-}
3
4 -- This one make SpecConstr generate bogus code (hence -O2),
5 -- with a lint error, in GHC 6.4.1
6 -- C.f. http://hackage.haskell.org/trac/ghc/ticket/737
7
8 module ShouldCompile where
9
10 data IHandler st where
11 IHandler :: forall st ev res.
12 Serialize (TxContext ev) => String -> IO ev
13 -> (res -> IO ()) -> Ev st ev res -> IHandler st
14
15 data Ev st ev res = Ev
16 data TxContext evt = TxContext
17 data TxConfig = TxConfig
18 data M a = M a
19
20 class Serialize a where
21 instance Serialize a => Serialize (TxContext a)
22 instance Serialize Int
23 instance Serialize ()
24
25 data IHR st = forall res ev. Serialize (TxContext ev) => IHR (TxContext ev)
26
27
28 runHandler :: M (IHR st) -> IHandler st -> IO ()
29 runHandler queue ih@(IHandler tstring inp out run) = runHandler queue ih
30