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:
Sergiu Ivanov 2023-08-07 15:11:22 +02:00
parent f0a20646ef
commit 91b96463da

View file

@ -561,9 +561,15 @@
(-> Integer Integer (Sequenceof Nonnegative-Fixnum)))) (-> Integer Integer (Sequenceof Nonnegative-Fixnum))))
(define in-random (define in-random
(case-lambda (case-lambda
[() (stream-cons (random) (in-random))] [() (stream-cons
[(k) (stream-cons (random k) (in-random k))] (assert-type (random) Flonum)
[(min max) (stream-cons (random min max) (in-random min max))])) (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 (module+ test
(test-case "in-random" (test-case "in-random"