From 2ea5b9289c1798469a181b8725af65d4e909be1a Mon Sep 17 00:00:00 2001 From: "Duncan M. McGreggor" Date: Tue, 19 May 2015 23:08:24 -0500 Subject: [PATCH] Use standard indentation. --- README.rst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.rst b/README.rst index bd5e1bf..a67bdcc 100644 --- a/README.rst +++ b/README.rst @@ -74,25 +74,25 @@ and execution will cease. (include-lib "deps/calrissian/include/monads.lfe") (defun dostuff () - (do-m (monad 'error) - (input <- (fetch-input)) ;; fetch-input -> (tuple 'ok result) | (tuple 'error reason) - (parsed <- (parse-input input)) ;; parse-input -> (tuple 'ok result) | (tuple 'error reason) - (store-data parsed))) ;; store-data -> 'ok | (tuple 'error reason) + (do-m (monad 'error) + (input <- (fetch-input)) ;; fetch-input -> (tuple 'ok result) | (tuple 'error reason) + (parsed <- (parse-input input)) ;; parse-input -> (tuple 'ok result) | (tuple 'error reason) + (store-data parsed))) ;; store-data -> 'ok | (tuple 'error reason) Without the error monad, the code might have looked like this: .. code:: scheme (defun dostuff () - (case (fetch-input) - ((tuple 'error reason) - (tuple 'error reason)) - ((tuple 'ok input) - (case (parse-input input) - ((tuple 'error reason) - (tuple 'error reason)) - ((tuple 'ok parsed) - (store-data parsed)))))) + (case (fetch-input) + ((tuple 'error reason) + (tuple 'error reason)) + ((tuple 'ok input) + (case (parse-input input) + ((tuple 'error reason) + (tuple 'error reason)) + ((tuple 'ok parsed) + (store-data parsed)))))) .. Links .. -----