[racket-dev] A proposal for parametric opaque types in Typed Racket

From: Alexis King (lexi.lambda at gmail.com)
Date: Thu Jan 29 22:13:45 EST 2015

Or Any for that matter. I know. The fact that it could be literally anything was sort of the point.

> On Jan 29, 2015, at 19:10, Alexander D. Knauth <alexander at knauth.org> wrote:
> 
> Um, for this:
> (module <http://docs.racket-lang.org/reference/module.html#%28form._%28%28quote._~23~25kernel%29._module%29%29> typed typed/racket/base
>     (provide <http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._provide%29%29> (struct-out <http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._struct-out%29%29> Foo))
>     (struct <http://docs.racket-lang.org/ts-reference/special-forms.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._struct%29%29> [A] Foo ([x : <http://docs.racket-lang.org/ts-reference/special-forms.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._~3a%29%29> A] [y : <http://docs.racket-lang.org/ts-reference/special-forms.html#%28form._%28%28lib._typed-racket%2Fbase-env%2Fprims..rkt%29._~3a%29%29> A]) #:transparent))
> 
> (Foo "a" 'b)
> Should be fine because Foo could be instantiated at the type (U String Symbol).
> 
> On Jan 29, 2015, at 9:25 PM, Alexis King <lexi.lambda at gmail.com <mailto:lexi.lambda at gmail.com>> wrote:
> 
>> 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 my attempt to port 2htdp/image to TR <https://github.com/lexi-lambda/racket-2htdp-typed/issues/1>.
>> 
>> 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:
>> http://lexi-lambda.github.io/racket-parametric-opaque-types/ <http://lexi-lambda.github.io/racket-parametric-opaque-types/>
>> 
>> Any feedback, suggestions, or advice would be appreciated, especially from those who are familiar with Typed Racket’s internals.
>> 
>> Thank you,
>> Alexis
>> _________________________
>>  Racket Developers list:
>>  http://lists.racket-lang.org/dev <http://lists.racket-lang.org/dev>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20150129/c2057139/attachment.html>

Posted on the dev mailing list.