aboutsummaryrefslogtreecommitdiff
path: root/data/writer.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2018-11-10 18:43:54 +0100
committerHugo Hörnquist <hugo@hornquist.se>2018-11-10 18:43:54 +0100
commit2754eae6d0c66b2838dc7566904d920ce216dddc (patch)
tree6a15ee7ee897e6b7aed4a5ef412a804516addf77 /data/writer.scm
parentFix problem with do notation being really broken. (diff)
downloadscheme-monad-2754eae6d0c66b2838dc7566904d920ce216dddc.tar.gz
scheme-monad-2754eae6d0c66b2838dc7566904d920ce216dddc.tar.xz
Fixed up examples.
Diffstat (limited to 'data/writer.scm')
-rw-r--r--data/writer.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/data/writer.scm b/data/writer.scm
index b79c670..462d391 100644
--- a/data/writer.scm
+++ b/data/writer.scm
@@ -3,7 +3,7 @@
#:use-module (ice-9 match)
#:use-module (data monoid)
#:use-module (control monad)
- #:export (writer))
+ #:export (writer return-writer))
(read-enable 'curly-infix)
@@ -23,6 +23,9 @@
(($ <writer> nval ncontext)
(writer nval { monoid <> ", " <> ncontext }))))))
+(define (return-writer val)
+ (writer val ""))
+
(define-method (write (this <writer>) port)
(match this (($ <writer> value monoid)
(format port "[Writer ~s, ~s]" value monoid))))