4 ms·
> just with a heavier syntax. Ok, I'm glad we agree on that. > I can see how writing Eta reduction is one example, but a great deal of code is cleanly expres
by wyager 4y ago
> just with a heavier syntax.
Ok, I'm glad we agree on that.
> I can see how writing
Eta reduction is one example, but a great deal of code is cleanly expressed as e.g.
vecLen = sum . map (^2)
And ocaml's type system is not capable of handling this gracefully. Very unfortunate!
- yawaramin 4y ago? let vec_len vec = vec |> map (fun x -> x ** 2.) |> sum Or even let square x = x ** 2. let vec_len vec = vec |> map square |> sum Honestly, if code like this is the biggest nitpick, I have a hard time taking the argument seriously.