blob: 07318bce970e95fdf7eb3b0bf7024801a56dae49 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
(.module:
[library
[lux
["$" documentation (#+ documentation:)]
[data
[text (#+ \n)
["%" format (#+ format)]]]]]
[\\library
["." /]]
["." / #_
["#." free]])
(documentation: /.Monad
(format "A monad is a monoid in the category of endofunctors."
\n "What's the problem?"))
(documentation: /.do
"Macro for easy concatenation of monadic operations."
[(do monad
[y (f1 x)
z (f2 z)]
(in (f3 z)))])
(documentation: /.then
"Apply a function with monadic effects to a monadic value and yield a new monadic value."
[(then monad function)])
(documentation: /.all
"Run all the monadic values in the list and produce a list of the base values."
[(all monad)])
(documentation: /.map
"Apply a monadic function to all values in a list."
[(map monad function items)])
(documentation: /.only
"Filter the values in a list with a monadic function."
[(only monad predicate items)])
(documentation: /.fold
"Fold a list with a monadic function."
[(fold monad function initial_value items)])
(.def: .public documentation
(.List $.Module)
($.module /._
""
[..Monad
..do
..then
..all
..map
..only
..fold]
[/free.documentation]))
|