home
/
code
/
tt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
78142ac
)
Add some more type annotations
author
Siraaj Khandkar
<siraaj@khandkar.net>
Mon, 22 Mar 2021 00:25:58 +0000
(20:25 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Mon, 22 Mar 2021 00:25:58 +0000
(20:25 -0400)
tt.rkt
patch
|
blob
|
blame
|
history
diff --git
a/tt.rkt
b/tt.rkt
index
6914d7a
..
0bea719
100644
(file)
--- a/
tt.rkt
+++ b/
tt.rkt
@@
-36,13
+36,15
@@
[uri : Url])
#:type-name Feed)
[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 (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)
(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)))
(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
(define (dispatch ws xs ys)
(if (empty? ws)
ys
This page took
0.038003 seconds
and
4
git commands to generate.