Fix range type after racket/racket#1558.

Closes racket/racket#1560.
This commit is contained in:
Sam Tobin-Hochstadt 2017-01-04 14:22:56 -05:00
parent 3e13359ef3
commit 565f7ec233
2 changed files with 25 additions and 34 deletions

View File

@ -204,40 +204,6 @@
(-BtsRx (Un -String -BtsInput) [N ?N -Bytes] . ->opt . (output -Bytes))
(-Pattern -BtsInput [N ?N -Bytes] . ->opt . (output -Bytes))))]
[range (cl->* (-> -NonPosReal -Null)
(-> -One (-lst* -Zero))
(-> -Byte (-lst -Byte))
(-> -Index (-lst -Index))
(-> -Fixnum (-lst -NonNegFixnum))
(-> -Real (-lst -Nat))
(->opt -PosInt -Byte [-Int] (-lst -PosByte))
(->opt -Nat -Byte [-Int] (-lst -Byte))
(->opt -PosInt -Index [-Int] (-lst -PosIndex))
(->opt -Nat -Index [-Int] (-lst -Index))
(->opt -Nat -NonNegFixnum [-Int] (-lst -NonNegFixnum))
(->opt -PosInt -Fixnum [-Nat] (-lst -PosFixnum))
(->opt -Nat -Fixnum [-Nat] (-lst -NonNegFixnum))
(->opt -Nat -Nat [-Int] (-lst -Nat))
(->opt -PosInt -Int [-Nat] (-lst -PosInt))
(->opt -Nat -Int [-Nat] (-lst -Nat))
;; could add cases that guarantee lists of negatives, etc.
(->opt -Int -Real [-Int] (-lst -Int))
(->opt -Rat -Real [-Rat] (-lst -Rat))
(->opt -Flonum -Real [-Flonum] (-lst -Flonum))
(->opt -SingleFlonum -Real [-SingleFlonum] (-lst -SingleFlonum))
(->opt -InexactReal -Real [-InexactReal] (-lst -InexactReal))
(->opt -Real -Real [-Real] (-lst -Real)))]
[list-update (-poly (a b) ((-lst a) index-type . -> . (-> a b) (-lst (Un a b))))]
[list-set (-poly (a b) ((-lst a) index-type . -> . b (-lst (Un a b))))]
[take (-poly (a) ((-lst a) index-type . -> . (-lst a)))]

View File

@ -48,6 +48,31 @@
(cl->*
(-> (-lst a) -Null (-lst a))
(-> (-lst a) (-lst b) (-lst (Un a b)))))]
;; range
[(make-template-identifier 'range-proc 'racket/list)
(cl->* (-> -NonPosReal -Null)
(-> -One (-lst* -Zero))
(-> -Byte (-lst -Byte))
(-> -Index (-lst -Index))
(-> -Fixnum (-lst -NonNegFixnum))
(-> -Real (-lst -Nat))
(->opt -PosInt -Byte [-Int] (-lst -PosByte))
(->opt -Nat -Byte [-Int] (-lst -Byte))
(->opt -PosInt -Index [-Int] (-lst -PosIndex))
(->opt -Nat -Index [-Int] (-lst -Index))
(->opt -Nat -NonNegFixnum [-Int] (-lst -NonNegFixnum))
(->opt -PosInt -Fixnum [-Nat] (-lst -PosFixnum))
(->opt -Nat -Fixnum [-Nat] (-lst -NonNegFixnum))
(->opt -Nat -Nat [-Int] (-lst -Nat))
(->opt -PosInt -Int [-Nat] (-lst -PosInt))
(->opt -Nat -Int [-Nat] (-lst -Nat))
;; could add cases that guarantee lists of negatives, etc.
(->opt -Int -Real [-Int] (-lst -Int))
(->opt -Rat -Real [-Rat] (-lst -Rat))
(->opt -Flonum -Real [-Flonum] (-lst -Flonum))
(->opt -SingleFlonum -Real [-SingleFlonum] (-lst -SingleFlonum))
(->opt -InexactReal -Real [-InexactReal] (-lst -InexactReal))
(->opt -Real -Real [-Real] (-lst -Real)))]
;; normalise-inputs
[(make-template-identifier 'normalise-inputs 'racket/private/for)
(-poly (a)