From 3ac1eff2af0f54e5759090b8b5f953c207e1a190 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 14 Dec 2015 17:46:26 +0100 Subject: [PATCH] add `CCVector.ro_vector` as a convenience alias --- src/core/CCVector.ml | 2 ++ src/core/CCVector.mli | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/core/CCVector.ml b/src/core/CCVector.ml index 2bb0d17a..39f53715 100644 --- a/src/core/CCVector.ml +++ b/src/core/CCVector.ml @@ -44,6 +44,8 @@ type ('a,'mut) t = { type 'a vector = ('a, rw) t +type 'a ro_vector = ('a, ro) t + let freeze v = { size=v.size; vec=v.vec; diff --git a/src/core/CCVector.mli b/src/core/CCVector.mli index d4beb99d..2a9986a8 100644 --- a/src/core/CCVector.mli +++ b/src/core/CCVector.mli @@ -37,6 +37,10 @@ type ('a, 'mut) t type 'a vector = ('a, rw) t (** Type synonym: a ['a vector] is mutable. *) +type 'a ro_vector = ('a, ro) t +(** Alias for immutable vectors. + @since NEXT_RELEASE *) + type 'a sequence = ('a -> unit) -> unit type 'a klist = unit -> [`Nil | `Cons of 'a * 'a klist] type 'a gen = unit -> 'a option