diff options
Diffstat (limited to 'stdlib/source/documentation/lux/control/maybe.lux')
-rw-r--r-- | stdlib/source/documentation/lux/control/maybe.lux | 75 |
1 files changed, 38 insertions, 37 deletions
diff --git a/stdlib/source/documentation/lux/control/maybe.lux b/stdlib/source/documentation/lux/control/maybe.lux index b237e8ec8..0f22bcba5 100644 --- a/stdlib/source/documentation/lux/control/maybe.lux +++ b/stdlib/source/documentation/lux/control/maybe.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except if loop) + [lux (.except) ["$" documentation] [data [text (.only \n) @@ -9,43 +9,44 @@ ["[0]" /]]) (.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition /.monoid) - ($.definition /.functor) - ($.definition /.apply) - ($.definition /.monad) - ($.definition /.equivalence) - ($.definition /.hash) - ($.definition /.with) - ($.definition /.list) + (.List $.Documentation) + (list ($.module /._ + "") - ($.definition /.lifted - "Wraps a monadic value with Maybe machinery." - [(lifted monad)]) + ($.definition /.monoid) + ($.definition /.functor) + ($.definition /.apply) + ($.definition /.monad) + ($.definition /.equivalence) + ($.definition /.hash) + ($.definition /.with) + ($.definition /.list) - ($.definition /.else - (format "Allows you to provide a default value that will be used" - \n "if a (Maybe x) value turns out to be .#None." - \n "Note: the expression for the default value will not be computed if the base computation succeeds.") - [(else +20 {.#Some +10}) - "=>" - +10] - [(else +20 {.#None}) - "=>" - +20]) + ($.definition /.lifted + "Wraps a monadic value with Maybe machinery." + [(lifted monad)]) - ($.definition /.trusted - (format "Assumes that a Maybe value is a .#Some and yields its value." - \n "Raises/throws a runtime error otherwise." - \n "WARNING: Use with caution.") - [(trusted trusted_computation)]) + ($.definition /.else + (format "Allows you to provide a default value that will be used" + \n "if a (Maybe x) value turns out to be .#None." + \n "Note: the expression for the default value will not be computed if the base computation succeeds.") + [(else +20 {.#Some +10}) + "=>" + +10] + [(else +20 {.#None}) + "=>" + +20]) - ($.definition /.when - "Can be used as a guard in (co)monadic be/do expressions." - [(do monad - [value (do_something 1 2 3) - .when (passes_test? value)] - (do_something_else 4 5 6))])] - [])) + ($.definition /.trusted + (format "Assumes that a Maybe value is a .#Some and yields its value." + \n "Raises/throws a runtime error otherwise." + \n "WARNING: Use with caution.") + [(trusted trusted_computation)]) + + ($.definition /.when + "Can be used as a guard in (co)monadic be/do expressions." + [(do monad + [value (do_something 1 2 3) + .when (passes_test? value)] + (do_something_else 4 5 6))]) + )) |