diff options
author | Eduardo Julian | 2017-01-06 21:22:51 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-01-06 21:22:51 -0400 |
commit | 53f7f432ca593ea007d576d682a27f23310d07a4 (patch) | |
tree | a8159a297f054c58a9b8f66b213d5d11d9113b2a /stdlib/source/lux/control/effect.lux | |
parent | f9eca6ccaebfc916e2ccd347eb9bab7362b8899f (diff) |
- Fixed a lot of errors in the documentation.
Diffstat (limited to 'stdlib/source/lux/control/effect.lux')
-rw-r--r-- | stdlib/source/lux/control/effect.lux | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/stdlib/source/lux/control/effect.lux b/stdlib/source/lux/control/effect.lux index ede2f9d8f..bf98b9391 100644 --- a/stdlib/source/lux/control/effect.lux +++ b/stdlib/source/lux/control/effect.lux @@ -228,11 +228,12 @@ [defs (s;many (common;def *compiler*))]) {#;doc (doc "Define effect handlers by implementing the operations and values of an effect." (handler: _ - (=> EffA [io;IO io;Monad<IO>]) - (def: (opA size sample) - (:: io;Monad<IO> wrap (n.< size (text;size sample)))) + (=> EffA [IO Monad<IO>]) + (def: (opA length sample) + (:: Monad<IO> wrap (n.< length + (size sample)))) - (def: fieldA (:: io;Monad<IO> wrap +10))) + (def: fieldA (:: Monad<IO> wrap +10))) "Since a name for the handler was not specified, 'handler:' will generate the name as Handler<EffA,IO>.")} (do @ @@ -309,12 +310,12 @@ (syntax: #export (doE functor [bindings (s;tuple (s;some s;any))] body) {#;doc (doc "An alternative to the 'do' macro for monads." - (io;run (with-handler Handler<EffABC,IO> - (doE Functor<EffABC> - [a (lift fieldA) - b (lift fieldB) - c (lift fieldC)] - (wrap ($_ n.+ a b c))))))} + (with-handler Handler<EffABC,IO> + (doE Functor<EffABC> + [a (lift fieldA) + b (lift fieldB) + c (lift fieldC)] + (wrap ($_ n.+ a b c)))))} (do @ [g!output (compiler;gensym "")] (wrap (list (` (let [(~ g!functor) (~ functor)] @@ -370,12 +371,12 @@ (syntax: #export (lift [value (s;alt s;symbol s;any)]) {#;doc (doc "A way to (automatically) lift effectful fields and operations from simple effects into the larger space of composite effects." - (io;run (with-handler Handler<EffABC,IO> - (doE Functor<EffABC> - [a (lift fieldA) - b (lift fieldB) - c (lift fieldC)] - (wrap ($_ n.+ a b c))))))} + (with-handler Handler<EffABC,IO> + (doE Functor<EffABC> + [a (lift fieldA) + b (lift fieldB) + c (lift fieldC)] + (wrap ($_ n.+ a b c)))))} (case value (#;Left var) (do @ |