[Haskell-cafe] Bird-style and blank lines
tanimoto at arizona.edu
Mon Sep 22 00:27:53 EDT 2008
On Sun, Sep 21, 2008 at 10:02 PM, wren ng thornton <wren at freegeek.org> wrote:
> By intention, probably. But by accident it is a lot more common than you
> might think. Accidents like corrupting the linebreaks or line wrapping in a
> file are quite prevalent when exchanging files across different platforms or
> medium formats. Consider also file type misdetection with other languages
> like HTML; or more convincingly, consider language interleaving. And
> there're always garden variety typos like dropping a bird track or adding a
> space before it.
> Usually such corruption is easily captured by code not compiling, but I
> think the big thing to consider when suggesting changes to the .lhs format
> is how it affects the robustness of detecting file corruption, typos, etc.
> The whitespace restriction captures a goodly number of typos mentioned
> above, though it may not be so helpful for the other corruptions.
Thanks for your thoughts. I see your point and I agree it's an
important one. For example, as you well know, if you produce HTML
with our Haskell libraries, there's some good chance you'll end up
with a ">" mark in the beginning of the line, because of the way the
tags are written.
However, that's HTML. If you decide to interleave with other
languages, I don't think the probability of having a ">" unexpectedly
showing up in the beginning of the line is enough to justify making
this a rule.
In most languages it would be like writing a condition very close to
the end of the line and having it break in the middle:
I think the restriction made sense when the report was written, but
what I'm arguing is that given new developments we have made, the
benefits of lifting the restriction are greater than keeping it. At
least for me! : ) To be sure, I'm weighting the chances that the
mandatory blank lines will save you versus the possibility of writing
in Bird-style more freely.
Again, please do point out other flaws in my argument.
More information about the Haskell-Cafe