blob: 88cd3d75657bc43c05fbef1bca300498def35583 (
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
28
29
|
{-# LANGUAGE ScopedTypeVariables #-}
module GHCBug where
import Control.Applicative as Ap
import Control.Monad (MonadPlus, mplus, mzero)
import Data.Functor.Identity (Identity, runIdentity)
newtype PrintRuleInterp v = MkPRI { printRule_ :: Int -> String }
class Test p where
test :: p a -> p a
instance Test PrintRuleInterp where
test (f :: p a) =
MkPRI $ printRule_ f
newtype RecDecParser a = MkRD {
parseRD :: String -> [(String, a)]
}
pure_ v = MkRD $ \s -> pure (s , v)
instance MonadPlus RecDecParser where
mzero = MkRD $ const Ap.empty
mplus a b = MkRD $ const Ap.empty
|