From f96c5bdea17855ac85059e414afc127a84bf6264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 10 Nov 2018 18:55:10 +0100 Subject: Add README. --- README.md | 10 ++++++++++ examples.scm | 9 +++------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..58c8f80 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +Scheme Monads +============= + +These are a proof of concept of Haskell style monads in scheme. +They currently support both bind (`>>=`) and `do` notation. + +TODO +---- +- A propper way to call `return`. Probably by allowing bind to act as a macro + and introduce a return procedure of the appropriate type. \ No newline at end of file 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) -- cgit v1.2.3