5 ms·
> F# has embraced the OCaml syntax while at the same time cleaning out many of the warts (+., do end etc.). It also now has good tooling available on all platfo
by wtetzner 9y ago
> F# has embraced the OCaml syntax while at the same time cleaning out many of the warts (+., do end etc.). It also now has good tooling available on all platforms.
Unfortunately, it also drops my favorite thing about OCaml, which is the module system.
I also like that there are different operators for ints and floats. It makes it very clear when you've accidentally mixed the two.
- xfer 9y agoYou can't accidentally mix floats and ints, it's a typed language.
- wtetzner 9y agoIt's typed, but the types can be fully inferred. If you didn't specify the types of your function, it could end up being inferred as float -> float -> float instead of int -> int -> int. The different operators are a concise way to tell the type-checker that you're working with floats.
- xfer 9y agoNo it won't be inferred as float->float->float if there is an int literal or whatever base type you pass to the function. Check typeclasses for how this works.