-
-
Save fogus/fd07e75fa2e224128544 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 VariantMod | |
: sig | |
type t = Int of int | Map of t OrderedValMap.t | |
end = VariantMod | |
and OrderedVal | |
: sig | |
type t = VariantMod.t | |
val compare : t -> t -> int | |
end | |
= struct | |
type t = VariantMod.t | |
let compare = Pervasives.compare | |
end | |
and OrderedValMap | |
: Map.S with type key = OrderedVal.t | |
= Map.Make(OrderedVal) | |
let example_int = VariantMod.Int 42 | |
let example_map_val = OrderedValMap.add example_int example_int OrderedValMap.empty | |
let example_map = VariantMod.Map example_map_val | |
let example_map2 = VariantMod.Map (OrderedValMap.add example_map example_map OrderedValMap.empty) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment