[plt-scheme] srfi/1 messes typed-scheme

From: Sam TH (samth at ccs.neu.edu)
Date: Thu Apr 2 14:22:48 EDT 2009

On Thu, Apr 2, 2009 at 2:09 PM, Paulo J. Matos <pocmatos at gmail.com> wrote:
> On Thu, Apr 2, 2009 at 4:31 PM, Sam TH <samth at ccs.neu.edu> wrote:
>> SRFI 1 provides `map', which overrides the `map' provided from
>> `typed-scheme'.  That `map' doesn't have a type associated with it,
>> and you didn't specify one with `require/typed', so you get the error
>> you see.
>>
>> If you want to use a procedure from SRFI 1, or any other untyped
>> library, you need to use `require/typed'.
>>
>
> I see, so I can just require/typed every from srfi/1 and provide a type.
> Now,
> if I do
> (require/typed srfi/1
>               every (All (a) (((a * -> Boolean) (Listof a) * -> Boolean))))
>

Your syntax for `require/typed' is wrong.  You mean:

(require/typed srfi/1
              [every (All (a) (((a * -> Boolean) (Listof a) * -> Boolean)))])

plus I think your type syntax is wrong as well.  Note that the ability
to use `require/typed' with polymorphic types is very new, and may not
work right yet.  I'll be posting something about this soon.

> but even if it worked... problem is that every has to receive a
> procedure with as many arguments as lists... is this possible to
> specify or is it not up to the type to specify this?

See Stevie Strickland's recent paper on this:
http://www.ccs.neu.edu/scheme/pubs/#esop09-sthf

But these types cannot be converted to contracts.  We don't know yet
how to lift that restriction.
-- 
sam th
samth at ccs.neu.edu


Posted on the users mailing list.