16 ms·
F# use the same + operator > 1.0;; val it : float = 1.0 > 1;; val it : int = 1 > 3.0 + 1.0;; val it : float = 4.0 > 3 + 1;; val it : int = 4
by enricosada 12y ago
F# use the same + operator
> 1.0;;
val it : float = 1.0
> 1;;
val it : int = 1
> 3.0 + 1.0;;
val it : float = 4.0
> 3 + 1;;
val it : int = 4
or strings
> "3" + "4";;
val it : string = "34"
implicit conversion is not supported (good ihmo)
> 3.0 + 1;;
3.0 + 1;;
------^
stdin(5,7): error FS0001: The type 'int' does not match the type 'float'
- moron4hire 12y agoI'd be fine with that. The OCaml way just seems needlessly preachy.