Partial application

38 views
Skip to first unread message

Lindsay Winkler

unread,
Oct 24, 2016, 2:09:15 AM10/24/16
to nicta-fp
Given Haskell's world view ("every function takes one argument"), is it fruitful at all to consider the concept of "partial application"?

It seems to me that it may be useful in the context of functions taking multiple arguments to think that "I have a function accepting three arguments, and I give it one, and now I have a function accepting two arguments".  

There seems to be less utility in thinking "I have a function that accepts one argument, and I give it an argument, and now I have a function accepting one argument".  Do we really care what our function that accepts one argument was before we got our hands on it?

The information contained in this e-mail message and any accompanying files is or may be confidential. If you are not the intended recipient, any use, dissemination, reliance, forwarding, printing or copying of this e-mail or any attached files is unauthorised. This e-mail is subject to copyright. No part of it should be reproduced, adapted or communicated without the written consent of the copyright owner. If you have received this e-mail in error please advise the sender immediately by return e-mail or telephone and delete all copies. Fairfax Media does not guarantee the accuracy or completeness of any information contained in this e-mail or attached files. Internet communications are not secure, therefore Fairfax Media does not accept legal responsibility for the contents of this message or attached files.

Tony Morris

unread,
Oct 24, 2016, 2:17:27 AM10/24/16
to Lindsay Winkler, nicta-fp
Hi Lindsay, strictly speaking, yes all Haskell functions take one argument, including type functions. This subtle point becomes important when partially applying those functions. Specifically, we apply one argument, then might receive a function in return, to which we apply one argument, and so on. Where it becomes important is in expressions, such as:

(++) = flip (foldRight (:.))

What does it mean to apply foldRight to (:.) and then flip that function? This only makes sense if we apply a strict interpretation, all functions take one argument, including the one that comes back after we apply foldRight to (:.) and then again when we flip that resulting function.

As to talking about "partial application", it becomes slightly less meaningful in this context [of functions taking one argument]. Are we really partially applying, or just applying the one [and only one] argument?

Then, when we talk about "functions taking two [or more]" arguments, we really mean this as an approximation in communication, because making the strict distinction would be a mouthful.

* Function f takes two arguments, one of type T and then U.
* Function f takes one argument of type T, which returns a function that takes one argument of type U.

This problem is exaggerated the "more arguments" we begin to accept. So, we shorten our vocabulary, knowing it is ultimately an approximation.

Hope that helps.


--
You received this message because you are subscribed to the Google Groups "nicta-fp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nicta-fp+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lindsay Winkler

unread,
Oct 24, 2016, 2:21:28 AM10/24/16
to nicta-fp, lwin...@domain.com.au
Thank you.  Much appreciated!
To unsubscribe from this group and stop receiving emails from it, send an email to nicta-fp+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages