News for hackers. Stuff that matters.
Re:Try OCaml by ernst_klim on Sunday September 09, 2018 @07:10PM (#17948288)
And both F# and sml have a problem with that. What type should this function have:

    let add x y = x + y
The proper solution for ad-hoc polymorphism is either dynamic dispatching (aka oop solution) or type-classes or OCaml's modular implicits, not ad-hoc monkey patches like that. And I find (+.) fine since float addition is not an arithmetic addition.
Re:Try OCaml by wyoung2 on Monday September 10, 2018 @10:04AM (#17951854)
> What type should this function have:

If you don't call it, F# simply guesses "int -> int -> int". If you pass a float, you get back a curried function taking float and returning float. Now that the "add" function's type is known, you now can't pass an int: that's now known to be an error.

Seems sensible to me. No problem.