From a9511f7c90c15ec37a4f5d5ffb3f602f7277b0ec Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Sun, 21 Mar 2021 20:25:58 -0400 Subject: [PATCH] Add some more type annotations --- tt.rkt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tt.rkt b/tt.rkt index 6914d7a..0bea719 100644 --- a/tt.rkt +++ b/tt.rkt @@ -36,13 +36,15 @@ [uri : Url]) #:type-name Feed) +(: concurrent-filter-map (∀ (α β) (-> Natural (-> α β) (Listof α)))) (define (concurrent-filter-map num-workers f xs) ; TODO preserve order of elements OR communicate that reorder is expected ; TODO switch from mailboxes to channels (define (make-worker id f) (define parent (current-thread)) (λ () - (define self (current-thread)) + (define self : Thread (current-thread)) + (: work (∀ (α) (-> α))) (define (work) (thread-send parent (cons 'next self)) (match (thread-receive) @@ -52,6 +54,7 @@ (when y (thread-send parent (cons 'result y))) (work))])) (work))) + (: dispatch (∀ (α β) (-> (Listof Nonnegative-Integer) (Listof α) (Listof β)))) (define (dispatch ws xs ys) (if (empty? ws) ys -- 2.20.1