4 ms·
>What about partial application of named parameters? Builder pattern. In a language that accommodates it well, such as Elm, it would look like this: IconL
by 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