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

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Thu Apr 2 17:52:58 EDT 2009

On Thu, Apr 2, 2009 at 7:22 PM, Sam TH <samth at ccs.neu.edu> wrote:
> 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)))])
>

Ah of course, in fact, I was trying to use the other form but didn't
notice the module name should come last. Thanks.

> plus I think your type syntax is wrong as well.

Why? It seems to mimic the requirements for the every function
provided by the srfi...

> 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.
>

ok, thanks.

>> 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
>

great, thanks for the reference.

> 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
>



-- 
Paulo Jorge Matos - pocmatos at gmail.com
Webpage: http://www.personal.soton.ac.uk/pocm


Posted on the users mailing list.