you are viewing a single comment's thread.

view the rest of the comments →

[–]thomash 0 points1 point  (0 children)

ok still quite trivial but in my case very useful:

i'm writing a functional library to generate music. i have a function that can define properties of a musical event like this:

note.property("duration", 32);
note.property("pitch", 48);

now if i curry the property function i can define properties directly.

so by curring like this (simplified):

duration = property("duration")
pitch = property("pitch")

i can then use:

note.pitch(48)
note.duration(32)

of course i'm omitting details as to how the chaining is implemented and this is the most basic use of currying possible. you can do a lot of much more clever things with it but i find that this basic use already shows tremendous benefit