From dc93a7fc73f78ffcdca9997572919bd3bba42d5b Mon Sep 17 00:00:00 2001 From: David Florness Date: Sun, 10 Nov 2019 10:06:41 -0700 Subject: [PATCH] Wrap the results function in a contract --- server.rkt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.rkt b/server.rkt index 8f7d1c7..b1bff7a 100644 --- a/server.rkt +++ b/server.rkt @@ -60,7 +60,9 @@ 200 #f (current-seconds) #"application/octet-stream" empty (list (integer->bytes n (/ keylen 8) #f)))) -(define (results votes) +(define/contract (results votes) + (-> (listof (listof (integer-in 0 (sub1 (length cands))))) + (listof (integer-in 0 (sub1 (length cands))))) (let res ([votes votes] [firsts (make-immutable-hash (for/list ([i (in-range (length cands))]) -- 2.38.4