[racket] the typed Values restriction

From: Benjamin Greenman (blg59 at cornell.edu)
Date: Wed Mar 18 16:48:13 EDT 2015

Today I got a surprising type error that I think is worth sharing.

(: my-force (All (A) (-> (-> A) A))
(define (my-force x) (x))

(my-force (lambda () (values (void) (void)))
;; ERROR! 'my-force' cannot be applied to argument.
;; expected "(-> A)", got "(-> (values Void Void))"
;; result type "A", expected result "AnyValues"

(inst my-force (Values Void Void))
;; Parse Error in type: "Values" is unbound

That is all. I see now that Values is only allowed in result positions
<http://docs.racket-lang.org/ts-reference/type-ref.html?q=values#%28form._%28%28lib._typed-racket%2Fbase-env%2Fbase-types-extra..rkt%29._.Values%29%29>,
but I'd still expected this to work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150318/bb7a80e1/attachment.html>

Posted on the users mailing list.