25 lines
705 B
Racket
25 lines
705 B
Racket
(require srfi/1)
|
|
|
|
(define (c v acc) acc)
|
|
(define (c v acc) (choice-evt never-evt acc))
|
|
(define (c v acc) (choice-evt (handle-evt always-evt void) acc))
|
|
|
|
(define-values (c1 c2) (values values list))
|
|
(define-values (c1 c2) (values (lambda (i) never-evt) choice-evt))
|
|
(define-values (c1 c2) (values (lambda (i) (handle-evt always-evt void)) choice-evt))
|
|
|
|
(for-each (lambda (n)
|
|
(define limit (* 128 (expt 2 n)))
|
|
(write limit)
|
|
(newline)
|
|
(time (do ((i 0 (+ i 1))
|
|
(e never-evt (c i e)))
|
|
((= i limit) e))))
|
|
(iota 16))
|
|
|
|
(for-each (lambda (n)
|
|
(define limit (* 128 (expt 2 n)))
|
|
(write limit)
|
|
(newline)
|
|
(time (apply c2 (map c1 (iota limit)))))
|
|
(iota 16)) |