Add convenience enumerator approximation function
This commit is contained in:
parent
190ef41661
commit
6ecb0b765b
|
@ -38,6 +38,7 @@
|
||||||
|
|
||||||
fail/e
|
fail/e
|
||||||
|
|
||||||
|
approximate
|
||||||
to-list
|
to-list
|
||||||
take/e
|
take/e
|
||||||
fold-enum
|
fold-enum
|
||||||
|
@ -132,6 +133,10 @@
|
||||||
e
|
e
|
||||||
excepts))
|
excepts))
|
||||||
|
|
||||||
|
(define (approximate e n)
|
||||||
|
(for/list ([i (in-range n)])
|
||||||
|
(decode e i)))
|
||||||
|
|
||||||
;; to-list : enum a -> listof a
|
;; to-list : enum a -> listof a
|
||||||
;; better be finite
|
;; better be finite
|
||||||
(define (to-list e)
|
(define (to-list e)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user