[Haskell-cafe] Sequencing Parsers: a Simple Example

PR Stanley prstanley at ntlworld.com
Sat Dec 1 10:13:32 EST 2007

(>>=) :: Parser a -> Parser b -> Parser b
p >>= f = \inp ->
   case p inp of
     [] -> []
     [(v, out)] -> parse (f v) out
based on a lot of guesswork, after the mess created by the OCR, I 
managed to get the above example to work syntactically but is it 
semantically correct?
Thanks, Paul

More information about the Haskell-Cafe mailing list