Use standard indentation.

This commit is contained in:
Duncan M. McGreggor 2015-05-19 23:08:24 -05:00
parent 9f12d3edf8
commit 2ea5b9289c

View file

@ -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
.. -----