Make dummy available to MakeFromArray

This commit is contained in:
Fabian 2018-11-07 17:05:57 -06:00
parent 0032d9e666
commit 0b3c19fa65
2 changed files with 10 additions and 0 deletions

View file

@ -18,6 +18,10 @@ module Array = struct
(** The type of an array instance *) (** The type of an array instance *)
type t type t
val dummy : elt
(** A dummy element used for empty slots in the array
@since NEXT_RELEASE *)
val create : int -> t val create : int -> t
(** Make an array of the given size, filled with dummy elements *) (** Make an array of the given size, filled with dummy elements *)
@ -49,6 +53,7 @@ module Array = struct
module Byte : module Byte :
S with type elt = char and type t = Bytes.t = struct S with type elt = char and type t = Bytes.t = struct
type elt = char type elt = char
let dummy = '\x00'
include Bytes include Bytes
end end
@ -56,6 +61,7 @@ module Array = struct
S with type elt = Elt.t and type t = Elt.t array = struct S with type elt = Elt.t and type t = Elt.t array = struct
type elt = Elt.t type elt = Elt.t
type t = Elt.t array type t = Elt.t array
let dummy = Elt.dummy
let create size = Array.make size Elt.dummy let create size = Array.make size Elt.dummy
let length = Array.length let length = Array.length
let get = Array.get let get = Array.get

View file

@ -26,6 +26,10 @@ module Array : sig
(** The type of an array instance *) (** The type of an array instance *)
type t type t
val dummy : elt
(** A dummy element used for empty slots in the array
@since NEXT_RELEASE *)
val create : int -> t val create : int -> t
(** Make an array of the given size, filled with dummy elements. *) (** Make an array of the given size, filled with dummy elements. *)