From: Edgar Friendly <thelema314@gmail.com>
To: Lukasz Stafiniak <lukstafi@gmail.com>
Cc: Caml <caml-list@inria.fr>
Subject: Re: [Caml-list] Tuples (covariant immutable arrays)
Date: Wed, 14 Mar 2012 17:26:31 -0400 [thread overview]
Message-ID: <CAL-jcAmWU=u=cmSrKbmwTEZbD1LkY48u0rexr=2Pd_f+wBRgSA@mail.gmail.com> (raw)
In-Reply-To: <CAJMfKEXbbFrRu1pFY_dWE3iN6F0sb=i-4OViMVRBbOr0v+ka+g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]
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 most uses.
E.
btw, link to the docs I meant to include in my first email:
http://ocaml-batteries-team.github.com/batteries-included/hdoc/BatArray.Cap.html
On Wed, Mar 14, 2012 at 5:12 PM, Lukasz Stafiniak <lukstafi@gmail.com>wrote:
> On Wed, Mar 14, 2012 at 10:03 PM, Edgar Friendly <thelema314@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.
>
[-- Attachment #2: Type: text/html, Size: 1738 bytes --]
next prev parent reply other threads:[~2012-03-14 21:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-14 20:38 Lukasz Stafiniak
2012-03-14 21:03 ` Edgar Friendly
2012-03-14 21:12 ` Lukasz Stafiniak
2012-03-14 21:26 ` Edgar Friendly [this message]
2012-03-14 22:18 ` Alexandre Pilkiewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAL-jcAmWU=u=cmSrKbmwTEZbD1LkY48u0rexr=2Pd_f+wBRgSA@mail.gmail.com' \
--to=thelema314@gmail.com \
--cc=caml-list@inria.fr \
--cc=lukstafi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox