3 ms·
Agreed. I've come to view partial application as the original coder saying "I guarantee you'll never need to inspect or modify this parameter from now on." Obvi
by mLuby 5y ago
Agreed. I've come to view partial application as the original coder saying "I guarantee you'll never need to inspect or modify this parameter from now on." Obviously, that's rarely true in practice.
What about partial application of named parameters?
- savanaly 5y ago>What about partial application of named parameters? Builder pattern. In a language that accommodates it well, such as Elm, it would look like this: IconLib.downloadIcon |> IconLib.withSize 12 |> IconLib.withColor "red" |> IconLib.withCssClass "dl-icon" Allowing currying of any parameter like: standardDownloadIcon = IconLib.downloadIcon |> IconLib.withSize 12 largeDownloadIcon = IconLib.downloadIcon |> IconLib.withSize 16