Commit 91ff7106 by POTTIER Francois

Add an example with hash-consing. Does not work yet.

parent 97888d3c
open Hashcons
module Hash_consed = struct
let table =
create 128
let iter f env hcx =
f env hcx.node
let map f env hcx =
hashcons table (f env hcx.node)
end
type expr =
expr_node hash_consed
and expr_node =
| EConst of int
| EAdd of expr * expr
[@@deriving visitors { name = "iter"; variety = "iter" },
visitors { name = "map" ; variety = "map" }]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment