What kind of code would you write if it would be such monad?

Useless stuff like:

        s2 = do
          push 11
          push 17
          count >>= push
          binop (+)
          binop (*)
          pop

Then you should use something like

data Stack a = Stack {run :: [Integer] -> (a,[Integer])}
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to