[plt-scheme] Case lambda in typed scheme

From: Anthony Cowley (acowley at seas.upenn.edu)
Date: Wed Mar 18 21:02:06 EDT 2009

On Wed, Mar 18, 2009 at 8:54 PM, Paulo J. Matos <pocmatos at gmail.com> wrote:
> While on an adventure to use typed-scheme I faced this issue:
> #lang typed-scheme
>
> (: foo (case-lambda [-> Symbol]
>                    [Symbol -> Symbol]))
> (define foo
>  (case-lambda [() 'foo]
>               [(s) s]))
>
> I can't see what might be wrong here. Still I get in 4.1.4:
> typecheck: untyped var: s in: s
>
> Cheers,
>
> --
> Paulo Jorge Matos - pocmatos at gmail.com
> Webpage: http://www.personal.soton.ac.uk/pocm

You were very close!

#lang typed-scheme

(: foo (case-lambda [-> Symbol]
                    [Symbol -> Symbol]))
(define foo
 (case-lambda: [() 'foo]
               [((s : Symbol)) s]))



Anthony


Posted on the users mailing list.