[racket] applying polymorphic functions in TR

From: Bloch Stephen (bloch at adelphi.edu)
Date: Sun Feb 16 09:53:21 EST 2014

OK, I figured out an annotation to get vector-map to work.  Now I'm trying to use time-apply, and I don't understand why it's not type-checking.

> (:print-type time-apply)

(All (b a ...) (case-> ((-> b) Null -> (values (List b) Nonnegative-Integer Nonnegative-Integer Nonnegative-Integer))
        ((a ... a -> b) (List a ... a) -> (values (List b) Nonnegative-Integer Nonnegative-Integer Nonnegative-Integer))))

> (define-type A Integer) ; or whatever

> (define-type B String)

> (ann time-apply ((A A -> B) (List A A) -> (Values (List B) Nonnegative-Integer Nonnegative-Integer Nonnegative-Integer)))

. Type Checker: Expected ((Integer Integer -> String) (List Integer Integer) -> (values (List String) Nonnegative-Integer Nonnegative-Integer Nonnegative-Integer)), but got (All (b a ...) (case-> ((-> b) Null -> (values (List b) Nonnegative-Integer Nonnegative-Integer Nonnegative-Integer)) ((a ... a -> b) (List a ... a) -> (values (List b) Nonnegative-Integer Nonnegative-Integer Nonnegative-Integer)))) in: time-apply

Why doesn't the type I gave it match the second case of time-apply's type?


Stephen Bloch
sbloch at adelphi.edu
GPG  key at http://adelphi.edu/sbloch/sbloch.pubkey.asc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140216/a65226f5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 495 bytes
Desc: This is a digitally signed message part
URL: <http://lists.racket-lang.org/users/archive/attachments/20140216/a65226f5/attachment.sig>

Posted on the users mailing list.