type form = TRUE
|FALSE
|NOT of form
let rec check x = function
TRUE -> true
|FALSE -> false
|NOT(y) -> not eval y
(*where TRUE, FALSE and NOT all custom type 'form'*)
我尝试定义一个函数表单 - > bool,但我得到了
的编译错误 |NOT(y) -> not eval y
线。错误消息显示
This expression type form -> bool, but an expression was expected of type bool
虽然功能' eval'返回类型' bool',它是什么原因,它不能成为返回bool的函数的返回值?