[Haskell-beginners] Usage of $

Shishir Srivastava shishir.srivastava at gmail.com
Sun Jun 7 20:09:06 UTC 2015


Hi,

Can someone please highlight how '$' is making the difference in the
execution of this function. With $ in place the function runs fine but
without $ for large input values the function overflows the stack.

--------
s mp 1 = 4
s mp n = ((s mp $ n-1)^2-2) `mod` mp
--------

I cannot understand the difference between
(s mp $ n-1) and (s mp n-1)

Thanks,
Shishir Srivastava
 +44 (0) 750 127 5019
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150607/c349afe7/attachment.html>


More information about the Beginners mailing list