From 632526e4077faaf0e1669db6a588d05cd6d906df Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 15 Dec 2017 09:49:54 +0100 Subject: [PATCH] improve compatibility with the stdlib --- src/core/CCMap.ml | 2 ++ src/core/CCMap.mli | 3 +++ src/core/CCResult.ml | 2 ++ src/core/CCResult.mli | 3 +++ src/core/CCSet.ml | 2 ++ src/core/CCSet.mli | 3 +++ src/core/containers.ml | 31 ++++++++----------------------- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/core/CCMap.ml b/src/core/CCMap.ml index 5c6f3de8..1ac3fd2c 100644 --- a/src/core/CCMap.ml +++ b/src/core/CCMap.ml @@ -6,6 +6,8 @@ type 'a sequence = ('a -> unit) -> unit type 'a printer = Format.formatter -> 'a -> unit +module type OrderedType = Map.OrderedType + module type S = sig include Map.S diff --git a/src/core/CCMap.mli b/src/core/CCMap.mli index 1fa26139..12da1117 100644 --- a/src/core/CCMap.mli +++ b/src/core/CCMap.mli @@ -9,6 +9,9 @@ type 'a sequence = ('a -> unit) -> unit type 'a printer = Format.formatter -> 'a -> unit +module type OrderedType = Map.OrderedType +(** @since NEXT_RELEASE *) + module type S = sig include Map.S diff --git a/src/core/CCResult.ml b/src/core/CCResult.ml index 6c0385e9..271c4823 100644 --- a/src/core/CCResult.ml +++ b/src/core/CCResult.ml @@ -10,6 +10,8 @@ type 'a printer = Format.formatter -> 'a -> unit (** {2 Basics} *) +include Result + type (+'good, +'bad) t = ('good, 'bad) Result.result = | Ok of 'good | Error of 'bad diff --git a/src/core/CCResult.mli b/src/core/CCResult.mli index c0e7b63e..8623ace6 100644 --- a/src/core/CCResult.mli +++ b/src/core/CCResult.mli @@ -14,6 +14,9 @@ type 'a printer = Format.formatter -> 'a -> unit (** {2 Basics} *) +include module type of Result +(** @since NEXT_RELEASE *) + type (+'good, +'bad) t = ('good, 'bad) Result.result = | Ok of 'good | Error of 'bad diff --git a/src/core/CCSet.ml b/src/core/CCSet.ml index 1572c2ff..6430d59b 100644 --- a/src/core/CCSet.ml +++ b/src/core/CCSet.ml @@ -6,6 +6,8 @@ type 'a sequence = ('a -> unit) -> unit type 'a printer = Format.formatter -> 'a -> unit +module type OrderedType = Set.OrderedType + module type S = sig include Set.S diff --git a/src/core/CCSet.mli b/src/core/CCSet.mli index 0af84de8..e525b8d8 100644 --- a/src/core/CCSet.mli +++ b/src/core/CCSet.mli @@ -8,6 +8,9 @@ type 'a sequence = ('a -> unit) -> unit type 'a printer = Format.formatter -> 'a -> unit +module type OrderedType = Set.OrderedType +(** @since NEXT_RELEASE *) + module type S = sig include Set.S diff --git a/src/core/containers.ml b/src/core/containers.ml index 6c3234b5..cb3f4814 100644 --- a/src/core/containers.ml +++ b/src/core/containers.ml @@ -7,21 +7,12 @@ module Array = CCArray module ArrayLabels = CCArrayLabels module Array_slice = CCArray_slice module Bool = CCBool -module Char = struct - include Char - include (CCChar : module type of CCChar with type t := t) -end +module Char = Char module Equal = CCEqual module Float = CCFloat -module Format = struct - include Format - include CCFormat -end +module Format = CCFormat module Fun = CCFun module Hash = CCHash -module Int = CCInt -module Int64 = CCInt64 -module IO = CCIO (** @since 0.14 *) module Hashtbl = struct @@ -35,25 +26,19 @@ module Hashtbl = struct module Make' = CCHashtbl.Make end module Heap = CCHeap +module Int = CCInt +module Int64 = CCInt64 +module IO = CCIO module List = CCList module ListLabels = CCListLabels -module Map = struct - module type OrderedType = Map.OrderedType - include CCMap -end +module Map = CCMap module Option = CCOpt module Ord = CCOrd module Pair = CCPair module Parse = CCParse module Random = CCRandom module Ref = CCRef -module Result = struct - include Result - include CCResult -end -module Set = struct - module type OrderedType = Set.OrderedType - include CCSet -end +module Result = CCResult +module Set = CCSet module String = CCString module Vector = CCVector