[plt-scheme] Typed Scheme polymorphic variadic functions

From: Stevie Strickland (sstrickl at ccs.neu.edu)
Date: Tue Mar 17 15:01:37 EDT 2009

On Mar 17, 2009, at 2:31 PM, Anthony Cowley wrote:
> I am now having problems with the union type constructor:
> (U A ... A)
> is this also not currently supported?

No, it also isn't.  In fact, I think Values may be the only one  
supported right now, though I need to check with Sam and make sure he  
hasn't added any extra ones that I don't know about.

> This type almost works, but not quite if I (apply check-all list-of- 
> tests):
> (: check-all (All (A ...) ((List (-> A) A String) ... A -> Void)))

What you want here makes sense, if I'm reading it correctly, but I  
think the problem is that it can't infer the correct types with which  
to instantiate the dotted type variable A.  I'll check and see what  
kind of types apply looks for already -- it's likely that you're  
giving a polymorphic argument (check-all) to a polymorphic function  
(apply) and thus the inference algorithm fails.  That sort of case is  
another area where future work is planned.

Stevie


Posted on the users mailing list.