[Haskell-cafe] accessible layout proposal?

Daniel Fischer daniel.is.fischer at web.de
Tue Sep 22 23:06:25 EDT 2009


Am Mittwoch 23 September 2009 04:06:11 schrieb Jimmy Hartzell:
> Daniel Fischer wrote:
> > Or, what I do:
> >
> > concat
> >     [ "("
> >     , str
> >     , ")"
> >     ]
>
> This is a lot better, true, but it still takes a lot of typing, and the

Huh? Per line it's two keystrokes more than with the accessible layout proposal. That's 
not a lot.

> first element is now special-cased, preventing easy copy-and-paste

Making it slightly harder. Copy-Paste-Cursor to beginning-delete-comma.
No big deal. Besides, how often does one need to copy the beginning of one list into the 
middle of another?

> (although, admittedly, much less opportunity for mistake). On a more
> philosophical level, the signals used by the humans still are different
> from the signals used by the computer, which leads me to suspect such a
> system could still cause confusion.

I don't think so. The dominant factor to the human eye (at least to mine) is the layout. 
The commas are rather unobtrusive and go almost unnoticed.

>
> > And that is avoided, because a missing comma leaps to the eye.
>
> True. Drawing this much attention to syntax, however, is part of why I
> find it aesthetically displeasing.

To me, it doesn't draw attention to syntax, only to syntax errors.
When each line has its comma at the beginning, all is fine.
When one line lacks the comma, it looks different and only then spring the commas to 
attention.
Of course, it may be different for you.

>
> > Which is a good thing in my eyes.
>
> Well, yes, but it means that when you lay it out the way I was proposing,
> you had two levels of indentation. With the way you're using, it's a lot
> cleaner.
>
> > I see your point but remain not liking the proposal.
>
> Do you mean you see that there is a problem in the language that needs
> fixing, but you just don't like this fix?

I don't consider it a problem in the language. For me it works fine as is.
But I can understand that if

> In summary, I have to spend a good portion of my time coding Haskell
> dealing with the fact that I have a lot of {'s, ['s, and ,'s to keep track
> of, and they rarely fit on one line (records, ADTs, lists). I have to
> spend a significant amount of my coding time finagling the layout to look
> sensible,

there is reason to desire something that would simplify the process.

> Would you be open to a modified version of the proposal?

Maybe. I haven't formed an opinion yet.

> Is it an aesthetic objection, or more philosophical?

On an aesthetic level, I find #( and #[ absolutely terrible. Opening a parenthesis (or 
bracket) and not closing it just screams "WRONG!!!" to me.
On the philosophical side, I'm not fundamentally opposed to syntax sugar, but I think it 
should be added sparingly. I don't think there is sufficient reason to add this sugar, but 
if many argue that there is, I would accept such an addition (just, please don't use #( 
and #[).



More information about the Haskell-Cafe mailing list