racket Higher Order Functions Curry


Example

Returns a partially applied function.

> ((curry + 10) 20)
30

curryr can be used when the arguments need to be inserted at the end. In other words, (curryr list 1 2) will produce a function expecting some new-arguments .... When called, that new function will in turn call (list new-arguments ... 1 2).

> (((curryr list) 1 2) 3 4)
'(3 4 1 2)
> ((curryr list 1 2) 3 4)
'(3 4 1 2) 
> ((curryr - 30) 40)
10
> (((curryr -) 30 40))
10