expr08.ml 325 Bytes
Newer Older
1
open Expr12 (* oexpr *)
2

3
open Hashcons
4

5 6
type hexpr =
  H of hexpr oexpr hash_consed [@@unboxed]
7

POTTIER Francois's avatar
POTTIER Francois committed
8
let table =
9 10
  create 128

POTTIER Francois's avatar
POTTIER Francois committed
11 12
let h (e : hexpr oexpr) : hexpr =
  H (hashcons table e)
13

POTTIER Francois's avatar
POTTIER Francois committed
14
class ['self] hmap = object (self : 'self)
15
  inherit [_] omap
16
  method visit_'expr env (H { node = e; _ }) =
POTTIER Francois's avatar
POTTIER Francois committed
17
    h (self#visit_oexpr env e)
18
end