Skip to content

Instantly share code, notes, and snippets.

@jj-issuu
jj-issuu / avl.ml
Created January 14, 2014 07:36
OCaml AVL tree
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
@jj-issuu
jj-issuu / eval.ml
Last active June 14, 2023 21:20
Benchmark interpreters written in OCaml
(*
* 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