aboutsummaryrefslogtreecommitdiff
path: root/examples.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2018-11-10 18:55:10 +0100
committerHugo Hörnquist <hugo@hornquist.se>2018-11-10 18:55:10 +0100
commitf96c5bdea17855ac85059e414afc127a84bf6264 (patch)
tree0ce2bb8be942ae8af1daf0e85fb005c0b4fd0051 /examples.scm
parentFixed up examples. (diff)
downloadscheme-monad-f96c5bdea17855ac85059e414afc127a84bf6264.tar.gz
scheme-monad-f96c5bdea17855ac85059e414afc127a84bf6264.tar.xz
Add README.
Diffstat (limited to 'examples.scm')
-rw-r--r--examples.scm9
1 files changed, 3 insertions, 6 deletions
diff --git a/examples.scm b/examples.scm
index 3b67f60..1fd453c 100644
--- a/examples.scm
+++ b/examples.scm
@@ -1,8 +1,3 @@
-;; (read-enable 'curly-infix)
-
-;;; Examples:
-;;; These are do in the conext of the optional monad.
-
(add-to-load-path (dirname (current-filename)))
(use-modules (control monad)
@@ -10,6 +5,8 @@
(data optional)
(data writer))
+;;; Optional Monad, and do notation
+
(do x <- (just 10)
x) ; => 10
@@ -24,7 +21,7 @@
y <- (just 20)
(+ x y)) ; => 30
-;;;
+;;; Writer Monad, and do notation
;; Int -> Writer Int String
(define (log-number n)