Mar 27, 2023
Partials are particularly useful for creating anonymous functions in place. For example if you wanted to use map to apply exponentiate to a list, using a fixed exponent of 3. You could just do:
map(partial(exponentiate, 3), mylist)
Partials are particularly useful for creating anonymous functions in place. For example if you wanted to use map to apply exponentiate to a list, using a fixed exponent of 3. You could just do:
map(partial(exponentiate, 3), mylist)
Software developer and maths enthusiast. graphicmaths.com