I think something problematic is happening with type inference here,
and better types could be picked. Right now, Typed Racket is doing
this:

   (compose (λ (x) x) (inst (λ #:forall (a) ({x : a}) x) Nothing))

when it should probably do

   (compose (λ (x) x) (inst (λ #:forall (a) ({x : a}) x) Any))

 However, using polymorphic arguments (such as your second function)
to polymorphic functions (such as `compose`) in general won't produce
the results you want, and I recommend writing the instantiation you
want explicitly.

Sam

On Tue, Sep 29, 2015 at 2:33 PM, Matthias Felleisen
<[email protected]> wrote:
>
> Why does this
>
>> (compose (λ (x) x) (λ #:forall (a) ({x : a}) x))
>
> have this type:
>
>> - : (-> Nothing Any)
>
> Thanks -- Matthias
>
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-dev/7E7C582D-7066-4073-AAFD-9B6CA99F1F1E%40ccs.neu.edu.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-dev/CAK%3DHD%2BYTo04uDJ4PiD9aRyxzr%2BEaKERRrZXYH5gaRDQOe6L_EA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to