[racket] typed racket: equivalent to Any for function types?

From: Ismael Figueroa Palet (ifigueroap at gmail.com)
Date: Mon Nov 28 10:35:40 EST 2011

As Any is supertype of all values, what is the equivalent type for function

(Any -> Any) does not work because of the contra-variant requirement of the

(: f ((Any -> Any) -> True))
(define (f g) #t)

(f (lambda (x) x) #t) ;; works
(f (lambda: ([x : Integer]) #f)) ;; does not work

The error is:

Type Checker: Expected (Any -> Any), but got (Integer -> Any) in: (lambda:
((x : Integer)) #f)

If I understand it correctly, the type I'm looking for is (Bottom -> Any),
which satisfies the contra-variant and variant requirements for function
subtyping. However, the Bottom type doesn't seem to exist (at least at the
user-level, because I remember seeing some error messages that mentioned
Top and Bottom).


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111128/6c9d8954/attachment.html>

Posted on the users mailing list.