the dreaded offside rule

Ian Lynagh igloo at
Thu Mar 9 17:55:52 EST 2006

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. However, I think this can be
handled by rules like

     L (<n>:ts) ((Let:bs,m):bsms)   =   L ts ((bs,m):bsms)  if m = n

but like I said, I haven't had time (nor do I expect to have time for
H') to work it all out and see if it can actually be made to work.

Incidentally, in my head the "," in "(case x of p -> e, 42)" acts as a
right and left bracketing lexeme, so this expression would still be
accepted. At the cost of rejecting more H98 programs you wouldn't have
to allow it, of course, although from the user's point of view I'd
prefer if it was allowed.

(By the way, have the mailing lists started being clever and not sending
you messages that look like they are also being sent directly to you?)


More information about the Haskell-prime mailing list