[plt-scheme] for comprehensions in typed-scheme

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Jun 8 10:44:52 EDT 2009

On Jun  8, Matthias Felleisen wrote:
> 
> Noel, Sam is trying to imitate ML's bad type error messages and I am  
> afraid he's succeeding all too well. Sorry.
> 
> In your case, you need to read the error message as
> 
>   max consumes at least one number and a possible empty sequence of  
> additional numbers.

I think that this error message

  typecheck: Bad arguments to function in apply:
  Domain: Number Number *
  Arguments: (Listof Number) *

*is* confusing, probably because it's talking about `apply', but the
problem is the type it (`apply') expects when used with `max'.  Isn't
that domain the one for `max'?

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.