Add types for combinations, in-combinations

This commit is contained in:
Brian Lachance 2016-06-15 09:58:36 -04:00
parent 67614198c3
commit ec0c8516c2
2 changed files with 10 additions and 0 deletions

View File

@ -778,6 +778,12 @@
(-poly (a) ((-lst (-lst a)) . -> . (-lst a)))]
[flatten
(Univ . -> . (-lst Univ))]
[combinations (-poly (a) (cl->*
(-> (-lst a) (-lst (-lst a)))
(-> (-lst a) -Nat (-lst (-lst a)))))]
[in-combinations (-poly (a) (cl->*
(-> (-lst a) (-seq (-lst a)))
(-> (-lst a) -Nat (-seq (-lst a)))))]
[permutations (-poly (a) (-> (-lst a) (-lst (-lst a))))]
[in-permutations (-poly (a) (-> (-lst a) (-seq (-lst a))))]
[argmin (-poly (a) ((a . -> . -Real) (-lst a) . -> . a))]

View File

@ -2403,6 +2403,10 @@
[tc-e (splitf-at-right '("a" b "x" "y") string?)
#:ret (ret (list (-lst (t:Un -String (-val 'b)))
(-lst -String)))]
[tc-e (combinations '(1 2 1)) (-lst (-lst -PosByte))]
[tc-e (combinations '(1 2 1) 2) (-lst (-lst -PosByte))]
[tc-e (in-combinations '(1 2 1)) (-seq (-lst -PosByte))]
[tc-e (in-combinations '(1 2 1) 2) (-seq (-lst -PosByte))]
[tc-e (permutations '(a b c d)) (-lst (-lst (one-of/c 'a 'b 'c 'd)))]
[tc-e (in-permutations '(a b c d)) (-seq (-lst (one-of/c 'a 'b 'c 'd)))]