News for hackers. Stuff that matters.
Re:Currying in JavaScript by savanaly on Sunday September 19, 2021 @11:51PM (#28590231)
>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

There are no comments on this comment yet.