[Issue 8798] New: Tuple curry example not really curry
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Oct 10 19:57:20 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8798
Summary: Tuple curry example not really curry
Product: D
Version: D2
Platform: All
URL: http://dlang.org/tuple.html
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: websites
AssignedTo: nobody at puremagic.com
ReportedBy: Jesse.K.Phillips+D at gmail.com
--- Comment #0 from Jesse Phillips <Jesse.K.Phillips+D at gmail.com> 2012-10-10 19:33:11 PDT ---
Per doc comment: http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/Tuples
Actually they call it "partial function application"
Currying is something else often mistaken for partial evaluation.
Currying is treating a function of N args that returns Ret
func: (Arg1,Arg2,Arg3) -> Ret
as a function that does partial application of arguments "to the max"
func: Arg1 -> (Arg2 -> (Arg3 -> Ret))
That's a
function that takes an Arg1 and returns
(a function that takes an Arg2 and returns
(a function that takes an Arg3 and returns a Ret))
So the call func a b c is treated as (((func a) b ) c) with currying. In ML for
instance, all functions are curried by default (but you can sort of override
the behavior by declaring your function to take a tuple as a single argument).
Python has a partial application library that was originally called 'curry'
until the functional folks shot it down as a misnomer. Now it's called
'partial'. Python Partial Function Application
http://www.python.org/dev/peps/pep-0309/
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list