[Haskell-cafe] Indentation woes

Steve Schafer steve at fenestra.com
Fri Jul 27 11:04:06 EDT 2007


On Fri, 27 Jul 2007 00:33:17 -0400, you wrote:

>What makes this a law? If you notice a pattern where beginners trip
>against this rule because they don't indent the arms of conditionals
>properly inside do blocks, should strict adherence to this principle
>take precendence over the intuition of prospective users of the
>language?

What exactly are you proposing as an alternative rule? If you're
suggesting that _any_ line at the same level of indentation as the
previous line be treated as a continuation of that line, then how would
one go about indicating that a line is _not_ a continuation of the
previous line?

On the other hand, if you're suggesting that only certain things be
recognized as being a continuation of the previous line (e.g., guard
clauses), then it seems to me that you're replacing a brain-dead simple
and straightforward rule with one that is inherently more complex and
thus more likely to cause angst among beginners.

Or are you proposing to get rid of layout altogether and rely on
punctuation?

I just can't think of a rule that would be easier to understand (and
quicker to assimilate) than the current one.

Steve Schafer
Fenestra Technologies Corp.
http://www.fenestra.com/


More information about the Haskell-Cafe mailing list