[Haskell-cafe] Re: [Haskell-beginners] map question

Will Ness will_n48 at yahoo.com
Tue Oct 20 13:21:02 EDT 2009


Jason Dagit <dagit <at> codersbase.com> writes:

> On Mon, Oct 19, 2009 at 5:53 PM, Will Ness <will_n48 <at> yahoo.com> wrote:
>> 
>> You think of functions, where domain matters (for purists?). In syntax 
>> only the result matter, does it read? Does it have an intended meaning?
>> How is it a mistake if it expresses what I intended?
>> Both 3 `-` 2 and curry fst `foldl` 0 are exactly the same - expressions with
>> infix operator, read in the same way, interpreted in the same way. In 
>> the first case the backticks are made superfluous by Haskell reader for 
>> our convinience; but they shouldn't be made illegal. Why should they be? 
> 

> Don't you mean 3 `(-)` 2?  I'm pretty sure -, without the parens is infix and 
> (-) is prefix.  So it seems to me that you need the brackets for this to be 
> consistent.Jason

You absolutely right, in current syntax that also would only be consistent, yet 
is illegal also.

But I propose to augment the syntax by allowing symbolic ops in backticks to 
stand for themselves.

When I see `op`, for me, it says: infix op. So `+` would also say, infix +. (`-
` 2) would finally become possible. It would read: treat - as infix binary and 
make a flip section out of it. Just as it does for an alphanumeric identifier 
in (`op` 2).

Without backticks, symbolic ops are also treated as infix by default, but 
that's just convinience.

Anyway I guess all the points in this discussion have been made, and it's just 
a matter of taste. 




More information about the Haskell-Cafe mailing list