do-and-if-then-else modification
Brian Smith
brianlsmith at gmail.com
Mon Feb 19 07:11:24 EST 2007
On 2/19/07, Ross Paterson <ross at soi.city.ac.uk> wrote:
>
> On Mon, Feb 19, 2007 at 11:16:03AM +0000, Malcolm Wallace wrote:
> > isaac jones <ijones at galois.com> wrote:
> > > Iavor and I just made the trivial modification for DoAndIfThenElse
> > >
> > > Any comments on this modification? How do people feel about the
> > > suggestion that we do it for case statements as well?
> >
> > I'm happy to allow the change for if-then-else. The need for extra
> > indentation there has annoyed me a few times.
>
> The semicolon before the "else" is the most useful. Adding another
> before the "then" has less motivation.
I think it is a bad idea to make the non-layout syntax more complicated and
less readable, just so that, indirectly, the layout syntax can be improved.
Improvements to the layout mechanism should be localized to the section of
the report describing layout, and such improvements shouldn't do anything to
harm the non-layout syntax. In particular, why you don't just say that
"else" and "of" act like ";" during layout?
do { q <- if x
; then y ; else z
; return q
}
- Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-prime/attachments/20070219/0ca64190/attachment.htm
More information about the Haskell-prime
mailing list