in-random: Add some explicit type annotations.
Used to work without them before Racket 8.9, but hey that's nothing special.
This commit is contained in:
parent
f0a20646ef
commit
91b96463da
1 changed files with 9 additions and 3 deletions
12
utils.rkt
12
utils.rkt
|
@ -561,9 +561,15 @@
|
|||
(-> Integer Integer (Sequenceof Nonnegative-Fixnum))))
|
||||
(define in-random
|
||||
(case-lambda
|
||||
[() (stream-cons (random) (in-random))]
|
||||
[(k) (stream-cons (random k) (in-random k))]
|
||||
[(min max) (stream-cons (random min max) (in-random min max))]))
|
||||
[() (stream-cons
|
||||
(assert-type (random) Flonum)
|
||||
(in-random))]
|
||||
[(k) (stream-cons
|
||||
(assert-type (random k) Nonnegative-Fixnum)
|
||||
(in-random k))]
|
||||
[(min max) (stream-cons
|
||||
(assert-type (random min max) Nonnegative-Fixnum)
|
||||
(in-random min max))]))
|
||||
|
||||
(module+ test
|
||||
(test-case "in-random"
|
||||
|
|
Loading…
Reference in a new issue