On Mon, Jul 23, 2007 at 05:09:01AM -0400, Dan Licata wrote: > Hi everyone, > > Simon PJ and I are implementing view patterns, a way of pattern matching > against abstract datatypes, in GHC. Our design is described here: > > http://hackage.haskell.org/trac/ghc/wiki/ViewPatterns > > If you have any comments or suggestions about this design, we'd love to > hear them. You can respond to this list (and we can take it to > haskell-cafe if the thread gets long) or, if you prefer, directly to me.
Great work! Two comments: 1. It might be better if zenary => used Bool rather than Maybe (). This would allow existing Bool functions to be used as views; eg: foo (isUpper =>) = ... foo ((< 3) =>) = ... foo (ioErrors => (isEOFError =>)) = ... 2. This does introduce another point of infinite lookahead into the grammar. Consider (long text... - after seeing the (, we might be seeing a parenthetized patern (back to pat*) or a expression for a view guard (go to exp). Won't affect implementations that already mix the two (Language.Haskell.Parser, thus probably GHC too). Stefan
signature.asc
Description: Digital signature
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell