DrRacket Curry 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)
Using DrRacket
Curry 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
my-curry: implement your own version of curry. Your version should behave identically to curry, but need only work on procedures with fixed arity. E.g.,
> ((my-curry even?) 2)
#t
> (((my-curry cons) 1) 2)
'(1 . 2)
> ((my-curry cons 1) 2)
'(1 . 2)

Trending now
This is a popular solution!
Step by step
Solved in 2 steps









