
8 May
2008
8 May
'08
5:40 p.m.
alexander.fuchs:
Hi there,
I am trying to write my first serious Haskell program, but have problems understanding 'strange' performance results. It seems to be a ghc specific question, so I am asking here.
In a happy parser I have this code 1):
%monad { Parsed } { thenP } { returnP }
type Parsed = State Env.Env
returnP :: a -> Parsed a returnP a = return a
thenP :: Parsed a -> (a -> Parsed b) -> Parsed b thenP x k = x >>= k
An alternative was this 2) (yes, redundant in happy):
returnP :: a -> Parsed a returnP = return
thenP :: Parsed a -> (a -> Parsed b) -> Parsed b thenP = (>>=)
Could you submit a minimal, complete grammar file, so we can look at the generated code? -- Don