Skip to content

Commit 4cd781c

Browse files
committed
simplify abs type
1 parent d6e2669 commit 4cd781c

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

typed-racket-lib/typed-racket/base-env/base-env-numeric.rkt

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -664,22 +664,10 @@
664664
(define abs-cases ; used both for abs and magnitude
665665
(list
666666
;; abs is not the identity on negative zeros.
667-
((Un -Zero -PosReal) . -> . (Un -Zero -PosReal) : -true-propset : (-arg-path 0))
668-
;; but we know that we at least get *some* zero, and that it preserves exactness
669-
(map unop (list -FlonumZero -SingleFlonumZero -RealZero))
670-
;; abs may not be closed on fixnums. (abs min-fixnum) is not a fixnum
671-
((Un -PosInt -NegInt) . -> . -PosInt)
672-
(-Int . -> . -Nat)
673-
((Un -PosRat -NegRat) . -> . -PosRat)
674-
(-Rat . -> . -NonNegRat)
675-
((Un -PosFlonum -NegFlonum) . -> . -PosFlonum)
676-
(-Flonum . -> . -NonNegFlonum)
677-
((Un -PosSingleFlonum -NegSingleFlonum) . -> . -PosSingleFlonum)
678-
(-SingleFlonum . -> . -NonNegSingleFlonum)
679-
((Un -PosInexactReal -NegInexactReal) . -> . -PosInexactReal)
680-
(-InexactReal . -> . -NonNegInexactReal)
681-
((Un -PosReal -NegReal) . -> . -PosReal)
682-
(-Real . -> . -NonNegReal)))
667+
(-> (Un -Zero -PosReal) (Un -Zero -PosReal) : -true-propset : (-arg-path 0))
668+
(map unop (list -RealZero -Int -Rat -Flonum -SingleFlonum))
669+
(-> (Un -PosReal -NegReal) -PosReal)
670+
(-> -Real -NonNegReal)))
683671

684672
;Check to ensure we fail fast if the flonum bindings change
685673
(define-namespace-anchor anchor)

0 commit comments

Comments
 (0)