Created
August 7, 2019 15:09
-
-
Save gsg/b2c2adc5a9ffc60af5912ad02dc76d35 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 rec Value : sig | |
type t = | |
| Int of int | |
| Tbl of t ValueTbl.t | |
val hash : t -> int | |
val equal : t -> t -> bool | |
end = struct | |
type t = | |
| Int of int | |
| Tbl of t ValueTbl.t | |
let hash = Hashtbl.hash | |
let equal a b = | |
match a, b with | |
| Int x, Int y -> x = y | |
| Tbl x, Tbl y -> x == y | |
| _ -> false | |
end | |
and ValueTbl : Hashtbl.S with type key = Value.t = Hashtbl.Make (Value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment