[Haskell-beginners] [x] and (x:_) for lists -- did you ever think that odd?

Ertugrul Söylemez es at ertes.de
Mon May 21 01:58:23 CEST 2012


AntC <anthony_clayden at clear.net.nz> wrote:

> Would this pattern matching seem less odd?:
>
>      head       [x ..] = x
>      length     [x, xs at ..] = 1 + length xs

No, it seems and is more odd.  Why hide the list constructors behind
weird notation?  Why require syntactic peculiarities and special cases
for pattern-matching lists?  In particular, what does pattern-matching
against "enumFrom x" mean?  Oh, it means something different here?

Your proposed syntax is very arbitrary and helps to confuse everybody.
Haskell has very simple syntactic rules, and I'm sure I'm speaking for
most of the Haskell community when I say that we would like to keep it
that way.  We have access to the two list constructors (:) and []
directly and they are very convenient, so there is no need for weird
syntax just to enforce a set of ASCII characters in source code.


> Experienced Haskellers need not answer: you've got too used to ( :  )
> ;-)

Sorry, but this statement is very infantile.  Even if meant as a joke,
it's at best offensive and at worst insulting.  There is good reasoning
behind (:) and [], and just because you don't see it there is no reason
to imply that experienced Haskell programmers are stubborn.  Haskell
programmers are about as open-minded as programmers can get.

If you want people to take your proposals seriously, you shouldn't
offend the very persons who evaluate them.


Greets,
Ertugrul

-- 
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/beginners/attachments/20120521/f7bdf9a4/attachment.pgp>


More information about the Beginners mailing list