the dreaded offside rule

Simon Marlow simonmar at
Fri Mar 10 05:27:39 EST 2006

On 09 March 2006 22:56, Ian Lynagh wrote:

> On Thu, Mar 09, 2006 at 04:53:52PM -0000, Simon Marlow wrote:
>> On 09 March 2006 14:40, Simon Marlow wrote:
>>> But ISTR I later discovered a reason that counting brackets wouldn't
>>> work so well, but for now it escapes me.  I'll try to dig it up.
>> I remember now: the problem is that 'let' does not always have a
>> matching 'in', e.g. when it is used in 'do', pattern guards or list
>> comprehensions.  So you can't consistently treat let/in as brackets.
>> I don't know a way around this.
> Right, I mentioned that in my earlier mail.

So you did, sorry, I skimmed it too quickly.

Ben's mail pretty much covers the problems with this idea, I think.
It's unfortunate, because it almost works.

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.


More information about the Haskell-prime mailing list