[racket-dev] A Const type constructor

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Wed Jul 25 13:26:25 EDT 2012

On Wed, Jul 25, 2012 at 9:29 AM, Neil Toronto <neil.toronto at gmail.com> wrote:
> After thinking about it, I don't want an Immutable-Vector type, for which v
> : Immutable-Vector proves (immutable? v) is #t. That would be seriously
> annoying to users of a vector library.
>
> What if TR had a notion of const-ness, like in C? Suppose (Vectorof A) is a
> subtype of (Const-Vectorof B) when A is a subtype of B, and (Const-Vectorof
> A) is never a subtype of (Vectorof B).

How exactly are these different?  An immutable vector is a vector, but
could be covariant, which seems like what you want. However, a mutable
vector can't be treated as an immutable vector.
-- 
sam th
samth at ccs.neu.edu

Posted on the dev mailing list.