[plt-scheme] for comprehensions in typed-scheme

From: Sam TH (samth at ccs.neu.edu)
Date: Mon Jun 8 10:53:21 EDT 2009

On Mon, Jun 8, 2009 at 10:44 AM, Eli Barzilay<eli at barzilay.org> wrote:
> 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'?

Yes, it is.  Can you suggest a different message?  Especially one that
works when `max' is an arbitrary expression, and not an identifier?

-- 
sam th
samth at ccs.neu.edu


Posted on the users mailing list.