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
module AVL = struct | |
type height = int | |
type int = height | |
module Elt = Int32 | |
type t = Leaf | Node of t * Elt.t * t * height | |
exception Impossible | |
let height = function |
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
(* | |
* opam install bench | |
* ocamlfind ocamlopt -package unix,bench -linkpkg eval.ml && ./a.out | |
*) | |
type binop = Add | Sub | Mul | Div | |
type expr = | |
| Const of int | |
| VarX |