
I suppose I wasn't entirely clear.
"where" is syntactic sugar for "let...in", pattern matching is syntactic
sugar for "case", and guards are syntactic sugar for "if..then..else" and/or
"case" (for pattern guards)
In fact, the whole reason for the existence of "where" is so that it can
attach at a higher-level scope and make use of the other syntactic sugar
(like guards). Also, I find the postfix definitions in "where" to generally
be more readable, but that is a matter of taste.
-- ryan
On Sat, Oct 31, 2009 at 11:33 AM, Chaddaï Fouché
On Sat, Oct 31, 2009 at 8:09 PM, Ryan Ingram
wrote: "where" is just syntactic sugar for "let...in"
That's not perfectly true : "where" and "let...in" don't attach to the same syntactic construction, "where" attaches to a definition and can works for several guard clauses whereas "let ... in expression" is an expression in itself.
-- Jedaï