[Haskell-beginners] Re: map question

Will Ness will_n48 at yahoo.com
Sun Oct 18 16:40:46 EDT 2009

Daniel Fischer <daniel.is.fischer <at> web.de> writes:

> Am Sonntag 18 Oktober 2009 13:11:07 schrieb Will Ness:
> >
> > backticks could've been made no-op for operators. What's so wrong with
> > (`:`[])? It'd just be the same as (:[]).
> Makes writing the parser more complicated.
> Makes reading code more irritating.

I suspected as much, but if it has some benefits, that would be justified.

> > Except for `-`, where it would finally provide us with possibility to write
> > a shortcut for the ugly (flip (-) 1) as (`-`1).
> That's ugly too.
> My favourite is subtract 1.

We could write (hypothetically) 'concatenate' for ++ too, but we don't. What's 
so great with writing out long names, that should be processed, mentally, to 
get at their meaning, when we have this nice operators syntax which makes the 
meaning immediately - visibly - apparent? 

The only problem in Haskell syntax is this unary-over-binary (-), so allowing 
backticks for operators as well as for regular names would finally provide a 
solution for it.

Nobody would use it except for (-) sections. Or even, hypothetically, it could 
be used to allow unary operators in the language, in general. That whould be a 
mechanism for distinguishing the binary from the unary versions.

Why not? Difficulty of writing a parser is not a valid reason if there's a 
clear utility in it. IMHO.

More information about the Beginners mailing list