danmey/omonad — pull request #1 by yallop (2013-01-28 12:03:08+00:00)
Title: Support for pattern bindings.

Support for patterns on the LHS of <--, e.g.

perform ((x, y) <-- m;
[| Some z |] <-- n;
return (x + y *z))

If pattern matching fails then "fail" is called, as in Haskell, which allows backtracking in list-like monads, for example.

Care is taken to avoid generating code that has redundant tests, or that causes warnings.

Includes some examples involving pattern matching, and a larger example translated from Hutton & Meijer's "Monadic Parsing in Haskell".