[Haskell-beginners] Usage of $

Mike Meyer mwm at mired.org
Mon Jun 8 19:30:49 UTC 2015


My apologies if I came off as rude. That was not my intent.

On Mon, Jun 8, 2015 at 2:28 PM, Rein Henrichs <rein.henrichs at gmail.com>
wrote:

> You said,
>
> > s mp $ n - 1 parses as s mp (n - 1)
> > s mp n - 1 parses as (s mp n) - 1
>
> This is not how they parse. This is how they *evaluate*. A description of
> how they *parse* would have included the ($) token in a parse tree.
>
> This mistake is what lead to our confusion and your rudeness hasn't helped
> to clarify things. Rather than pretending that we're idiots for not
> understanding what you meant, it would have been better if you had just
> said what you meant.
>
> On Mon, Jun 8, 2015 at 12:18 PM Mike Meyer <mwm at mired.org> wrote:
>
>> The OP's problem wasn't with the semantics of $. The OP's problem was
>> that the two expression had different parse trees that gave him different
>> results when evaluated. So not only was there parsing happening here, but
>> it was the root cause of his confusion.
>>
>> Given that the output of GHC's parser was the cause of the confusion, I
>> couldn't think of anything else you might have meant that made sense in
>> context.
>>
>> On Mon, Jun 8, 2015 at 2:06 PM, Rein Henrichs <rein.henrichs at gmail.com>
>> wrote:
>>
>>> Of course not. What a silly thing to suggest. I'm saying that parsing
>>> is not relevant to the behavior of ($). The parser can't tell the
>>> *semantic* difference between $ and any other operator.
>>> On Mon, Jun 8, 2015 at 11:02 AM Mike Meyer <mwm at mired.org> wrote:
>>>
>>>> Are you saying that GHC doesn't have a haskell parser?
>>>> On Mon, Jun 8, 2015 at 12:06 PM, Rein Henrichs <rein.henrichs at gmail.com
>>>> > wrote:
>>>>
>>>>> The point is that there is no parsing happening here. Just evaluation.
>>>>>
>>>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150608/24cc0c66/attachment.html>


More information about the Beginners mailing list