[Haskell-beginners] Usage of $

Sumit Sahrawat, Maths & Computing, IIT (BHU) sumit.sahrawat.apm13 at iitbhu.ac.in
Tue Jun 9 01:45:31 UTC 2015


> s mp $ n - 1 parses as s mp (n - 1)
> s mp n - 1 parses as (s mp n) - 1

It should be

s mp $ n - 1 parses as ($) (s mp) (n - 1) which evaluates to s mp (n - 1)
The parsing goes this way because ($) has the lowers precedence.

-- 
Regards

Sumit Sahrawat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150609/d9fabf40/attachment.html>


More information about the Beginners mailing list