[sledge] Move Vector.pp out of Import.Vector wrapper

Reviewed By: ngorogiannis

Differential Revision: D20482761

fbshipit-source-id: 6a646883b
master
Josh Berdine 5 years ago committed by Facebook GitHub Bot
parent c47881e664
commit a4613f001d

@ -115,13 +115,7 @@ module Option = Option
include Option.Monad_infix
include Option.Monad_syntax
module List = List
module Vector = struct
include Vector
let pp sep pp_elt fs v = List.pp sep pp_elt fs (to_list v)
end
module Vector = Vector
include Vector.Infix
module type OrderedType = sig

@ -108,14 +108,7 @@ module Option = Option
include module type of Option.Monad_infix
include module type of Option.Monad_syntax with type 'a t = 'a option
module List = List
module Vector : sig
include module type of Vector
val pp : (unit, unit) fmt -> 'a pp -> 'a t pp
(** Pretty-print a vector. *)
end
module Vector = Vector
include module type of Vector.Infix
module type OrderedType = sig

@ -7,7 +7,7 @@
(** Vector - Immutable view of an array *)
open Base
open (Base : module type of Base with module List := Base.List)
(** = 'a array but covariant since imperative operations hidden *)
type +'a t
@ -26,6 +26,9 @@ module Infix = struct
type +'a vector = 'a t [@@deriving compare, equal, hash, sexp]
end
let to_list x = Array.to_list (a x)
let to_array = a
let pp sep pp_elt fs v = List.pp sep pp_elt fs (to_list v)
let concat_map x ~f = v (Array.concat_map (a x) ~f:(fun y -> a (f y)))
let map_adjacent ~f dummy xs_v =
@ -123,6 +126,3 @@ let reduce_exn x ~f = Array.reduce_exn (a x) ~f
let unzip x =
let y, z = Array.unzip (a x) in
(v y, v z)
let to_list x = Array.to_list (a x)
let to_array = a

@ -12,6 +12,7 @@
it inconvenient to mutate. *)
open Base
open Import0
type +'a t [@@deriving compare, equal, hash, sexp]
@ -19,6 +20,8 @@ module Infix : sig
type +'a vector = 'a t [@@deriving compare, equal, hash, sexp]
end
val pp : (unit, unit) fmt -> 'a pp -> 'a t pp
(* val binary_search :
* ('a t, 'a, 'key) Base__Binary_searchable_intf.binary_search *)

Loading…
Cancel
Save