mirror of
https://github.com/correl/calrissian.git
synced 2024-11-23 11:09:58 +00:00
Use standard indentation.
This commit is contained in:
parent
9f12d3edf8
commit
2ea5b9289c
1 changed files with 13 additions and 13 deletions
26
README.rst
26
README.rst
|
@ -74,25 +74,25 @@ and execution will cease.
|
||||||
(include-lib "deps/calrissian/include/monads.lfe")
|
(include-lib "deps/calrissian/include/monads.lfe")
|
||||||
|
|
||||||
(defun dostuff ()
|
(defun dostuff ()
|
||||||
(do-m (monad 'error)
|
(do-m (monad 'error)
|
||||||
(input <- (fetch-input)) ;; fetch-input -> (tuple 'ok result) | (tuple 'error reason)
|
(input <- (fetch-input)) ;; fetch-input -> (tuple 'ok result) | (tuple 'error reason)
|
||||||
(parsed <- (parse-input input)) ;; parse-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)
|
(store-data parsed))) ;; store-data -> 'ok | (tuple 'error reason)
|
||||||
|
|
||||||
Without the error monad, the code might have looked like this:
|
Without the error monad, the code might have looked like this:
|
||||||
|
|
||||||
.. code:: scheme
|
.. code:: scheme
|
||||||
|
|
||||||
(defun dostuff ()
|
(defun dostuff ()
|
||||||
(case (fetch-input)
|
(case (fetch-input)
|
||||||
((tuple 'error reason)
|
((tuple 'error reason)
|
||||||
(tuple 'error reason))
|
(tuple 'error reason))
|
||||||
((tuple 'ok input)
|
((tuple 'ok input)
|
||||||
(case (parse-input input)
|
(case (parse-input input)
|
||||||
((tuple 'error reason)
|
((tuple 'error reason)
|
||||||
(tuple 'error reason))
|
(tuple 'error reason))
|
||||||
((tuple 'ok parsed)
|
((tuple 'ok parsed)
|
||||||
(store-data parsed))))))
|
(store-data parsed))))))
|
||||||
|
|
||||||
.. Links
|
.. Links
|
||||||
.. -----
|
.. -----
|
||||||
|
|
Loading…
Reference in a new issue