[PRL] Type-directed partial evaluation

David Herman dherman at ccs.neu.edu
Thu Jan 8 16:12:05 EST 2004


> Is it not true that, for these examples, you can figure out the body 
> of your code just from the type itself (assuming that those are all 
> type variables in there, and that we're only dealing with total 
> functions here)?
>
> E.G.
>
> ((A -> A) * (B -> C -> B))
>
> A -> A is only populated by id.
> B -> C -> B is only populated by  "\ b . \ c . b"

These are monomorphic functions, meaning that (A -> A) is the type 
signature for some concrete type A. TDPE doesn't work for polymorphic 
functions. There isn't just one instance of the type. Simple example:

     > (residualize (lambda (x) 2) '(integer -> integer))
     (lambda (x0) 2)

This couldn't be reconstructed just from (integer -> integer) by itself.

Dave



More information about the PRL mailing list