<div dir="ltr">This has bothered me too, but I've realized that I was on the wrong track.<div><br></div><div>The string "a" and symbol 'b are not different types. A struct (Foo "a" 'b), or (list "a" 'b), is a homogeneous data structure of type (U String Symbol) just like Alexander said. This really upsets me -- I like the Hindley Milner world where the compiler warns me if I make a list [1, "two"] and forces me to wrap the int and string into a new datatype. But Typed Racket is not HM.</div><div><br></div><div>About the proposal, I'm confused about what the syntax in Section 2.1 should do -- what is a "first class member of Typed Racket's type system"?</div><div>- Should an A only be a base type like String or Symbol</div><div>- Do you mean to infer the type of the first thing put into the struct as the exact type for everything else?<br></div><div>- Would "first class members" prevent me from filling a struct with members of (define-type (Option A) (U 'None (Some A))), where "Some" is a struct with one field?</div><div><br></div><div>I totally agree that "something needs fixing", but I'm not sure what.</div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 29, 2015 at 10:13 PM, Alexis King <span dir="ltr"><<a href="mailto:lexi.lambda@gmail.com" target="_blank">lexi.lambda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Or <font face="Courier">Any</font> for that matter. I know. The fact that it could be literally anything was sort of the point.</div><div><div class="h5"><br><div><blockquote type="cite"><div>On Jan 29, 2015, at 19:10, Alexander D. Knauth <<a href="mailto:alexander@knauth.org" target="_blank">alexander@knauth.org</a>> wrote:</div><br><div><div style="word-wrap:break-word"><div>Um, for this:</div><div><table cellspacing="0" cellpadding="0" style="margin:0px;padding:0px;font-family:'Source Code Pro',monospace;white-space:pre-wrap;font-size:15px;line-height:22px;background-color:rgb(255,255,255)"><tbody style="margin:0px;padding:0px"><tr style="margin:0px;padding:0px;white-space:inherit"><td style="margin:0px;padding:0px;vertical-align:baseline;white-space:inherit"><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">(</span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem"><a href="http://docs.racket-lang.org/reference/module.html#%28form._%28%28quote._~23~25kernel%29._module%29%29" style="margin:0px;padding:0px;text-decoration:none;color:rgb(0,119,170);font-size:1rem" target="_blank">module</a></span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem">typed</span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem">typed/racket/base</span></td></tr><tr style="margin:0px;padding:0px;white-space:inherit"><td style="margin:0px;padding:0px;vertical-align:baseline;white-space:inherit"><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem">  </span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem">  </span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">(</span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._provide%29%29" style="margin:0px;padding:0px;text-decoration:none;color:rgb(0,119,170);font-size:1rem" target="_blank">provide</a></span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">(</span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem"><a href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct-out%29%29" style="margin:0px;padding:0px;text-decoration:none;color:rgb(0,119,170);font-size:1rem" target="_blank">struct-out</a></span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem">Foo</span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">)</span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">)</span></td></tr><tr style="margin:0px;padding:0px;white-space:inherit"><td style="margin:0px;padding:0px;vertical-align:baseline;white-space:inherit"><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem">  </span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem">  </span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">(</span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem"><a href="http://docs.racket-lang.org/ts-reference/special-forms.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._struct%29%29" style="margin:0px;padding:0px;text-decoration:none;color:rgb(0,119,170);font-size:1rem" target="_blank">struct</a></span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">[</span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem">A</span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">]</span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem">Foo</span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">(</span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">[</span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem">x</span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem"><a href="http://docs.racket-lang.org/ts-reference/special-forms.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._~3a%29%29" style="margin:0px;padding:0px;text-decoration:none;color:rgb(0,119,170);font-size:1rem" target="_blank">:</a></span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem">A</span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">]</span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">[</span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem">y</span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem"><a href="http://docs.racket-lang.org/ts-reference/special-forms.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._~3a%29%29" style="margin:0px;padding:0px;text-decoration:none;color:rgb(0,119,170);font-size:1rem" target="_blank">:</a></span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:inherit;font-size:1rem">A</span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">]</span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">)</span><span style="margin:0px;padding:0px;white-space:inherit;font-size:1rem"> </span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">#:transparent</span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">)</span><span style="margin:0px;padding:0px;white-space:inherit;color:rgb(132,60,36);font-size:1rem">)</span></td></tr></tbody></table><div><br></div></div><div><span style="margin:0px;padding:0px;font-family:'Source Code Pro',monospace;white-space:pre-wrap;color:rgb(132,60,36);font-size:15px;line-height:22px;background-color:rgb(255,255,255)">(</span><span style="margin:0px;padding:0px;font-family:'Source Code Pro',monospace;white-space:pre-wrap;font-size:15px;line-height:22px;background-color:rgb(255,255,255)">Foo</span><span style="margin:0px;padding:0px;font-family:'Source Code Pro',monospace;white-space:pre-wrap;font-size:15px;line-height:22px;background-color:rgb(255,255,255)"> </span><span style="margin:0px;padding:0px;font-family:'Source Code Pro',monospace;white-space:pre-wrap;color:rgb(34,139,34);font-size:15px;line-height:22px;background-color:rgb(255,255,255)">"a"</span><span style="margin:0px;padding:0px;font-family:'Source Code Pro',monospace;white-space:pre-wrap;font-size:15px;line-height:22px;background-color:rgb(255,255,255)"> </span><span style="margin:0px;padding:0px;font-family:'Source Code Pro',monospace;white-space:pre-wrap;color:rgb(34,139,34);font-size:15px;line-height:22px;background-color:rgb(255,255,255)">'</span><span style="margin:0px;padding:0px;font-family:'Source Code Pro',monospace;white-space:pre-wrap;color:rgb(34,139,34);font-size:15px;line-height:22px;background-color:rgb(255,255,255)">b</span><span style="margin:0px;padding:0px;font-family:'Source Code Pro',monospace;white-space:pre-wrap;color:rgb(132,60,36);font-size:15px;line-height:22px;background-color:rgb(255,255,255)">)</span></div><div>Should be fine because Foo could be instantiated at the type (U String Symbol).</div><br><div><div>On Jan 29, 2015, at 9:25 PM, Alexis King <<a href="mailto:lexi.lambda@gmail.com" target="_blank">lexi.lambda@gmail.com</a>> wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word">I recently ran into a problem in which opaque types (types imported from untyped code) cannot by parameterized by Typed Racket. I initially encountered this problem in <a href="https://github.com/lexi-lambda/racket-2htdp-typed/issues/1" target="_blank">my attempt to port 2htdp/image to TR</a>.<div><br></div><div>After some further consideration, I’m interested in adding support to make something like this possible, which would certainly have additional benefits beyond this specific use-case. I’ve outlined my proposal here:</div><div><a href="http://lexi-lambda.github.io/racket-parametric-opaque-types/" target="_blank">http://lexi-lambda.github.io/racket-parametric-opaque-types/</a></div><div><br></div><div>Any feedback, suggestions, or advice would be appreciated, especially from those who are familiar with Typed Racket’s internals.</div><div><br></div><div>Thank you,</div><div>Alexis</div></div>_________________________<br>  Racket Developers list:<br>  <a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br></blockquote></div><br></div></div></blockquote></div><br></div></div></div><br>_________________________<br>
  Racket Developers list:<br>
  <a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
<br></blockquote></div><br></div></div>