layout rule infelicity

Jon Fairbairn jf15@hermes.cam.ac.uk
Thu, 30 May 2002 10:26:53 +0100 (BST)


Two very similar programmmes:

> possible_int =3D do skip_blanks
>                   fmap Just int
>                    +++ (literal "-" `as` Nothing)

> possible_int =3D do skip_blanks
>                   fmap Just int
>                   +++ (literal "-" `as` Nothing)


I think this is extremely bad language design! In general I
like having layout rules, but I've often thought that they
ought to take note of expressions, not just things in {...}
and that there ought to be "dead zones" where no programme
text is allowed, so that everything starting with the second
example and ending with

> possible_int =3D do skip_blanks
>                   fmap Just int
>                 +++ (literal "-" `as` Nothing)

should be rejected.

This example clinches it for me.  Can anyone more au fait
with the layout rule figure out how to do it?

(My past irritation was that
  ... if p
      then q
      else r

is acceptable in some circumstances, but one has to use

  ... if p
         then q
         else r

in others. Having programmes rejected I don't mind, but
having them accepted when they are too close to right but
still wrong, I really do mind)

--=20
J=F3n Fairbairn                                 Jon.Fairbairn@cl.cam.ac.uk