Fold testsuite.git into ghc.git (re #8545)
[ghc.git] / testsuite / tests / typecheck / should_fail / T5691.hs
1 {-# LANGUAGE ScopedTypeVariables #-}
2
3 module GHCBug where
4
5 import Control.Applicative as Ap
6 import Control.Monad (MonadPlus, mplus, mzero)
7 import Data.Functor.Identity (Identity, runIdentity)
8
9 newtype PrintRuleInterp v = MkPRI { printRule_ :: Int -> String }
10 class Test p where
11 test :: p a -> p a
12
13 instance Test PrintRuleInterp where
14 test (f :: p a) =
15 MkPRI $ printRule_ f
16
17
18 newtype RecDecParser a = MkRD {
19 parseRD :: String -> [(String, a)]
20 }
21
22 pure_ v = MkRD $ \s -> pure (s , v)
23
24 instance MonadPlus RecDecParser where
25 mzero = MkRD $ const Ap.empty
26 mplus a b = MkRD $ const Ap.empty
27
28
29