[racket] Typed Racket: problem with interaction between typed/untyped modules

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Fri Dec 2 18:59:50 EST 2011

On Fri, Dec 2, 2011 at 6:57 PM, Ismael Figueroa Palet
<ifigueroap at gmail.com> wrote:
> 2011/12/2 Sam Tobin-Hochstadt <samth at ccs.neu.edu>
>> On Fri, Dec 2, 2011 at 6:26 PM, Ismael Figueroa Palet
>> <ifigueroap at gmail.com> wrote:
>> > What I'm trying to do, so you get the full picture, is to write a
>> > variation
>> > of Aspect Scheme in Typed Racket, so you can statically check that
>> > advice is
>> > well-typed. I couldn't type correctly the weaver function, so I tried
>> > with
>> > an untyped module. Maybe it is not possible at all??
>> That sounds neat.  However, I'm suspicious that you won't be able to
>> type check everything that people currently write in Aspect Scheme
>> without changing some part of Typed Racket to understand your system
>> better.
> It seems so... the biggest problem for now is that either I can't construct
> the woven function with the same type as the original one, or I can't apply
> it :-p (the problem at the origin of the thread)
> I think the weaver should have type (All (A B) ((A -> B) jp aspect-env -> (A
> -> B))) and that's what I've been trying to do, unsuccesfully.
> Any ideas for a reduced version that might work?

I think the operations that you do on the function, represented in the
`aspect-env', need to be parameterized by A and B as well.  That is,
you can't have a single type for the advice if you have multiple
possible function types.

> I was thinking of using a union type with a certain subset of types, and
> then manually check one-by-one to produce the expected result.

That might work as well.
sam th
samth at ccs.neu.edu

Posted on the users mailing list.