[plt-scheme] Typed scheme: Cannot apply expression of type Procedure, since it is not a function type

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Thu May 27 16:01:22 EDT 2010

On Thu, May 27, 2010 at 3:53 PM, keydana at gmx.de <keydana at gmx.de> wrote:
> What can I do to really get a function type? If all functions were of the same type, I'd try something like
> (define-struct: Fun ((name : Symbol) (proc : (Any Any -> Any)) (args : (Listof Symbol)) (ret : Symbol)))
> ... but as things are, I have no idea what to do.

Given a value of type `Procedure', how many arguments can you safely
apply it to?  What does it return?

The `Procedure' type includes every procedure, including this one:
(case-lambda) .  Given a value of that type, there's nothing that
Typed Scheme will let you do, since there's nothing you can safely do.

You might want polymorphism here, or variable arity polymorphism, but
I'd have to be sure of what you were trying to do.
sam th
samth at ccs.neu.edu

Posted on the users mailing list.