<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>This makes no sense. Parametric polymorphism is a syntactic concept (think for-all quantifier). It's sad enough that we export such things from typed to untyped modules (for pragmatic reasons, in violation of a fundamental GT assumption). -- Matthias</div><div><br></div><div><br></div><div><br></div><div><br></div><br><div><div>On Dec 6, 2014, at 5:00 PM, Benjamin Greenman wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><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>
____________________<br> Racket Users list:<br> <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></blockquote></div><br></body></html>