3 ms·
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 f
by tikhonj 7mo ago
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!)