diff options
Diffstat (limited to 'stdlib/source/documentation/lux/control/io.lux')
-rw-r--r-- | stdlib/source/documentation/lux/control/io.lux | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/stdlib/source/documentation/lux/control/io.lux b/stdlib/source/documentation/lux/control/io.lux new file mode 100644 index 000000000..81cf08740 --- /dev/null +++ b/stdlib/source/documentation/lux/control/io.lux @@ -0,0 +1,36 @@ +(.module: + [library + [lux (#- if loop) + ["$" documentation (#+ documentation:)] + [data + [text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.IO + "A type that represents synchronous, effectful computations that may interact with the outside world.") + +(documentation: /.io + (format "Delays the evaluation of an expression, by wrapping it in an IO 'thunk'." + \n "Great for wrapping effectful computations (which will not be performed until the IO is 'run!').") + [(io (exec + (log! msg) + "Some value..."))]) + +(documentation: /.run! + "A way to execute IO computations and perform their side-effects.") + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..IO + ..io + ..run! + ($.default /.functor) + ($.default /.apply) + ($.default /.monad)] + [])) |