Hi,
Does anyone have a Tuple module that exports arrays as immutable and covariant?
Thanks,
Łukasz
--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports:
On Wed, Mar 14, 2012 at 10:03 PM, Edgar Friendly thelema...@gmail.com wrote:
Batteries has a Cap submodule that provides type-level protection for arrays
so they can be Read-only/Write-only/Read-write. The same idea with a
variance annotation and just read-only access seems to be what you're
Ok, trivial enough a change. You'll have to make a case for the usefulness
of this data structure being in batteries for us to make the change,
otherwise, feel free to use the batteries code as a basis for your Tuple
data structure. LGPL2.1+linking exception should be sufficiently liberal
for
type +'a t = (int - 'a) * int
let get (a: 'a t) i = (fst a) i
let length (a: 'a t) = snd a
let of_array (a: 'a array) : 'a t =
let a' = Array.copy a in
(Array.get a', Array.length a')
should be enough
--
Caml-list mailing list. Subscription management and archives: