Added some closure and promotion type signatures.

This commit is contained in:
Vincent St-Amour 2010-06-10 13:58:41 -04:00
parent aae1acf035
commit c9a96c1d2c

View File

@ -62,7 +62,8 @@
[odd? (-> -Integer B)] [odd? (-> -Integer B)]
[even? (-> -Integer B)] [even? (-> -Integer B)]
[modulo (cl->* (-Integer -Integer . -> . -Integer))] [modulo (cl->* (-Nat -Nat . -> . -Nat)
(-Integer -Integer . -> . -Integer))]
[= (->* (list N N) N B)] [= (->* (list N N) N B)]
@ -81,34 +82,28 @@
[* (apply cl->* [* (apply cl->*
(append (for/list ([t (list -Pos -Nat -Integer -ExactRational -Flonum)]) (->* (list) t t)) (append (for/list ([t (list -Pos -Nat -Integer -ExactRational -Flonum)]) (->* (list) t t))
(list (->* (list (Un -Integer -ExactRational -Real -Flonum))
(Un -Integer -ExactRational -Real -Flonum)
-Flonum))
(list (->* (list) -Real -Real)) (list (->* (list) -Real -Real))
(list (->* (list) N N))))] (list (->* (list) N N))))]
[+ (apply cl->* [+ (apply cl->*
(append (for/list ([t (list -Pos -Nat -Integer -ExactRational -Flonum)]) (->* (list) t t)) (append (for/list ([t (list -Pos -Nat -Integer -ExactRational -Flonum)]) (->* (list) t t))
(list (->* (list (Un -Integer -ExactRational -Real -Flonum)) ;; special cases for promotion to inexact, not exhaustive
(Un -Integer -ExactRational -Real -Flonum) ;; valid for + and -, but not for * and /, since (* <float> 0) is exact 0 (i.e. not a float)
-Flonum)) (list (->* (list -Flonum) -Real -Flonum))
(list (->* (list -Real -Flonum) -Real -Flonum))
(list (->* (list) -Real -Real)) (list (->* (list) -Real -Real))
(list (->* (list) N N))))] (list (->* (list) N N))))]
[- (apply cl->* [- (apply cl->*
(append (for/list ([t (list -Integer -ExactRational -Flonum)]) (append (for/list ([t (list -Integer -ExactRational -Flonum)])
(->* (list t) t t)) (->* (list t) t t))
(list (->* (list (Un -Integer -ExactRational -Real -Flonum)) (list (->* (list -Flonum) -Real -Flonum))
(Un -Integer -ExactRational -Real -Flonum) (list (->* (list -Real -Flonum) -Real -Flonum))
-Flonum))
(list (->* (list -Real) -Real -Real)) (list (->* (list -Real) -Real -Real))
(list (->* (list N) N N))))] (list (->* (list N) N N))))]
[/ (apply cl->* [/ (apply cl->*
(append (list (->* (list -Integer) -Integer -ExactRational)) (append (list (->* (list -Integer) -Integer -ExactRational))
(for/list ([t (list -ExactRational -Flonum)]) (for/list ([t (list -ExactRational -Flonum)])
(->* (list t) t t)) (->* (list t) t t))
(list (->* (list (Un -Integer -ExactRational -Real -Flonum))
(Un -Integer -ExactRational -Real -Flonum)
-Flonum))
(list (->* (list -Real) -Real -Real)) (list (->* (list -Real) -Real -Real))
(list (->* (list N) N N))))] (list (->* (list N) N N))))]
@ -169,7 +164,8 @@
[log (cl->* [log (cl->*
(-Pos . -> . -Real) (-Pos . -> . -Real)
(N . -> . N))] (N . -> . N))]
[exp (N . -> . N)] [exp (cl->* (-Real . -> . -Real)
(N . -> . N))]
[cos (cl->* (-Flonum . -> . -Flonum) (-Real . -> . -Real) (N . -> . N))] [cos (cl->* (-Flonum . -> . -Flonum) (-Real . -> . -Real) (N . -> . N))]
[sin (cl->* (-Flonum . -> . -Flonum) (-Real . -> . -Real) (N . -> . N))] [sin (cl->* (-Flonum . -> . -Flonum) (-Real . -> . -Real) (N . -> . N))]
[tan (cl->* (-Flonum . -> . -Flonum) (-Real . -> . -Real) (N . -> . N))] [tan (cl->* (-Flonum . -> . -Flonum) (-Real . -> . -Real) (N . -> . N))]