Re: [racket-users] Typed Racket: Casting to types containing type variables

2020-02-20 Thread unlimitedscolobb
Hi Ben, Thank you for your answer. On Thursday, February 20, 2020 at 3:29:15 AM UTC+1, Ben Greenman wrote: > > On 2/19/20, unlimitedscolobb > wrote: > > > > [] > > > > ;Type Checker: Type a could not be converted to a contract because it > > contains free variables. > > ; in: a > >

Re: [racket-users] Typed Racket: Casting to types containing type variables

2020-02-19 Thread Ben Greenman
On 2/19/20, unlimitedscolobb wrote: > > [] > > ;Type Checker: Type a could not be converted to a contract because it > contains free variables. > ; in: a > > Does this mean that I can never cast to types containing type variables? Yes > My original problem comes from playing around with ev

[racket-users] Typed Racket: Casting to types containing type variables

2020-02-19 Thread unlimitedscolobb
Hello, I'm trying to get something similar to the following code working: #lang typed/racket (: f (-> Integer Any)) (define (f x) (+ 1 x)) (: g (All (a) (-> Integer a))) (define (g x) (f x)) Of course, this gets me a type error: ;Type Checker: type mismatch ; expected: a ; given: Any ;