[Haskell-cafe] Re: [Haskell-beginners] map question
Jason Dagit
dagit at codersbase.com
Mon Oct 19 22:23:31 EDT 2009
On Mon, Oct 19, 2009 at 5:53 PM, Will Ness <will_n48 at yahoo.com> wrote:
> Tom Tobin <korpios <at> korpios.com> writes:
>
> > On Mon, Oct 19, 2009 at 5:34 PM, Will Ness <will_n48 <at> yahoo.com>
> wrote:
> > > This syntax already exists. The '`' symbol is non-collating already, so
> > > using it for symbol chars doesn't change anything (it's not that it
> > > can be a part of some name, right?). To turn an infix op into an infix
> op
> > > is an id operation, made illegal artificially at the scan phase after a
> > > successful lex (or whatever).
> >
> > If I've accidentally applied syntax meant for a prefix operator to an
> > infix operator, *I want the compiler to tell me*, and not to silently
> > accept my mistake.
>
> You don't apply sytax, you write it.
>
> 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? I truly don't
> understand the resistance to this idea. :)
>
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091019/46671e08/attachment.html
More information about the Haskell-Cafe
mailing list