diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2018-11-10 18:43:54 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2018-11-10 18:43:54 +0100 |
commit | 2754eae6d0c66b2838dc7566904d920ce216dddc (patch) | |
tree | 6a15ee7ee897e6b7aed4a5ef412a804516addf77 /data/writer.scm | |
parent | Fix problem with do notation being really broken. (diff) | |
download | scheme-monad-2754eae6d0c66b2838dc7566904d920ce216dddc.tar.gz scheme-monad-2754eae6d0c66b2838dc7566904d920ce216dddc.tar.xz |
Fixed up examples.
Diffstat (limited to 'data/writer.scm')
-rw-r--r-- | data/writer.scm | 5 |
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)))) |