SuperFola@programming.dev to Programming Languages@programming.devEnglish · 7 months agoType inference was a mistakeborretti.meexternal-linkmessage-square36fedilinkarrow-up168
arrow-up168external-linkType inference was a mistakeborretti.meSuperFola@programming.dev to Programming Languages@programming.devEnglish · 7 months agomessage-square36fedilink
minus-squareKindaABigDyl@programming.devlinkfedilinkarrow-up7·7 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