Fix types for remove and friends.

A few of these had unnecessary uses of type variables.
The type for `remove*` was unsound.

Please merge to v6.0

original commit: a98e4c5474f83cc146b62baf64c3fa2ee8132fef
This commit is contained in:
Asumu Takikawa 2013-12-09 23:56:11 -05:00
parent a8368048e2
commit 01a7caded8
2 changed files with 14 additions and 6 deletions

View File

@ -563,12 +563,12 @@
((a . -> . Univ) (-lst a) . -> . (-lst a))))]
[shuffle (-poly (a) (-> (-lst a) (-lst a)))]
[remove (-poly (a) (a (-lst a) . -> . (-lst a)))]
[remq (-poly (a) (a (-lst a) . -> . (-lst a)))]
[remv (-poly (a) (a (-lst a) . -> . (-lst a)))]
[remove* (-poly (a b) ((-lst a) (-lst a) [(a b . -> . B)] . ->opt . (-lst b)))]
[remq* (-poly (a) (cl-> [((-lst a) (-lst a)) (-lst a)]))]
[remv* (-poly (a) (cl-> [((-lst a) (-lst a)) (-lst a)]))]
[remove (-poly (a) (Univ (-lst a) . -> . (-lst a)))]
[remq (-poly (a) (Univ (-lst a) . -> . (-lst a)))]
[remv (-poly (a) (Univ (-lst a) . -> . (-lst a)))]
[remove* (-poly (a b) ((-lst a) (-lst b) [(a b . -> . B)] . ->opt . (-lst b)))]
[remq* (-poly (a) (-> (-lst Univ) (-lst a) (-lst a)))]
[remv* (-poly (a) (-> (-lst Univ) (-lst a) (-lst a)))]
#|
[sort (-poly (a b) (cl->* ((-lst a) (a a . -> . B)
#:cache-keys? B #f

View File

@ -1888,6 +1888,14 @@
[tc-e
(string-trim " foo bar baz \r\n\t" " " #:repeat? #t)
-String]
;; remove and friends
[tc-e (remq #f '(1 2 3 4)) (-lst -PosByte)]
[tc-e (remv #f '(1 2 3 4)) (-lst -PosByte)]
[tc-e (remove #f '(1 2 3 4)) (-lst -PosByte)]
[tc-e (remove* '(1 2) '(a b c d)) (-lst (one-of/c 'a 'b 'c 'd))]
[tc-e (remq* '(1 2) '(a b c d)) (-lst (one-of/c 'a 'b 'c 'd))]
[tc-e (remv* '(1 2) '(a b c d)) (-lst (one-of/c 'a 'b 'c 'd))]
)
(test-suite
"tc-literal tests"