[racket] TR: can I type-check an in-range at (Sequenceof Byte)?

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Mon Dec 19 18:23:05 EST 2011

On Mon, Dec 19, 2011 at 6:02 PM, John Clements
<clements at brinckerhoff.org> wrote:
> This program
>
> #lang typed/racket
>
> (: seq (Sequenceof Byte))
>
> (define seq (in-range 127))
>
> ...yields this error:
>
> Type Checker: Expected (Sequenceof Byte), but got (Sequenceof Nonnegative-Fixnum) in: (define seq (in-range 127))
>
> I'm wondering if there's a way to get (in-range 127) to type-check at the type (Sequenceof Byte).

The type for `in-range' is too weak.  I'll fix this.
-- 
sam th
samth at ccs.neu.edu


Posted on the users mailing list.