Skip to content

Commit f0b2e7c

Browse files
NoahStoryMpavpanchekha
authored andcommitted
Refine hash table's type.
1 parent f3a105f commit f0b2e7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

math-lib/math/private/statistics/counting.rkt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
(: unweighted-samples->hash (All (A) ((Sequenceof A) -> (HashTable A Positive-Integer))))
2121
(define (unweighted-samples->hash xs)
22-
(define: h : (HashTable A Positive-Integer) (make-hash))
22+
(define: h : (Mutable-HashTable A Positive-Integer) (make-hash))
2323
(for: ([x : A xs])
2424
(hash-set! h x (unsafe-fx+ 1 (hash-ref h x (λ () 0)))))
2525
h)
@@ -28,7 +28,7 @@
2828
-> (HashTable A Nonnegative-Real))))
2929
(define (weighted-samples->hash xs ws)
3030
(let-values ([(xs ws) (sequences->weighted-samples 'samples->hash xs ws)])
31-
(define: h : (HashTable A Nonnegative-Real) (make-hash))
31+
(define: h : (Mutable-HashTable A Nonnegative-Real) (make-hash))
3232
(for: ([x : A xs] [w : Nonnegative-Real ws])
3333
(hash-set! h x (+ w (hash-ref h x (λ () 0)))))
3434
h))

0 commit comments

Comments
 (0)