News for hackers. Stuff that matters.
Re:A Case Against Currying by jstanley on Sunday March 22, 2026 @03:02PM (#47480878)
If 0 and a function that always returns 0 are the same thing, does that make `lambda: lambda: 0` also the same? I suppose it must do, otherwise `0` and `lambda: 0` were not truly the same.
Re:A Case Against Currying by fn-mote on Sunday March 22, 2026 @03:34PM (#47481227)
Another way to make the point: when you write 0, which do you mean?

In a pure language like Haskell, 0-ary functions <==> constants

Re:A Case Against Currying by tikhonj on Sunday March 22, 2026 @09:20PM (#47484324)
In a non-strict language without side-effects, having a function with no arguments does not make sense. Haskell doesn't even let you do that.

You can write a function that takes a single throw-away argument (eg 0 vs \ () -> 0) and, while the two have some slight differences at runtime, they're so close in practice that you almost never write functions taking a () argument in Haskell. (Which is very different from OCaml!)

Re:A Case Against Currying by ssivark on Monday March 23, 2026 @04:24AM (#47486699)
Yes, and that becomes more intuitive when you "un-curry" the nested lambdas into a single lamba with twice the number of arguments. The point is that the state of a constant does not depend whatsoever on the state of the (rest of the) world, how much ever of that state piles on.