[Haskell-cafe] Comma in the front

Henning Thielemann lemming at henning-thielemann.de
Thu Jul 13 05:15:05 EDT 2006


On Thu, 13 Jul 2006, Jon Fairbairn wrote:

> On 2006-07-13 at 02:29BST "Neil Mitchell" wrote:
> > Hi,
> > 
> > > Are cool kids supposed to put the comma in front like this?
> > Some cool kids do, some cool kids don't. Some do both, depending on their mood.
> > 
> > The advantage of a leading , is that now the comma's line up, and if
> > you want to add an item on the end of a list
> > 
> >   [a
> >   ,b
> >   ,c
> >   ]
> > 
> > It's just a one line change, whereas with the comma after, you'd have
> > to change the previous line as well - which is more effort and gives
> > more noise in the darcs copy.
> 
> This is one of my pet hates.  First, people find things
> easier to read if they are in a form that they have
> encountered lots of times before (in addition to
> psycho-visual factors). I'd like to think that Haskell
> programmers read a lot of literature (and since they should
> have started reading this long before they learnt to
> programme, and continue so to read, they're going to have
> read more literature than code). So for me (and anyone else
> moderately literate) a list written
> 
> [a,
>  b,
>  c
> ]

Optimal notation of lists, because of most easiest editing, is

a:
b:
c:
[]


=B-]


More information about the Haskell-Cafe mailing list