[racket] contracts for sequenceof and streamof ?

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Fri Aug 9 00:20:51 EDT 2013

Hi Christopher,

On 2013-08-08 13:37:00 -0600, Christopher wrote:
>    I can't find contracts for "sequenceof" or "streamof" for
>    non-typed (standard) Racket that would do much the same thing as listof
>    and vectorof.

There is a `sequence/c` in Racket, but it's in the "unstable" library:

Since all streams are sequences too, this contract should work for
both purposes.

>    Is there a trivial way to construct these types of contracts and use them
>    in non-typed Racket?

The Reference details how to construct your own contracts (if you can't
express them with the existing combinators). It's non-trivial though:


Posted on the users mailing list.