I don't currently have anything to add to this discussion, but I want to encourage you all to keep having it because I think it has potential to improve the language in the "do things right or don't do them at all" philosophy that Haskell tends towards.
-- ryan
On 19/01/2012 10:19 PM, Edward Z. Yang wrote:I completely agree. See "Bimonadic semantics for basic pattern matching calculi" [1] for an exploration of just that. In the language of that paper, the issue is that there is a monad of effects for actions, and a monad of effects for pattern matching, and while these are very lightly related, they really are quite different. By varying both monads, one can easily vary through a lot of different behaviour for pattern-matching as found in the literature.
In other words,
MonadZero has no place in dealing with pattern match failure!
I should add that if we had known about some of the deeper structures of pattern matching (as in Krishnaswami's Focusing on Pattern Matching [2], published 3 years *later*), we could have simplified our work.
Jacques
[1] http://www.cas.mcmaster.ca/~kahl/Publications/Conf/Kahl-Carette-Ji-2006a.html
[2] http://www.cs.cmu.edu/~neelk/pattern-popl09.pdf
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe