Entry 782
Parser Monad
Submitted by anonymous
on May 17, 2008 at 4:06 p.m.
Language: Haskell. Code size: 194 bytes.
type M a = State -> [(a, State)] type State = String return :: a -> M a return a x = [(a, x)] (>>=) :: M a -> (a -> M b) -> M b (m >>= k) x = [(b, z) | (a, y) <- m x, (b, z) <- k a y]
This snippet took 0.00 seconds to highlight.
Back to the Entry List or Home.