the dreaded offside rule

Simon Marlow simonmar at microsoft.com
Fri Mar 10 06:16:57 EST 2006


On 10 March 2006 11:02, Malcolm Wallace wrote:

> "Simon Marlow" <simonmar at microsoft.com> 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


More information about the Haskell-prime mailing list