The spelling of the word "currying" might seem confusing, but it can be easily explained through its pronunciation. The word is spelled with two Rs because it is pronounced with a double consonant sound. In phonetic transcription, it can be written as /ˈkʌr.iɪŋ/. The first syllable "cur" is pronounced with a short "u" sound followed by an "r" sound, while the second syllable "ry" is pronounced with an "i" sound followed by another "r" sound. "Currying" refers to the process of rubbing or grooming a horse and has its roots in old English terminology.
Currying is a concept used in functional programming that refers to the technique of transforming a function that takes multiple arguments into a sequence of functions, each taking a single argument. It is named after the logician Haskell Curry, who introduced the concept.
The process of currying involves breaking down a function with multiple arguments into a chain of functions, where each function takes one argument and returns a function as its result. The returned function then takes the next argument in the sequence, until all the arguments are satisfied and the final result is obtained.
The purpose of currying is to convert a function that takes multiple arguments into a series of single-argument functions, which aids in function composition and enables the creation of more flexible and reusable code. By currying functions, they become modular and can be partially applied, meaning you can fix some of the arguments beforehand, and then use or pass the partially applied function to another function or as a callback.
Currying plays an important role in functional programming languages as it supports the principles of immutability and supports building higher-order functions. It facilitates the creation of powerful and concise code by enabling the composition of smaller, reusable functions.
In summary, currying refers to the process of breaking down a function with multiple arguments into a sequence of functions, each taking one argument, that aids in function composition, code reusability, and higher-order function creation in functional programming.
The act of dressing skins after they are tanned; the act of rubbing down a horse.
Etymological and pronouncing dictionary of the English language. By Stormonth, James, Phelp, P. H. Published 1874.
* The statistics data for these misspellings percentages are collected from over 15,411,110 spell check sessions on www.spellchecker.net from Jan 2010 - Jun 2012.
The word "currying" originates from the practice of "currying a horse", which dates back to medieval times. "Curry" in this context comes from the Old French word "correier", meaning "to prepare" or "to get ready". Currying a horse involved using a comb or brush to remove dirt, debris, and dead hair from the horse's coat, as well as to stimulate blood circulation to promote a healthy coat. Over time, the term "currying" extended beyond horse care and began to be used metaphorically to describe efforts to win favor or gain approval. Consequently, the term "currying favor" arose, indicating an attempt to please or appease someone in order to gain their support or approval. Today, "currying favor" is the most common usage, but "currying" on its own can also be used figuratively to describe efforts to win favor or manipulate opinion.