[nem-en] function partial application

Philippe Quesnel philippe.quesnel at gmail.com
Wed Oct 5 07:53:40 CEST 2005


hi,
I was just reading some haskell / clean tutorial & was wondering about
something.

here's the 'simple' example:
(assuming a func 'inc' that does +1 on a value)

----------------
-- apply func 'f' twice on x
twice f x = f (f x)

twice twice inc 0 == 4
twice twice twice inc 0 == 16
twice twice twice twice inc 0 == 65536
---------------

while trying to figure out exactly how this works,
I realized it's a bit more complicated than might be expected at 1st.
(I think it works because of partial function application, (ie function
application is left associative ! ?) )

.. anyways .. how would this be done in Nemerle ?
is it possible to have a solution 'as powerfull' as the above one ?

(without a thownsand parentheses & cie)

thx
Philippe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman/pipermail/devel-en/attachments/20051005/5e7e02c2/attachment.html


More information about the devel-en mailing list