SuperFola to Programming LanguagesEnglish • 3 months agoType inference was a mistakeborretti.meexternal-linkmessage-square46arrow-up169arrow-down111
arrow-up158arrow-down1external-linkType inference was a mistakeborretti.meSuperFola to Programming LanguagesEnglish • 3 months agomessage-square46
minus-square@KindaABigDyllink7•3 months ago In Rust and Haskell you have to at least annotate the parameter types and return type of functions. In OCaml type inference is a lot more powerful: you don’t have to annotate function signatures Actually, Haskell and OCaml have this in common. Only Rust requires parameter types of the three. I could do add2 a b = a + b main = do putStrLn $ "5 + 3 = " ++ (show $ add2 5 3) And that would work
Actually, Haskell and OCaml have this in common. Only Rust requires parameter types of the three.
I could do
And that would work