[plt-scheme] require/typed and polymorphic signatures

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sun Jul 13 22:58:05 EDT 2008


How about the

  (if (number? x)
      ...
      ...)

issue when x has a Forall(X) type? We should do X - number? in the  
else branch, but this won't work for Robby's polymorphic contracts.

-- Matthias

On Jul 13, 2008, at 9:50 PM, Sam TH wrote:

> On Sun, Jul 13, 2008 at 9:41 PM, Robby Findler  
> <robby at cs.uchicago.edu> wrote:
>> I consider this feasible but, at the moment, the contract library
>> doesn't support it. There are some technical issues that I think I
>> have to compromise on, but I've decided I'm willing to do that...  
>> so I
>> hope to add this before too long. I'm not sure if there are type- 
>> level
>> issues, tho.
>
> There aren't any type level issues, or at least not any that I know
> about.  So using `require/typed' with polymorphic types is just
> waiting for support from the contract library.
>
> Thanks,
> sam th
>
>>
>> Robby
>>
>> On Sun, Jul 13, 2008 at 8:35 PM, John Nowak <john at johnnowak.com>  
>> wrote:
>>> I recently attempted to dive into Typed Scheme. Unfortunately, a  
>>> few things
>>> have stopped me from using it. The major issue is that it seems  
>>> impossible
>>> to import procedures with polymorphic signatures. For example,  
>>> I'd like to
>>> do this:
>>>
>>>  (require/typed
>>>    srfi/1
>>>    (fold (All (a b) ((a b -> b) b (Listof a) -> b))))
>>>
>>> Unfortunately, this fails because Typed Scheme is unable to  
>>> generate an
>>> appropriate contract. Am I correct in thinking that such a  
>>> require statement
>>> is current impossible? If so, might this be remedied in a future  
>>> version?
>>> I'm aware this may not be considered feasible.
>>>
>>> - John
>>> _________________________________________________
>>>  For list-related administrative tasks:
>>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>>
>>>
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>
>
>
>
> -- 
> sam th
> samth at ccs.neu.edu
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.