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 > looking for, no?
It seems no, because Cap is invariant, and for a reason: for example, Hashtbl.Cap.of_table says "This operation involves no copying. In other words, in let cap = of_table a in ..., any modification in a will also have effect on cap and reciprocally." What I'm thinking about is type +'a Tuple.t with Tuple.of_list and Tuple.of_array both performing a copy. -- 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: http://caml.inria.fr/bin/caml-bugs