Add convenience enumerator approximation function

This commit is contained in:
Max New 2014-03-19 12:15:53 -05:00 committed by Robby Findler
parent 190ef41661
commit 6ecb0b765b

View File

@ -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)