【发布时间】:2015-08-28 22:41:24
【问题描述】:
type ide = string;;
type exp = http://pastebin.com/EhD9QdYj;;
let emptyEnv = fun x -> raise EmptyEnvException;;
let emptyFunEnv = fun x -> raise EmptyEnvException;;
let raddoppia = Function("mul2", "x", Mul(Ide "x", Int 2));;
(**)let funenv0 = funDeclr raddoppia emptyEnv emptyFunEnv;;
这段代码,用 ocamlc 编译,返回这个错误:
File "progetto.ml", line (**), characters 14-53:
Error: The type of this expression, ide -> ide * exp * ('_a -> 'b),
contains type variables that cannot be generalized
有什么问题?
【问题讨论】: