[racket-dev] Overly general types for mutable containers

2012-07-07 Thread Neil Toronto
#lang typed/racket (define: x : Index 1) (: bar ((Vectorof Index) - (Vectorof Index))) (define (bar xs) xs) (: foo (All (A) ((Vectorof Index) - (Vectorof Index (define (foo xs) xs) So we have an Index `x' and a couple of identity functions `bar' and `foo' that only differ by the fact

Re: [racket-dev] Overly general types for mutable containers

2012-07-07 Thread Sam Tobin-Hochstadt
On Sun, Jul 8, 2012 at 12:58 AM, Neil Toronto neil.toro...@gmail.com wrote: It runs directly counter to what I expect from immutable containers, which I use most of the time: This is the problem. Immutable containers are very different from mutable ones, and your expectations shouldn't be