Re:"Useless syntax sugar": Numbered block parameters in Ruby
by Varriount on Wednesday October 11, 2023 @09:25PM
(#37852426)
Huh, what is the difference between currying and partial application? I always thought the terms were interchangeable.
[ Parent
| on HN ]
Re:"Useless syntax sugar": Numbered block parameters in Ruby
by dragonwriter on Thursday October 12, 2023 @05:28AM
(#37855068)
> Huh, what is the difference between currying and partial application?
Partial application (of one arg) takes a function that is of type:
(a, b, c) -> d
And makes it: a -> (b, c) -> d
Currying makes it: a -> b -> c -> d
Ruby’s Proc#curry does magic that mostly lets you pretend its either or something in between.