summaryrefslogtreecommitdiff
path: root/typed-stream.rkt
diff options
context:
space:
mode:
Diffstat (limited to 'typed-stream.rkt')
-rw-r--r--typed-stream.rkt12
1 files changed, 12 insertions, 0 deletions
diff --git a/typed-stream.rkt b/typed-stream.rkt
new file mode 100644
index 0000000..b674750
--- /dev/null
+++ b/typed-stream.rkt
@@ -0,0 +1,12 @@
+#lang racket
+(require racket/stream)
+
+(provide lazy-functional-stream-append)
+
+(define (lazy-functional-stream-append seq thunk)
+ (let-values ([(next? next) (sequence-generate seq)])
+ (let loop ()
+ (if (next?)
+ (let ([x (next)])
+ (stream-cons x (loop)))
+ (thunk)))))