[Haskell-cafe] Indentation woes

ok ok at cs.otago.ac.nz
Thu Jul 26 21:20:48 EDT 2007


Concerning

>> function argument argument2
>> | guard = body
>> | guard = body

I feel that anything that prevents that kind of horror is
a great benefit of the current rules and that this benefit
must not be lost by any revision of the rules.

The Fundamental Law of Indentation is
   "If major syntactic unit X is a proper part of major syntactic
    unit Y, then every visible character of X is strictly to the
    right[%] of the leftmost[%] visible character of Y."
[%] If you are using a right-to-left script, switch "left" and
"right" in that sentence.

That is how indentation makes structure visible, and if you
break that, you just plain aren't indenting.  This isn't fuzzy,
and it isn't aesthetic, it's simply that if you start things in
the same column you are making it obvious to the reader than
neither is part of the other.  In the example about, that's not
true.  You might as well go around ending sentences with


More information about the Haskell-Cafe mailing list