diff --git a/sledge/nonstdlib/NS.ml b/sledge/nonstdlib/NS.ml index 6af127af3..078f4afb6 100644 --- a/sledge/nonstdlib/NS.ml +++ b/sledge/nonstdlib/NS.ml @@ -82,6 +82,13 @@ module List = List module Array = struct include Core.Array + let hash_fold_t hash_fold_elt s a = + Hash.Builtin.hash_fold_array_frozen hash_fold_elt s a + + module Import = struct + type 'a array = 'a t [@@deriving compare, equal, hash, sexp] + end + let pp sep pp_elt fs a = List.pp sep pp_elt fs (to_list a) let fold_map_inplace a ~init ~f = @@ -95,6 +102,7 @@ module Array = struct !s end +include Array.Import module IArray = IArray include IArray.Import module Set = Set diff --git a/sledge/nonstdlib/NS.mli b/sledge/nonstdlib/NS.mli index 28c9cbcfa..58af30089 100644 --- a/sledge/nonstdlib/NS.mli +++ b/sledge/nonstdlib/NS.mli @@ -79,12 +79,19 @@ module List = List module Array : sig include module type of Array + type 'a t = 'a Array.t [@@deriving compare, equal, hash, sexp] + + module Import : sig + type 'a array = 'a t [@@deriving compare, equal, hash, sexp] + end + val pp : (unit, unit) fmt -> 'a pp -> 'a array pp val fold_map_inplace : 'a array -> init:'s -> f:('s -> 'a -> 's * 'a) -> 's end +include module type of Array.Import module IArray = IArray include module type of IArray.Import module Set = Set