I should have read the question better, sorry. 

It might be the hyperliterate #lang that plays badly with typed racket. Try 
annotating the (define ...) inline and see if that works. 
-- 
  Linus Björnstam

On Sat, 8 Aug 2020, at 08:45, greadey wrote:
> It is not wrong, if you type the annotation and definition and run it 
> in a typed/racket repl it works. I can also annotate it as;
> (: foo : Integer -> Integer)
> and that works as well in typed/racket
> 
> On Friday, 7 August 2020 at 18:57:03 UTC+1 Linus Björnstam wrote:
> > Your type annotation is wrong. 
> > 
> > (: foo (-> Integer Integer)) is (iirc, I haven't done typed racket other 
> > than for fun) more like it. 
> > 
> > -- 
> > Linus Björnstam 
> > 
> > On Fri, 7 Aug 2020, at 14:16, greadey wrote: 
> > > 
> > > Hi All, 
> > > 
> > > I've been trying to write typed racket code with hyper-literate. The 
> > > docs seem to suggest I can just add typed racket to the #lang 
> > > hyper-literate; 
> > > 
> > > So my trial code is; 
> > > 
> > > #lang hyper-literate typed/racket 
> > > 
> > > @chunk[<foo> 
> > > 
> > > (: foo : (Integer -> Integer)) 
> > > (define (foo n) 
> > > (* 2 n))] 
> > > 
> > > The repl "runs" this code without any complaint, however when I try; 
> > > 
> > > (foo 2) 
> > > 
> > > I get the following error; 
> > > 
> > > Type Checker: missing type for identifier; 
> > > consider adding a type annotation with `:' 
> > > identifier: foo in: foo. 
> > > 
> > > So would someone mind telling me where I am going wrong. 
> > > 
> > > thanks in advance, 
> > > 
> > > greadey 
> > > 
> > > 
> > > 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> > > Groups "Racket Users" group. 
> > > To unsubscribe from this group and stop receiving emails from it, send 
> > > an email to racket-users...@googlegroups.com. 
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/racket-users/b38730fb-f01d-4c46-8db6-d42394d2860an%40googlegroups.com
> > >  
> > > <https://groups.google.com/d/msgid/racket-users/b38730fb-f01d-4c46-8db6-d42394d2860an%40googlegroups.com?utm_medium=email&utm_source=footer>.
> > >  
> 
> -- 
> You received this message because you are subscribed to the Google 
> Groups "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/eea3b0a3-48f7-4196-9b58-a0dfcc6161c3n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/racket-users/eea3b0a3-48f7-4196-9b58-a0dfcc6161c3n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/c6bd37a5-9f8f-42a0-ac97-c629a5315043%40www.fastmail.com.

Reply via email to