(* Environments implemented using association lists (from CAML library) *) module Env : Env = struct type 'a env = Env of (string * 'a) list exception Bad_id let empty = Env [] let extend (Env env) v x = Env ((v,x)::env) let lookup (Env env) v = try List.assoc v env with Not_found -> raise Bad_id end