blob: 8d75d3a634040bb4815e2ba7ffc69e9cb53a3a4b (
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
(.require
[library
[lux (.except)
["$" documentation]
[data
[text (.only \n)
["%" \\format (.only format)]]]]]
[\\library
["[0]" / (.use "[1]#[0]" monoid)]]
["[0]" /
["[1][0]" property]])
(`` (def .public documentation
(List $.Documentation)
(let [zipped (list ($.definition /.zipped
"Create list zippers with the specified number of input lists."
($.example (def zipped_2 (zipped 2)))
($.example (def zipped_3 (zipped 3)))
($.example (zipped_3 xs ys zs))
($.example ((zipped 3) xs ys zs)))
($.definition /.zipped_with
"Create list zippers with the specified number of input lists."
($.example (def zipped_with_2 (zipped_with 2)))
($.example (def zipped_with_3 (zipped_with 3)))
($.example (zipped_with_2 + xs ys))
($.example ((zipped_with 2) + xs ys)))
($.definition /.zipped_2)
($.definition /.zipped_3)
($.definition /.zipped_with_2)
($.definition /.zipped_with_3))]
(/.partial ($.module /._
"")
($.definition /.mix)
($.definition /.equivalence)
($.definition /.hash)
($.definition /.monoid)
($.definition /.functor)
($.definition /.apply)
($.definition /.monad)
($.definition /.first)
($.definition /.after)
($.definition /.while)
($.definition /.until)
($.definition /.every?)
($.definition /.any?)
($.definition /.mixes
""
($.example (mixes f init inputs)))
($.definition /.reversed
""
($.example (reversed xs)))
($.definition /.only
"A list with only values that satisfy the predicate."
($.example (only keep? xs)))
($.definition /.partition
"Divide the list into all elements that satisfy a predicate, and all elements that do not."
($.example (partition satisfies? list)))
($.definition /.pairs
"Cut the list into pairs of 2."
($.example (pairs list)))
($.definition /.split_at
""
($.example (split_at n xs)))
($.definition /.split_when
"Segment the list by using a predicate to tell when to cut."
($.example (split_when predicate xs)))
($.definition /.sub
"Segment the list into sub-lists of (at most) the given size."
($.example (sub size list)))
($.definition /.repeated
"A list of the value x, repeated n times."
($.example (repeated n x)))
($.definition /.iterations
"Generates a list element by element until the function returns .#None."
($.example (iterations f x)))
($.definition /.one
""
($.example (one check xs)))
($.definition /.all
""
($.example (all check xs)))
($.definition /.example
"Yields the first value in the list that satisfies the predicate."
($.example (example predicate xs)))
($.definition /.interposed
"Puts a value between every two elements in the list."
($.example (interposed sep xs)))
($.definition /.size
""
($.example (size list)))
($.definition /.item
"Fetches the element at the specified index."
($.example (item i xs)))
($.definition /.sorted
"A list ordered by a comparison function."
($.example (sorted < xs)))
($.definition /.empty?
""
($.example (empty? xs)))
($.definition /.member?
""
($.example (member? eq xs x)))
(,, (with_template [<name> <doc>]
[($.definition <name>
<doc>)]
[/.head "Yields the first element of a list."]
[/.tail "For a list of size N, yields the N-1 elements after the first one."]
))
($.definition /.indices
"Produces all the valid indices for a given size."
($.example (indices size)))
($.definition /.last
""
($.example (last xs)))
($.definition /.inits
(format "For a list of size N, yields the first N-1 elements."
\n "Will yield a .#None for empty lists.")
($.example (inits xs)))
($.definition /.together
"The sequential combination of all the lists.")
($.definition /.with
"Enhances a monad with List functionality."
($.example (with monad)))
($.definition /.lifted
"Wraps a monadic value with List machinery."
($.example (lifted monad)))
($.definition /.enumeration
"Pairs every element in the list with its index, starting at 0."
($.example (enumeration xs)))
($.definition /.when
"Can be used as a guard in (co)monadic be/do expressions."
($.example (do monad
[value (do_something 1 2 3)
.when (passes_test? value)]
(do_something_else 4 5 6))))
(all /#composite
zipped
/property.documentation
)
))))
|