diff options
Diffstat (limited to 'stdlib/source/documentation/lux/abstract/monad.lux')
-rw-r--r-- | stdlib/source/documentation/lux/abstract/monad.lux | 79 |
1 files changed, 42 insertions, 37 deletions
diff --git a/stdlib/source/documentation/lux/abstract/monad.lux b/stdlib/source/documentation/lux/abstract/monad.lux index 7f35e4b7d..45404fc1b 100644 --- a/stdlib/source/documentation/lux/abstract/monad.lux +++ b/stdlib/source/documentation/lux/abstract/monad.lux @@ -1,47 +1,52 @@ (.require [library - [lux + [lux (.except) ["$" documentation] [data [text (.only \n) - ["%" \\format (.only format)]]]]] + ["%" \\format (.only format)]] + [collection + ["[0]" list]]]]] [\\library ["[0]" /]] ["[0]" / ["[1][0]" free]]) -(.def .public documentation - (.List $.Module) - ($.module /._ - "" - [($.definition (/.Monad it) - (format "A monad is a monoid in the category of endofunctors." - \n "What's the problem?")) - - ($.definition /.do - "Macro for easy concatenation of monadic operations." - [(do monad - [y (f1 x) - z (f2 z)] - (in (f3 z)))]) - - ($.definition /.then - "Apply a function with monadic effects to a monadic value and yield a new monadic value." - [(then monad function)]) - - ($.definition /.all - "Run all the monadic values in the list and produce a list of the base values." - [(all monad)]) - - ($.definition /.each - "Apply a monadic function to all values in a list." - [(each monad function items)]) - - ($.definition /.only - "Filter the values in a list with a monadic function." - [(only monad predicate items)]) - - ($.definition /.mix - "Mix a list with a monadic function." - [(mix monad function initial_value items)])] - [/free.documentation])) +(def .public documentation + (List $.Documentation) + (list.partial ($.module /._ + "") + + ($.definition (/.Monad it) + (format "A monad is a monoid in the category of endofunctors." + \n "What's the problem?")) + + ($.definition /.do + "Macro for easy concatenation of monadic operations." + [(do monad + [y (f1 x) + z (f2 z)] + (in (f3 z)))]) + + ($.definition /.then + "Apply a function with monadic effects to a monadic value and yield a new monadic value." + [(then monad function)]) + + ($.definition /.all + "Run all the monadic values in the list and produce a list of the base values." + [(all monad)]) + + ($.definition /.each + "Apply a monadic function to all values in a list." + [(each monad function items)]) + + ($.definition /.only + "Filter the values in a list with a monadic function." + [(only monad predicate items)]) + + ($.definition /.mix + "Mix a list with a monadic function." + [(mix monad function initial_value items)]) + + /free.documentation + )) |