Error: This expression has type env/1490
but an expression was expected of type env/1457
This error occurs quite often when you are debugging your code in interactive toplevel (REPL), and this means that you have declared the type twice env. This can happen if you copy the code in the REPL.
;; . OCaml . , ;; , .
, | , . , , | , .
, value exp env, exp, , . , . ( , , , , , ).
, ( (.. ) ( )), and, .
type env =
| Empty
| Cons of string * exp * env
and exp =
| Num of int
| Str of string
| Err
| Var of string
| Lambda of string * exp
| App of exp * exp
and value =
| Num of int
| Str of string
| Clos of string * exp * env
| Err
, value exp Num of int Str of string, OCaml , Int 1 value exp. , OCaml , Int env exp (, , , ). , .