[plt-scheme] Re: Re: Typed Scheme: Is there any easy way around this?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Jun 1 10:42:26 EDT 2007

We have chosen the traditional notation intentionally. Your proposal  
doesn't reduce the number of parentheses nor the number of chars I  
have to type, right?

And before we get more email on this: keep in mind that I have worked  
with two people who did Hindley-Milner inference for types in Scheme,  
with two people who did SBA inference for Scheme, and now it's  
explicitly, statically typed. Period. Until further notice.

  -- Matthias

On Jun 1, 2007, at 10:38 AM, Anton van Straaten wrote:

> Matthias Felleisen wrote:
>> On Jun 1, 2007, at 1:37 AM, Matthew Swank wrote:
> ...
>>> Well, I don't use contracts.  My basis for a claim of verbosity  
>>> is my
>>> (somewhat limited) experience of Haskell and straight lisp.
>>> Compared to those, Typed Scheme is verbose.
>> That's something we can't fix so don't report it "-)
> There might be room for improvement, though.  Maybe Typed Scheme  
> can already do the following, I've only read some docs so far.
> The approach in which types can be annotated inline, like [n :  
> number], is used in the MLs too.  My experience is that such  
> annotations make ML code more difficult to read and follow.   
> Ironically, that's partly because it starts requiring a lot of  
> parentheses, which break the flow of argument lists.  If I find  
> myself needing lots of annotations for some reason, I prefer to use  
> a module signature to separate the annotations from the code.   
> Alternatively, the Haskell approach of prepending the type  
> signature to the function is a good one.
> Having the option to do something like this could help mitigate the  
> verbosity.  (Of course, I'm speculating having only read Typed  
> Scheme code so far, not written it.)
> So e.g. instead of:
>   (define: (find [v : number] [l : (Listof number)]) : (Maybe number)
> ...you might use something more like:
> (define/type ((number * (Listof number)) -> (Maybe number))    ;[*]
>   (find v l)
>     ...)
> If it's already possible to do something like this, I await the  
> cluestick eagerly.
> Anton
> [*] using fantasy dot-free infix type notation

Posted on the users mailing list.