summaryrefslogtreecommitdiff
path: root/typed-stream.rkt
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-08-16 15:14:52 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2011-08-16 15:14:52 +0200
commit93515cf43ce16974c7bef1d1d8332e3c8cfe6fac (patch)
tree84af96f2c50a933d94857d1563186c8bd66dadb7 /typed-stream.rkt
parent594c161d6e84581fb89873e216a70bd68a750919 (diff)
Implement the Salsa20 stream cipher.
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)))))