我使用Core.Std生成一组,并在.ml
文件中的地图:OCaml的:形容模块.mli文件
type temp = int with sexp, compare
type label = Symbol.symbol with sexp, compare
module Temp = struct
type t = temp with sexp, compare
end
module TempComp = Comparable.Make(Temp)
module TempSet = TempComp.Set
module TempMap = TempComp.Map
module Label = struct
type t = label with sexp, compare
end
module LabelComp = Comparable.Make(Label)
module LabelMap = LabelComp.Map
我应该如何形容TempSet, TempMap, LabelMap
我.mli
文件?
我把: module TempMap : Map.S with type t = temp
但我得到了一个错误:
In this `with' constraint, the new definition of t does not match its original definition in the constrained signature: Type declarations do not match: type t = t is not included in type 'a t = (Key.t, 'a, Key.comparator_witness) Map.t
我怎样才能解决这个问题?