module CCMixmap:sig
..end
status: experimental
module M = CCMixmap.Make(CCInt)
let inj_int = CCMixmap.create_inj()
let inj_str = CCMixmap.create_inj()
let inj_list_int = CCMixmap.create_inj()
let m =
M.empty
|> M.add ~inj:inj_int 1 1
|> M.add ~inj:inj_str 2 "2"
|> M.add ~inj:inj_list_int 3 [3;3;3]
assert (M.get ~inj:inj_int 1 m = Some 1)
assert (M.get ~inj:inj_str 1 m = None)
assert (M.get ~inj:inj_str 2 m = Some "2")
assert (M.get ~inj:inj_int 2 m = None)
assert (M.get ~inj:inj_list_int 3 m = Some [3;3;3])
assert (M.get ~inj:inj_str 3 m = None)
type 'a
injection
val create_inj : unit -> 'a injection
module type S =sig
..end
module type ORD =sig
..end
module Make(
X
:
ORD
)
:S
with type key = X.t