News for hackers. Stuff that matters.
Re:Currying in JavaScript by mLuby on Sunday September 19, 2021 @02:44PM (#28586798)
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?

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