SMLの問題点
正直知らんかった。
- fun f x y = (x, y); val f = fn : 'a -> 'b -> 'a * 'b - f 1; stdIn:2.1-2.4 Warning: type vars not generalized because of value restriction are instantiated to dummy types (X1,X2,...) val it = fn : ?.X1 -> int * ?.X1 - it 2; stdIn:3.1-3.5 Error: operator and operand don't agree [literal] operator domain: ?.X1 operand: int in expression: it 2
Ocamlはきちんと動くのにねー。
let f x y = (x, y);; let it = f 1;; it 2;;