Re: layout rules for "where"

2002-02-07 Thread Ian Zimmerman
Zhanyong> I was lucky to spot the source of the problem quickly Zhanyong> because I knew I recently changed that line, but in general, Zhanyong> this kind of error can be very hard to locate. (In my case, Zhanyong> the offending code is 600 lines away from where the bug is Zhanyong> manifested,

Re: layout rules for "where"

2002-02-07 Thread Malcolm Wallace
> Can't we require that a local definition be more indented than the > enclosing definition? It is required in Haskell'98. You have stumbled on a bug in Hugs, which you should report to the maintainers. Regards, Malcolm ___ Haskell mailing list [E

Re: Layout rules.

1999-07-02 Thread Malcolm Wallace
| > | mcompare x y = | > | do i <- x ==~ y | > | if i then return EQ else do | > | i <- x <=~ y | > | if i then return LT else do | > | return GT | | The reason you didn't understand it the first time is because you

Re: Layout rules.

1999-07-02 Thread Keith Wansbrough
Malcolm writes: > To be honest, I consider the first of these variants to be an ugly and > confusing misuse of layout, and the second to be clear (if not the most > beautiful way to code it). The first seems to be trying to simulate a > C-style `return', which is in reality not at all like the t

Re: Layout rules.

1999-07-02 Thread Malcolm Wallace
| > | f x = case x of | > | (a,b) -> case a of | > | (c,d) -> case b of | > | (e,f) -> [c,d,e,f] | > | > You can't be serious! This is a great example of mis-using layout to | > baffle and bemuse. | | I belive he is as it is very similar to | | {- code -} >>= \(a,b)

Re: Layout rules.

1999-07-02 Thread Kevin Atkinson
Malcolm Wallace wrote: > > | mcompare x y = > | do i <- x ==~ y > | if i then return EQ else do > | i <- x <=~ y > | if i then return LT else do > | return GT > | with strictly increasing indentation iut would have

RE: Layout rules.

1999-07-02 Thread Simon Marlow
Try this variation on the same theme: > > mcompare x y = >do i <- x ==~ y > if i then return EQ else do i <- x <=~ y > if i then return LT else do return GT > > This code now has a very serious bug! The code is illegal, isn't it? The