
10 Mar
2006
10 Mar
'06
6:16 a.m.
On 10 March 2006 11:02, Malcolm Wallace wrote:
"Simon Marlow"
wrote: Here's another couple that just occurred to me:
f x | let y = x = y f x = case x of _ | let y = x -> y
granted these are unlikely to occur in practice.
Are these Haskell'98? I'm afraid I don't understand how a let binding (without "in") can occur in a guard for a function decl or case branch. In Ben's examples, the vertical bar was not a guard, but the separator in a comprehension (although he omitted to show the surrounding brackets...)
[ ... | let x, y :: T x = 3 y = 4, ... ]
[ ... | let x = 3, ... ]
Right, they're not Haskell 98, they all require pattern guards. Cheers, Simon