This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type term = Var of string | Lam of string * term | App of term * term | |
type value = Closure of ((string * value) list * string * term) | |
let rec eval env term = | |
match term with | |
| Var var -> List.assoc var env | |
| Lam (param, body) -> Closure (env, param, body) | |
| App (lambda, argument) -> ( | |
let lambda = eval env lambda in | |
let argument = eval env argument in |