Omg-Curry

Languages and libraries

javascript library

SHOW HN2020

11points
16comments
#2,323of 3,028 in 2020
Top 77%of 2020 by points

How HN took it

MixedNo clear lean

4 positive, 4 neutral or asking, 0 mixed, 2 critical, out of 10 comments about the project. Thread score +0.02.

Idea: 4 for, 1 againstExecution: 0 for, 1 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Currying is useful with functional composition and list iteration

    From 2 comments
    • Currying becomes useful in tandem with functional composition.
      oweiler on HN
    • It's nice for any type of list iteration. I'll share my "match" function (for use when filtering) when I'm at my computer tomorrow.
      smichel17 on HN

Objections

  • Currying in dynamic languages masks bugs and gives cluttered stack traces

    From 1 comment
    • I had mixed results in the past when I tried to use currying in Javascript. The stack traces were cluttered by references to the currying function and it also masked bugs if you…
      ufo on HN
  • The add example is boring and unconvincing as a use case

    From 1 comment
    • Sorry I'm not that familiar with this. What would be a good use-case for currying? The example doesn't feel that exciting... ``` add4(1)(3)(5)(10) add4(1)(3,5)(10) add4(1,3,5,10)…
      gitgud on HN

Requests

  • Support for currying arguments in any order using placeholders

    From 1 comment
    • I like this too (and use a version myself) however this form only supports one argument at a time. E.g. add(1,2) is going to return the curry of add(1), which is not what you…
      javajosh on HN

Questions

  • What is a good use case for currying in JavaScript?

    From 1 comment
    • Sorry I'm not that familiar with this. What would be a good use-case for currying? The example doesn't feel that exciting... ``` add4(1)(3)(5)(10) add4(1)(3,5)(10) add4(1,3,5,10)…
      gitgud on HN
  • How does currying work with TypeScript?

    From 1 comment

Alternatives named

  • Native arrow function currying

    From 1 comment
    • JavaScript actually has a pretty ergonomic way of doing currying natively: ``` const add = (a) => (b) => a + b; [1, 2, 3, 4].map(add(2)); // [3, 4, 5, 6] ```
      brundolf on HN
  • Lodash _.curry and _.partial

    From 1 comment
    • The add example is a bit boring because all the arguments are the same "kind". Partial evaluation is more interesting if the arguments are more independent. To borrow a contrived…
      ufo on HN
  • Pipeline operator proposal

    From 1 comment
    • What it ends up being for normal usage is something like this: ``` add(1)(2) ``` Which is admittedly a little bit clunky, though from a quick read I don't think the library helps…
      brundolf on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/24089550)