<div dir="ltr">The typed racket reference shows how to require/typed a struct from an untyped program [1]. I'd like to generalize this example to a struct with a type parameter.<div><br></div><div>Here is the code I would like to write. How can I get this to type check?</div><div><br></div><div><div><font face="monospace">#lang racket/base</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">(module UNTYPED racket/base</font></div><div><font face="monospace">  (struct Tree (elem left right))</font></div><div><font face="monospace">  (provide (struct-out Tree)))</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">(module TYPED typed/racket/base</font></div><div><font face="monospace">  (require/typed 'UNTYPED</font></div><div><font face="monospace">                 [#:struct (A) Tree</font></div><div><font face="monospace">                   ([elem : A]</font></div><div><font face="monospace">                    [left : Tree A]</font></div><div><font face="monospace">                    [right : Tree A])]))</font></div></div><div><br></div><div>[1] <a href="http://docs.racket-lang.org/ts-reference/special-forms.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._require%2Ftyped%29%29">http://docs.racket-lang.org/ts-reference/special-forms.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._require%2Ftyped%29%29</a></div></div>