> what laws should hold for the (++) operation?
Associativity and leftward distributivity are missing in the Report:
(m ++ n) ++ o = m ++ (n ++ o)
(m ++ n) >>= k = (m >>= k) | (n >>= k)
On the other hand right distributivity does not hold in general.
Conversely, the report also requires zero to be a right zero of >>
which I do not support (if you combine backtracking and exception
handling you probably expect raise e >> zero = raise e ).
HTH, Ralf
- laws for MonadPlus? Johannes Waldmann
- Ralf Hinze
