[racket] Typed Racket and require/typed for polymorphic structs

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Tue Aug 6 17:56:31 EDT 2013

Hi all,

Does anyone know why Typed Racket does not support importing polymorphic
structs using the #:struct keyword in `require/typed`? Is this a
fundamental limitation or just a "small matter of programming"?

i.e., I want to do something like
  (require/typed lang/posn
    [#:struct posn (A) ([x : A] [y: A])])

This seems like it could be supported by the contract system in most
cases (with polymorphic contracts on accessors and constructors). The
case in which it wouldn't work is if you wanted to export a struct
instance with a polymorphic type from the untyped module.

Cheers,
Asumu

Posted on the users mailing list.