type _ value =
| Bool : bool -> bool value
| Int : int -> int value
type _ expr =
| Value : 'a value -> 'a expr
| If : bool expr * 'a expr * 'a expr -> 'a expr
| Eq : 'a expr * 'a expr -> bool expr
| Lt : int expr * int expr -> bool expr
我试图创建以下列表:
let a = [Value (Bool true); Value (Int 1);]
这似乎是不可能的,因为它返回以下错误消息:
Error: This expression has type int value
but an expression was expected of type bool value
Type int is not compatible with type bool