on master help sign in
Add docs to library docs 1a-2a
commita76a42463032c9c6c7ee6f65d0050f36b40fd99a authorAlec Brickner <alec@primer.ai> dateTue 30 Mar 2021, 22:43 (6 years ago) parent8dce7a7
4 files changed+110−110
hoon/reference/stdlib/1a.md+34−34 hoon/reference/stdlib/1b.md+14−14 hoon/reference/stdlib/1c.md+12−12 hoon/reference/stdlib/2a.md+50−50
hoon/reference/stdlib/1a.md+34−34
@@ -12,13 +12,13 @@ Produces the sum of `a` and `b`.
1212
1313#### Accepts
1414
15−`a` is an atom.
15+`a` is an [`atom`](@/docs/glossary/atom.md).
1616
17−`b` is an atom.
17+`b` is an [`atom`](@/docs/glossary/atom.md).
1818
1919#### Produces
2020
21−An atom.
21+An [`atom`](@/docs/glossary/atom.md).
2222
2323#### Source
2424
@@ -65,11 +65,11 @@ Decrements `a` by `1`.
6565
6666#### Accepts
6767
68−`a` is an atom.
68+`a` is an [`atom`](@/docs/glossary/atom.md).
6969
7070#### Produces
7171
72−An atom.
72+An [`atom`](@/docs/glossary/atom.md).
7373
7474#### Source
7575
@@ -116,13 +116,13 @@ Computes `a` divided by `b` without remainder.
116116
117117#### Accepts
118118
119−`a` is an atom.
119+`a` is an [`atom`](@/docs/glossary/atom.md).
120120
121−`b` is an atom.
121+`b` is an [`atom`](@/docs/glossary/atom.md).
122122
123123#### Produces
124124
125−An atom.
125+An [`atom`](@/docs/glossary/atom.md).
126126
127127#### Source
128128
@@ -171,13 +171,13 @@ Computes `a` divided by `b`, producing the quotient and the remainder.
171171
172172#### Accepts
173173
174−`a` is an atom.
174+`a` is an [`atom`](@/docs/glossary/atom.md).
175175
176−`b` is an atom.
176+`b` is an [`atom`](@/docs/glossary/atom.md).
177177
178178#### Produces
179179
180−A cell of atoms.
180+A cell of [`atoms`](@/docs/glossary/atom.md).
181181
182182#### Source
183183
@@ -221,9 +221,9 @@ Tests whether `a` is greater than or equal to `b`.
221221
222222#### Accepts
223223
224−`a` is an atom.
224+`a` is an [`atom`](@/docs/glossary/atom.md).
225225
226−`b` is an atom.
226+`b` is an [`atom`](@/docs/glossary/atom.md).
227227
228228#### Produces
229229
@@ -261,9 +261,9 @@ Tests whether `a` is greater than `b`.
261261
262262#### Accepts
263263
264−`a` is an atom.
264+`a` is an [`atom`](@/docs/glossary/atom.md).
265265
266−`b` is an atom.
266+`b` is an [`atom`](@/docs/glossary/atom.md).
267267
268268#### Produces
269269
@@ -302,9 +302,9 @@ Tests whether `a` is less than or equal to `b`.
302302
303303#### Accepts
304304
305−`a` is an atom.
305+`a` is an [`atom`](@/docs/glossary/atom.md).
306306
307−`b` is an atom.
307+`b` is an [`atom`](@/docs/glossary/atom.md).
308308
309309#### Produces
310310
@@ -359,9 +359,9 @@ Tests whether `a` is less than `b`.
359359
360360#### Accepts
361361
362−`a` is an atom.
362+`a` is an [`atom`](@/docs/glossary/atom.md).
363363
364−`b` is an atom.
364+`b` is an [`atom`](@/docs/glossary/atom.md).
365365
366366#### Produces
367367
@@ -417,13 +417,13 @@ Computes the greater of `a` and `b`.
417417
418418#### Accepts
419419
420−`a` is an atom.
420+`a` is an [`atom`](@/docs/glossary/atom.md).
421421
422−`b` is an atom.
422+`b` is an [`atom`](@/docs/glossary/atom.md).
423423
424424#### Produces
425425
426−An atom.
426+An [`atom`](@/docs/glossary/atom.md).
427427
428428#### Source
429429
@@ -473,13 +473,13 @@ Computes the lesser of `a` and `b`.
473473
474474#### Accepts
475475
476−`a` is an atom.
476+`a` is an [`atom`](@/docs/glossary/atom.md).
477477
478−`b` is an atom.
478+`b` is an [`atom`](@/docs/glossary/atom.md).
479479
480480#### Produces
481481
482−An atom.
482+An [`atom`](@/docs/glossary/atom.md).
483483
484484#### Source
485485
@@ -527,13 +527,13 @@ Computes the remainder of dividing `a` by `b`.
527527
528528#### Accepts
529529
530−`a` is an atom.
530+`a` is an [`atom`](@/docs/glossary/atom.md).
531531
532−`b` is an atom.
532+`b` is an [`atom`](@/docs/glossary/atom.md).
533533
534534#### Produces
535535
536−An atom.
536+An [`atom`](@/docs/glossary/atom.md).
537537
538538#### Source
539539
@@ -578,13 +578,13 @@ Multiplies `a` by `b`.
578578
579579#### Accepts
580580
581−`a` is an atom.
581+`a` is an [`atom`](@/docs/glossary/atom.md).
582582
583−`b` is an atom.
583+`b` is an [`atom`](@/docs/glossary/atom.md).
584584
585585#### Produces
586586
587−An atom.
587+An [`atom`](@/docs/glossary/atom.md).
588588
589589#### Source
590590
@@ -629,13 +629,13 @@ Subtracts `b` from `a`.
629629
630630#### Accepts
631631
632−`a` is an atom.
632+`a` is an [`atom`](@/docs/glossary/atom.md).
633633
634−`b` is an atom.
634+`b` is an [`atom`](@/docs/glossary/atom.md).
635635
636636#### Produces
637637
638−An atom.
638+An [`atom`](@/docs/glossary/atom.md).
639639
640640#### Source
641641
hoon/reference/stdlib/1b.md+14−14
@@ -11,18 +11,18 @@ information on the tree-addressing system.
1111
1212Tree head
1313
14−Tests whether the tree address `a` is in the head or the tail of a noun.
15−Produces the constant atom `%2` if it is within the head (subtree `+2`), or
16−the constant atom `%3` if it is within the tail (subtree `+3`).
14+Tests whether the tree address `a` is in the head or the tail of a [`noun`](@/docs/glossary/noun.md).
15+Produces the constant [`atom`](@/docs/glossary/atom.md) `%2` if it is within the head (subtree `+2`), or
16+the constant [`atom`](@/docs/glossary/atom.md) `%3` if it is within the tail (subtree `+3`).
1717
1818
1919#### Accepts
2020
21−`a` is an atom.
21+`a` is an [`atom`](@/docs/glossary/atom.md).
2222
2323#### Produces
2424
25−A constant atom.
25+A constant [`atom`](@/docs/glossary/atom.md).
2626
2727#### Source
2828
@@ -70,16 +70,16 @@ A constant atom.
7070
7171Address within head/tail
7272
73−Computes the tree address of atom `a` within either the head (`+2`) or tail
74−(`+3`) of a noun.
73+Computes the tree address of [`atom`](@/docs/glossary/atom.md) `a` within either the head (`+2`) or tail
74+(`+3`) of a [`noun`](@/docs/glossary/noun.md).
7575
7676#### Accepts
7777
78−`a` is an atom.
78+`a` is an [`atom`](@/docs/glossary/atom.md).
7979
8080#### Produces
8181
82−An atom.
82+An [`atom`](@/docs/glossary/atom.md).
8383
8484#### Source
8585
@@ -144,7 +144,7 @@ An atom.
144144 (continues...)
145145```
146146
147−Running `(mas 7)` in the Dojo will return `3`, because address `+3` is what
147+Running `(mas 7)` in the [`Dojo`](@/docs/glossary/dojo.md) will return `3`, because address `+3` is what
148148`+7` now occupies. The tree below helps illustrate the relationship. With
149149parentheses are `a` values (if `a` is in subtree `+3`), and without parentheses
150150are the values returned with `(mas a)`.
@@ -175,13 +175,13 @@ Computes the absolute address of `b`, a relative address within the subtree
175175
176176#### Accepts
177177
178−`a` is an atom.
178+`a` is an [`atom`](@/docs/glossary/atom.md).
179179
180−`b` is an atom.
180+`b` is an [`atom`](@/docs/glossary/atom.md).
181181
182182#### Produces
183183
184−An atom.
184+An [`atom`](@/docs/glossary/atom.md).
185185
186186#### Source
187187
@@ -232,7 +232,7 @@ right (starting with root `+1`, head `+2`, and tail `+3`). Relative address
232232`b` is found with respect to `a`, and then its absolute address, within the
233233greater tree, is returned.
234234
235−Running `(peg 3 4)` in the Dojo, for example, will return `12`. Looking at
235+Running `(peg 3 4)` in the [`Dojo`](@/docs/glossary/dojo.md), for example, will return `12`. Looking at
236236a tree diagram makes it easy to see why.
237237
238238```
hoon/reference/stdlib/1c.md+12−12
@@ -8,7 +8,7 @@ template = "doc.html"
88
99Blocksize
1010
11−Atom representing block size. A block of size `a` has a bitwidth of `2^a`.
11+[`Atom`](@/docs/glossary/atom.md) representing block size. A block of size `a` has a bitwidth of `2^a`.
1212
1313#### Source
1414
@@ -97,7 +97,7 @@ A mold generator. Produces a discriminated fork between two types, defaulting to
9797
9898Function
9999
100−A core with one arm, `$`--the empty name--which transforms a sample noun into a
100+A [`core`](@/docs/glossary/core.md) with one arm, `$`--the empty name--which transforms a sample noun into a
101101product noun. If used dryly as a type, the subject must have a sample type of
102102`*`.
103103
@@ -130,7 +130,7 @@ A `gate` is analogous to a function in other programming languages. We created
130130this new jargon because other constructs in Urbit are "functions" in the
131131mathematical sense. Any `gate` normalizes to an iron `gate`.
132132
133−See also: [`++lift`](../2a), [`++cork`](../2n)
133+See also: [`++lift`](@/docs/hoon/reference/stdlib/2a.md#lift), [`++cork`](@/docs/hoon/reference/stdlib/2n.md#cork)
134134
135135---
136136### `++list`
@@ -166,7 +166,7 @@ homogenous type.
166166```
167167#### Discussion
168168
169−See also: [`++turn`](../2b), [`++snag`](../2b)
169+See also: [`++turn`](@/docs/hoon/reference/stdlib/2b.md#turn), [`++snag`](@/docs/hoon/reference/stdlib/2b.md#snag)
170170
171171---
172172### `++lone`
@@ -229,9 +229,9 @@ A mold generator. Produces a tuple of two of the types passed in.
229229---
230230### `++pole`
231231
232−Faceless list
232+Faceless [`list`](@/docs/hoon/reference/stdlib/1c.md#list)
233233
234−A mold generator. A `list` without the faces `i` and `t`.
234+A mold generator. A [`list`](@/docs/hoon/reference/stdlib/1c.md#list) without the faces `i` and `t`.
235235
236236#### Source
237237
@@ -280,9 +280,9 @@ A mold generator. Produces a tuple of four of the types passed in.
280280---
281281### `++quip`
282282
283−Mold of pair of `list` and type
283+Mold of pair of [`list`](@/docs/hoon/reference/stdlib/1c.md#list) and type
284284
285−A mold generator. Produces a tuple of a `list` of `a` and the mold of `b`.
285+A mold generator. Produces a tuple of a [`list`](@/docs/hoon/reference/stdlib/1c.md#list) of `a` and the mold of `b`.
286286
287287#### Source
288288
@@ -309,9 +309,9 @@ new state. You'll often see `quip` used in Gall apps.
309309---
310310### `++trap`
311311
312−Core with one arm `$`
312+[`Core`](@/docs/glossary/core.md) with one arm `$`
313313
314−A trap is a core with one arm `$`.
314+A trap is a [`core`](@/docs/glossary/core.md) with one arm `$`.
315315
316316#### Source
317317
@@ -416,6 +416,6 @@ type that was passed in.
416416
417417Using a `unit` allows you to specify something that may not be there.
418418
419−See also: [`++bind`](../2b)
419+See also: [`++bind`](@/docs/hoon/reference/stdlib/2a.md#bind)
420420
421−---
421+---
hoon/reference/stdlib/2a.md+50−50
@@ -6,20 +6,20 @@ template = "doc.html"
66
77### `++biff`
88
9−Unit as argument
9+[`Unit`](@/docs/hoon/reference/stdlib/1c.md#unit) as argument
1010
11−Applies a function `b` that produces a unit to the unwrapped value of ++unit
11+Applies a function `b` that produces a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) to the unwrapped value of [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit)
1212`a` (`u.a`). If `a` is empty, `~` is produced.
1313
1414#### Accepts
1515
16−`a` is a unit.
16+`a` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
1717
18−`b` is a function that accepts a noun and produces a unit.
18+`b` is a function that accepts a [`noun`](@/docs/glossary/noun.md) and produces a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
1919
2020#### Produces
2121
22−A unit.
22+A [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
2323
2424#### Source
2525
@@ -44,21 +44,21 @@ A unit.
4444---
4545### `++bind`
4646
47−Non-unit function to unit, producing unit
47+Non-unit function to [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit), producing [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit)
4848
49−Applies a function `b` to the value (`u.a`) of a ++unit `a`, producing
50−a unit. Used when you want a function that does not accept or produce a
51−unit to both accept and produce a unit.
49+Applies a function `b` to the value (`u.a`) of a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) `a`, producing
50+a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit). Used when you want a function that does not accept or produce a
51+[`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) to both accept and produce a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
5252
5353#### Accepts
5454
55−`a` is a unit.
55+`a` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
5656
5757`b` is a function.
5858
5959#### Produces
6060
61−A unit.
61+A [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
6262
6363#### Source
6464
@@ -87,18 +87,18 @@ A unit.
8787
8888Replace null
8989
90−Replaces an empty ++unit `b` with the product of a called trap
91−`a`. If the unit is not empty, then the original unit is produced.
90+Replaces an empty [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) `b` with the product of a called [`trap`](@/docs/glossary/trap.md)
91+`a`. If the [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) is not empty, then the original [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) is produced.
9292
9393#### Accepts
9494
95−`a` is a trap.
95+`a` is a [`trap`](@/docs/glossary/trap.md).
9696
97−`b` is a unit.
97+`b` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
9898
9999#### Produces
100100
101−Either the product of `a` or the value inside of unit `b`.
101+Either the product of `a` or the value inside of [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) `b`.
102102
103103#### Source
104104
@@ -126,21 +126,21 @@ Either the product of `a` or the value inside of unit `b`.
126126---
127127### `++both`
128128
129−Group unit values into pair
129+Group [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) values into pair
130130
131131Produces `~` if either `a` or `b` are empty. Otherwise, produces a
132−++unit whose value is a cell of the values of two input units `a` and
132+[`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) whose value is a cell of the values of two input [`units`](@/docs/hoon/reference/stdlib/1c.md#unit) `a` and
133133`b`.
134134
135135#### Accepts
136136
137−`a` is a unit.
137+`a` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
138138
139−`b` is a unit.
139+`b` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
140140
141141#### Produces
142142
143−A unit of the two initial values.
143+A [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) of the two initial values.
144144
145145#### Source
146146
@@ -165,22 +165,22 @@ A unit of the two initial values.
165165---
166166### `++clap`
167167
168−Apply function to two units
168+Apply function to two [`units`](@/docs/hoon/reference/stdlib/1c.md#unit)
169169
170170Applies a binary function `c`--which does not usually accept or produce a
171−`++unit`-- to the values of two units, `a` and `b`, producing a unit.
171+[`unit`](@/docs/hoon/reference/stdlib/1c.md#unit)-- to the values of two [`units`](@/docs/hoon/reference/stdlib/1c.md#unit), `a` and `b`, producing a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
172172
173173#### Accepts
174174
175−`a` is a unit.
175+`a` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
176176
177−`b` is a unit.
177+`b` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
178178
179179`c` is a function that performs a binary operation.
180180
181181#### Produces
182182
183−A unit.
183+A [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
184184
185185#### Source
186186
@@ -212,13 +212,13 @@ A unit.
212212---
213213### `++drop`
214214
215−Unit to list
215+[`Unit`](@/docs/hoon/reference/stdlib/1c.md#unit) to list
216216
217−Makes a ++list of the unwrapped value (`u.a`) of a `++unit` `a`.
217+Makes a [`++list`](@/docs/hoon/reference/stdlib/1c.md#list) of the unwrapped value (`u.a`) of a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) `a`.
218218
219219#### Accepts
220220
221−`a` is a unit.
221+`a` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
222222
223223#### Produces
224224
@@ -249,19 +249,19 @@ A list.
249249---
250250### `++fall`
251251
252−Give unit a default value
252+Give [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) a default value
253253
254−Produces a default value `b` for a `++unit` `a` in cases where `a` is null.
254+Produces a default value `b` for a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) `a` in cases where `a` is null.
255255
256256#### Accepts
257257
258−`a` is a unit.
258+`a` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
259259
260−`b` is a noun that's used as the default value.
260+`b` is a [`noun`](@/docs/glossary/noun.md) that's used as the default value.
261261
262262#### Produces
263263
264−Either a noun `b` or the unwrapped value of unit `a`.
264+Either a [`noun`](@/docs/glossary/noun.md) `b` or the unwrapped value of [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) `a`.
265265
266266#### Source
267267
@@ -285,19 +285,19 @@ Either a noun `b` or the unwrapped value of unit `a`.
285285
286286Curried bind
287287
288−Accepts a `++gate` `a` and produces a function that accepts `++unit`
288+Accepts a `++gate` `a` and produces a function that accepts [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit)
289289`b` to which it applies `a`. Used when you want a function that does not accept
290−or produce a unit to both accept and produce a unit.
290+or produce a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) to both accept and produce a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
291291
292292#### Accepts
293293
294294`a` is a gate.
295295
296−`b` is a unit.
296+`b` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
297297
298298#### Produces
299299
300−A unit.
300+A [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
301301
302302#### Source
303303
@@ -324,7 +324,7 @@ A unit.
324324
325325Choose
326326
327−Accepts two units `a` and `b` whose values are expected to be
327+Accepts two [`units`](@/docs/hoon/reference/stdlib/1c.md#unit) `a` and `b` whose values are expected to be
328328equivalent. If either is empty, then the value of the other is produced.
329329If neither are empty, it asserts that both values are the same and
330330produces that value. If the assertion fails, `++mate` crashes with
@@ -332,13 +332,13 @@ produces that value. If the assertion fails, `++mate` crashes with
332332
333333#### Accepts
334334
335−`a` is a unit.
335+`a` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
336336
337−`b` is a unit.
337+`b` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
338338
339339#### Produces
340340
341−A unit or crash.
341+A [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) or crash.
342342
343343#### Source
344344
@@ -374,13 +374,13 @@ A unit or crash.
374374---
375375### `++need`
376376
377−Unwrap unit
377+Unwrap [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit)
378378
379−Retrieve the value from a `++unit` and crash if the unit is null.
379+Retrieve the value from a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) and crash if the [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) is null.
380380
381381#### Accepts
382382
383−`a` is a unit.
383+`a` is a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
384384
385385#### Produces
386386
@@ -415,17 +415,17 @@ Either the unwrapped value of `a` (`u.a`), or crash.
415415---
416416### `++some`
417417
418−Wrap value in a unit
418+Wrap value in a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit)
419419
420−Takes any noun `a` and produces a `++unit` with the value set to `a`.
420+Takes any [`noun`](@/docs/glossary/noun.md) `a` and produces a [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit) with the value set to `a`.
421421
422422#### Accepts
423423
424−`a` is a noun.
424+`a` is a [`noun`](@/docs/glossary/noun.md).
425425
426426#### Produces
427427
428−A unit.
428+A [`unit`](@/docs/hoon/reference/stdlib/1c.md#unit).
429429
430430#### Source
431431
@@ -446,4 +446,4 @@ A unit.
446446```
447447
448448
449−---
449+---