on master help sign in
Merge pull request #1146 from tinnus-napbus/update-stdlib-2d-to-2i

update stdlib 2d 2e 2f 2g 2h 2i

commit5f2c0c0ff9a91fb1b4134dcd0cceb70a9a23caff authortinnus-napbus <77721746+tinnus-napbus@users.noreply.github.com> dateTue 21 Sep 2021, 21:46 (5 years ago) parent8b27fae38a3961
8 files changed+1458−1376
content/docs/hoon/reference/stdlib/2d.md+51−50 content/docs/hoon/reference/stdlib/2e.md+96−176 content/docs/hoon/reference/stdlib/2f.md+160−282 content/docs/hoon/reference/stdlib/2g.md+24−24 content/docs/hoon/reference/stdlib/2h.md+345−345 content/docs/hoon/reference/stdlib/2i.md+720−436 content/docs/hoon/reference/stdlib/table-of-contents.md+21−22 lib/glossary.js+41−41
content/docs/hoon/reference/stdlib/2d.md+51−50
@@ -23,22 +23,22 @@ An atom.
2323#### Source
2424
2525```hoon
26− ++ con
27− ~/ %con
28− |= [a=@ b=@]
29− =+ [c=0 d=0]
30− |- ^- @
31− ?: ?&(=(0 a) =(0 b)) d
32− %= $
33− a (rsh 0 1 a)
34− b (rsh 0 1 b)
35− c +(c)
36− d %+ add d
37− %^ lsh 0 c
38− ?& =(0 (end 0 1 a))
39− =(0 (end 0 1 b))
40− ==
41− ==
26+++ con
27+ ~/ %con
28+ |= [a=@ b=@]
29+ =+ [c=0 d=0]
30+ |- ^- @
31+ ?: ?&(=(0 a) =(0 b)) d
32+ %= $
33+ a (rsh 0 a)
34+ b (rsh 0 b)
35+ c +(c)
36+ d %+ add d
37+ %+ lsh [0 c]
38+ ?& =(0 (end 0 a))
39+ =(0 (end 0 b))
40+ ==
41+ ==
4242```
4343
4444#### Examples
@@ -97,8 +97,8 @@ contexts. That's because `0` is true in Hoon and `1` is false. Outside of Hoon,
9797where `0` is false and `1` is true, bitwise OR is the logical disjunction and
9898bitwise AND is the logical conjunction.
9999
100−
101100---
101+
102102### `++dis`
103103
104104Binary AND
@@ -118,22 +118,22 @@ An atom.
118118#### Source
119119
120120```hoon
121− ++ dis
122− ~/ %dis
123− |= [a=@ b=@]
124− =| [c=@ d=@]
125− |- ^- @
126− ?: ?|(=(0 a) =(0 b)) d
127− %= $
128− a (rsh 0 1 a)
129− b (rsh 0 1 b)
130− c +(c)
131− d %+ add d
132− %^ lsh 0 c
133− ?| =(0 (end 0 1 a))
134− =(0 (end 0 1 b))
135− ==
136− ==
121+++ dis
122+ ~/ %dis
123+ |= [a=@ b=@]
124+ =| [c=@ d=@]
125+ |- ^- @
126+ ?: ?|(=(0 a) =(0 b)) d
127+ %= $
128+ a (rsh 0 a)
129+ b (rsh 0 b)
130+ c +(c)
131+ d %+ add d
132+ %+ lsh [0 c]
133+ ?| =(0 (end 0 a))
134+ =(0 (end 0 b))
135+ ==
136+ ==
137137```
138138
139139#### Examples
@@ -187,6 +187,7 @@ where `0` is false and `1` is true, bitwise OR is the logical disjunction and
187187bitwise AND is the logical conjunction.
188188
189189---
190+
190191### `++mix`
191192
192193Binary XOR
@@ -206,19 +207,19 @@ An atom.
206207#### Source
207208
208209```hoon
209− ++ mix
210− ~/ %mix
211− |= [a=@ b=@]
212− ^- @
213− =+ [c=0 d=0]
214− |-
215− ?: ?&(=(0 a) =(0 b)) d
216− %= $
217− a (rsh 0 1 a)
218− b (rsh 0 1 b)
219− c +(c)
220− d (add d (lsh 0 c =((end 0 1 a) (end 0 1 b))))
221− ==
210+++ mix
211+ ~/ %mix
212+ |= [a=@ b=@]
213+ ^- @
214+ =+ [c=0 d=0]
215+ |-
216+ ?: ?&(=(0 a) =(0 b)) d
217+ %= $
218+ a (rsh 0 a)
219+ b (rsh 0 b)
220+ c +(c)
221+ d (add d (lsh [0 c] =((end 0 a) (end 0 b))))
222+ ==
222223```
223224
224225#### Examples
@@ -272,6 +273,7 @@ its samples and its product are stacked.
272273```
273274
274275---
276+
275277### `++not`
276278
277279Binary NOT
@@ -294,8 +296,8 @@ An atom.
294296#### Source
295297
296298```hoon
297− ++ not |= [a=bloq b=@ c=@]
298− (mix c (dec (bex (mul b (bex a)))))
299+++ not |= [a=bloq b=@ c=@]
300+ (mix c (dec (bex (mul b (bex a)))))
299301```
300302
301303#### Examples
@@ -369,5 +371,4 @@ What's happening here may not be readily apparent. But we're only flipping the
369371last block of size `1` (bitwidth 2) of the binary `0b111`. That is, we leave
370372the "0b1" piece just the same and manipulate the "11" that the number ends with.
371373
372−
373−---
374+---
content/docs/hoon/reference/stdlib/2e.md+96−176
@@ -4,43 +4,6 @@ weight = 8
44template = "doc.html"
55+++
66
7−### `++fnv`
8−
9−FNV scrambler
10−
11−Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm. Multiplies
12−`a` by the prime number 16,777,619 and then takes the [block](/docs/hoon/reference/stdlib/2c) of size
13−5 off the product's end, producing an atom.
14−
15−#### Accepts
16−
17−`a` is an atom.
18−
19−#### Produces
20−
21−An atom.
22−
23−#### Source
24−
25−```hoon
26− ++ fnv |=(a=@ (end 5 1 (mul 16.777.619 a)))
27−```
28−
29−#### Examples
30−
31−```
32− > (fnv 10.000)
33− 272.465.456
34−
35− > (fnv 10.001)
36− 289.243.075
37−
38− > (fnv 1)
39− 16.777.619
40−```
41−
42−
43−---
447### `++mug` {#mug}
458
469murmur3 scrambler
@@ -59,57 +22,70 @@ An atom.
5922#### Source
6023
6124```hoon
62−++ mug :: mug with murmur3
25+++ mug
6326 ~/ %mug
64− |= a/*
65− |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
66− ++ trim :: 31-bit nonzero
67− |= key/@
68− =+ syd=0xcafe.babe
69− |- ^- @
70− =+ haz=(muk syd (met 3 key) key)
71− =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
72− ?.(=(0 ham) ham $(syd +(syd)))
27+ |= a=*
28+ |^ ?@ a (mum 0xcafe.babe 0x7fff a)
29+ =/ b (cat 5 $(a -.a) $(a +.a))
30+ (mum 0xdead.beef 0xfffe b)
31+ ::
32+ ++ mum
33+ |= [syd=@uxF fal=@F key=@]
34+ =/ wyd (met 3 key)
35+ =| i=@ud
36+ |- ^- @F
37+ ?: =(8 i) fal
38+ =/ haz=@F (muk syd wyd key)
39+ =/ ham=@F (mix (rsh [0 31] haz) (end [0 31] haz))
40+ ?.(=(0 ham) ham $(i +(i), syd +(syd)))
7341 --
7442```
7543
7644#### Examples
7745
7846```
79− > (mug 10.000)
80− 795.713.195
81−
82− > (mug 10.001)
83− 420.521.697
47+> (mug 10.000)
48+795.713.195
49+```
8450
85− > (mug 1)
86− 1.901.865.568
51+```
52+> (mug 10.001)
53+420.521.697
54+```
8755
88− > (mug (some 10))
89− 2.099.076.946
56+```
57+> (mug 1)
58+1.901.865.568
59+```
9060
91− > (mug [1 2 3 4 5 ~])
92− 1.719.833.228
61+```
62+> (mug (some 10))
63+750.200.080
9364```
9465
66+```
67+> (mug [1 2 3 4 5 ~])
68+1.565.443.491
69+```
9570
9671---
72+
9773### `++muk`
9874
9975Standard MurmurHash3
10076
10177Implementation of the 32-bit
10278[MurmurHash3](https://en.wikipedia.org/wiki/MurmurHash#Algorithm)
103−non-cryptographic hash algorithm. Takes `a` as the seed, `b` as the key length
104−in [blocks](/docs/hoon/reference/stdlib/2c) of size 3, and `c` as the key, producing an atom.
79+non-cryptographic hash algorithm. Takes `syd` as the seed, `len` as the key length
80+in [blocks](/docs/hoon/reference/stdlib/2c) of size 3, and `key` as the key, producing an atom.
10581
10682#### Accepts
10783
108−`a` is an atom.
84+`syd` is an atom.
10985
110−`b` is an atom.
86+`len` is an atom.
11187
112−`c` is an atom.
88+`key` is an atom.
11389
11490#### Produces
11591
@@ -118,63 +94,63 @@ An atom.
11894#### Source
11995
12096```hoon
121− ++ muk
122− ~% %muk ..muk ~
123− =+ ~(. fe 5)
124− |= [syd=@ len=@ key=@]
125− ?> &((lte (met 5 syd) 1) (lte (met 0 len) 31))
126− =/ pad (sub len (met 3 key))
127− =/ data (weld (rip 3 key) (reap pad 0))
128− =/ nblocks (div len 4) :: intentionally off-by-one
129− =/ h1 syd
130− =+ [c1=0xcc9e.2d51 c2=0x1b87.3593]
131− =/ blocks (rip 5 key)
132− =/ i nblocks
133− =. h1 =/ hi h1 |-
134− ?: =(0 i) hi :: negative array index
135− =/ k1 (snag (sub nblocks i) blocks)
136− =. k1 (sit (mul k1 c1))
137− =. k1 (rol 0 15 k1)
138− =. k1 (sit (mul k1 c2))
139− =. hi (mix hi k1)
140− =. hi (rol 0 13 hi)
141− =. hi (sum (sit (mul hi 5)) 0xe654.6b64)
142− $(i (dec i))
143− =/ tail (slag (mul 4 nblocks) data)
144− =/ k1 0
145− =/ tlen (dis len 3)
146− =. h1
147− ?+ tlen h1 :: fallthrough switch
148− $3 =. k1 (mix k1 (lsh 0 16 (snag 2 tail)))
149− =. k1 (mix k1 (lsh 0 8 (snag 1 tail)))
150− =. k1 (mix k1 (snag 0 tail))
151− =. k1 (sit (mul k1 c1))
152− =. k1 (rol 0 15 k1)
153− =. k1 (sit (mul k1 c2))
154− (mix h1 k1)
155− $2 =. k1 (mix k1 (lsh 0 8 (snag 1 tail)))
156− =. k1 (mix k1 (snag 0 tail))
157− =. k1 (sit (mul k1 c1))
158− =. k1 (rol 0 15 k1)
159− =. k1 (sit (mul k1 c2))
160− (mix h1 k1)
161− $1 =. k1 (mix k1 (snag 0 tail))
162− =. k1 (sit (mul k1 c1))
163− =. k1 (rol 0 15 k1)
164− =. k1 (sit (mul k1 c2))
165− (mix h1 k1)
166− ==
167− =. h1 (mix h1 len)
168− |^ (fmix32 h1)
169− ++ fmix32
170− |= h=@
171− =. h (mix h (rsh 0 16 h))
172− =. h (sit (mul h 0x85eb.ca6b))
173− =. h (mix h (rsh 0 13 h))
174− =. h (sit (mul h 0xc2b2.ae35))
175− =. h (mix h (rsh 0 16 h))
176− h
177− --
97+++ muk :: standard murmur3
98+ ~% %muk ..muk ~
99+ =+ ~(. fe 5)
100+ |= [syd=@ len=@ key=@]
101+ =. syd (end 5 syd)
102+ =/ pad (sub len (met 3 key))
103+ =/ data (weld (rip 3 key) (reap pad 0))
104+ =/ nblocks (div len 4) :: intentionally off-by-one
105+ =/ h1 syd
106+ =+ [c1=0xcc9e.2d51 c2=0x1b87.3593]
107+ =/ blocks (rip 5 key)
108+ =/ i nblocks
109+ =. h1 =/ hi h1 |-
110+ ?: =(0 i) hi
111+ =/ k1 (snag (sub nblocks i) blocks) :: negative array index
112+ =. k1 (sit (mul k1 c1))
113+ =. k1 (rol 0 15 k1)
114+ =. k1 (sit (mul k1 c2))
115+ =. hi (mix hi k1)
116+ =. hi (rol 0 13 hi)
117+ =. hi (sum (sit (mul hi 5)) 0xe654.6b64)
118+ $(i (dec i))
119+ =/ tail (slag (mul 4 nblocks) data)
120+ =/ k1 0
121+ =/ tlen (dis len 3)
122+ =. h1
123+ ?+ tlen h1 :: fallthrough switch
124+ %3 =. k1 (mix k1 (lsh [0 16] (snag 2 tail)))
125+ =. k1 (mix k1 (lsh [0 8] (snag 1 tail)))
126+ =. k1 (mix k1 (snag 0 tail))
127+ =. k1 (sit (mul k1 c1))
128+ =. k1 (rol 0 15 k1)
129+ =. k1 (sit (mul k1 c2))
130+ (mix h1 k1)
131+ %2 =. k1 (mix k1 (lsh [0 8] (snag 1 tail)))
132+ =. k1 (mix k1 (snag 0 tail))
133+ =. k1 (sit (mul k1 c1))
134+ =. k1 (rol 0 15 k1)
135+ =. k1 (sit (mul k1 c2))
136+ (mix h1 k1)
137+ %1 =. k1 (mix k1 (snag 0 tail))
138+ =. k1 (sit (mul k1 c1))
139+ =. k1 (rol 0 15 k1)
140+ =. k1 (sit (mul k1 c2))
141+ (mix h1 k1)
142+ ==
143+ =. h1 (mix h1 len)
144+ |^ (fmix32 h1)
145+ ++ fmix32
146+ |= h=@
147+ =. h (mix h (rsh [0 16] h))
148+ =. h (sit (mul h 0x85eb.ca6b))
149+ =. h (mix h (rsh [0 13] h))
150+ =. h (sit (mul h 0xc2b2.ae35))
151+ =. h (mix h (rsh [0 16] h))
152+ h
153+ --
178154```
179155
180156#### Examples
@@ -209,60 +185,4 @@ An atom.
209185 246.077.549
210186```
211187
212−
213−---
214−### `++mum`
215−
216−31-bit MurmurHash3 scrambler
217−
218−Hashes `a` with the 31-bit MurmurHash3 non-cryptographic hash algorithm,
219−producing an atom.
220−
221−#### Accepts
222−
223−`a` is a noun.
224−
225−#### Produces
226−
227−An atom.
228−
229−#### Source
230−
231−```hoon
232− ++ mum
233− ~/ %mum
234− |= a=*
235− |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
236− ++ trim
237− |= key=@
238− =+ syd=0xcafe.babe
239− |- ^- @
240− =+ haz=(muk syd (met 3 key) key)
241− =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
242− ?.(=(0 ham) ham $(syd +(syd)))
243−```
244−
245−#### Examples
246−
247−```
248− > (mum 10.000)
249− 795.713.195
250−
251− > (mum 10.001)
252− 420.521.697
253−
254− > (mum 'jerry')
255− 1.540.161.753
256−
257− > (mum 1)
258− 1.901.865.568
259−
260− > (mum (some 10))
261− 2.099.076.946
262−
263− > (mum [1 2 3 4 5 ~])
264− 1.719.833.228
265−```
266−
267−
268188---
content/docs/hoon/reference/stdlib/2f.md+160−282
@@ -8,7 +8,7 @@ template = "doc.html"
88
99Alphabetical order
1010
11−Computes whether `a` and `b` are in alphabetical order, producing a flag.
11+Computes whether `a` and `b` are in alphabetical order, producing a flag. Orders atoms before cells, and atoms in ascending LSB order.
1212
1313#### Accepts
1414
@@ -23,62 +23,85 @@ A flag.
2323#### Source
2424
2525```hoon
26− ++ aor
27− ~/ %aor
28− |= [a=* b=*]
29− ^- ?
30− ?: =(a b) &
31− ?. ?=(@ a)
32− ?: ?=(@ b) |
33− ?: =(-.a -.b)
34− $(a +.a, b +.b)
35− $(a -.a, b -.b)
36− ?. ?=(@ b) &
37− |-
38− =+ [c=(end 3 1 a) d=(end 3 1 b)]
39− ?: =(c d)
40− $(a (rsh 3 1 a), b (rsh 3 1 b))
41− (lth c d)
26+++ aor
27+ ~/ %aor
28+ |= [a=* b=*]
29+ ^- ?
30+ ?: =(a b) &
31+ ?. ?=(@ a)
32+ ?: ?=(@ b) |
33+ ?: =(-.a -.b)
34+ $(a +.a, b +.b)
35+ $(a -.a, b -.b)
36+ ?. ?=(@ b) &
37+ |-
38+ =+ [c=(end 3 a) d=(end 3 b)]
39+ ?: =(c d)
40+ $(a (rsh 3 a), b (rsh 3 b))
41+ (lth c d)
4242```
4343
4444#### Examples
4545
4646```
47− > (aor 'a' 'b')
48− %.y
49−
50− > (aor 'b' 'a')
51− %.n
52−
53− > (aor 'a' 'a')
54− %.y
55−
56− > (aor "foo" "bar")
57− %.n
58−
59− > (aor "bar" "foo")
60− %.y
47+> (aor 'a' 'b')
48+%.y
49+> (aor 'b' 'a')
50+%.n
51+> (aor 'a' 'a')
52+%.y
53+
54+> (aor 1 2)
55+%.y
56+> (aor 2 1)
57+%.n
58+
59+> (aor ['a' ~] 'b')
60+%.n
61+> (aor 'b' ['a' ~])
62+%.y
63+
64+> (aor ['a' ~] ['b' ~])
65+%.y
66+> (aor ['b' ~] ['a' ~])
67+%.n
68+
69+> (aor "abca" "abcz")
70+%.y
71+> (aor "abcz" "abca")
72+%.n
73+
74+> (aor 0b1011 0b1010)
75+%.n
76+> (aor 0b1010 0b1011)
77+%.y
78+
79+> (aor [1 2] [2 1])
80+%.y
81+> (aor [2 1] [1 2])
82+%.n
83+```
6184
62− > (aor "abcdefz" "abcdefa")
63− %.n
85+Note the possible differences with `+dor` due to comparing one byte at a time:
6486
65− > (aor "abcdefa" "abcdefz")
66− %.y
67−
68− > (aor 10.000 17.000)
69− %.y
70−
71− > (aor 10 9)
72− %.n
7387```
88+> (aor 0b1001.0000.0000 0b1000.1000.0000)
89+%.y
90+> (dor 0b1001.0000.0000 0b1000.1000.0000)
91+%.n
92+```
93+
94+#### Discussion
7495
96+This is different than [+dor](#dor) in that it compares atoms one byte at a time, while `+dor` compares whole atoms at once. Note that because it simply compares bytes, it doesn't account for multi-byte UTF-8 characters and the like.
7597
7698---
99+
77100### `++dor`
78101
79−Numeric order
102+Depth order
80103
81−Computes whether `a` and `b` are in ascending numeric order, producing a flag.
104+Computes whether `a` and `b` are in ascending tree depth order, producing a flag. Orders atoms before cells, and atoms in ascending numerical order.
82105
83106#### Accepts
84107
@@ -93,62 +116,71 @@ A flag.
93116#### Source
94117
95118```hoon
96− ++ dor
97− ~/ %dor
98− |= [a=* b=*]
99− ^- ?
100− ?: =(a b) &
101− ?. ?=(@ a)
102− ?: ?=(@ b) |
103− ?: =(-.a -.b)
104− $(a +.a, b +.b)
105− $(a -.a, b -.b)
106− ?. ?=(@ b) &
107− (lth a b)
119+++ dor
120+ ~/ %dor
121+ |= [a=* b=*]
122+ ^- ?
123+ ?: =(a b) &
124+ ?. ?=(@ a)
125+ ?: ?=(@ b) |
126+ ?: =(-.a -.b)
127+ $(a +.a, b +.b)
128+ $(a -.a, b -.b)
129+ ?. ?=(@ b) &
130+ (lth a b)
108131```
109132
110133#### Examples
111134
112135```
113− > (dor 1 2)
114− %.y
136+> (dor 1 2)
137+%.y
115138
116− > (dor 2 1)
117− %.n
139+> (dor 2 1)
140+%.n
118141
119− > (dor ~[1 2 3] ~[1 2 4])
120− %.y
142+> (dor ~[1 2 3] ~[1 2 4])
143+%.y
121144
122− > (dor ~[1 2 4] ~[1 2 3])
123− %.n
145+> (dor ~[1 2 4] ~[1 2 3])
146+%.n
124147
125− > (dor `(list @)`~[99 100 10.000] ~[99 101 10.000])
126− %.y
148+> (dor `(list @)`~[99 100 10.000] ~[99 101 10.000])
149+%.y
127150
128− > (dor ~[99 101 10.999] `(list @)`~[99 100 10.000])
129− %.n
151+> (dor ~[99 101 10.999] `(list @)`~[99 100 10.000])
152+%.n
153+```
154+
155+Note the possible difference with [+aor](#aor) due to comparing whole atoms rather than one byte at a time:
156+
157+```
158+> (aor 0b1001.0000.0000 0b1000.1000.0000)
159+%.y
160+> (dor 0b1001.0000.0000 0b1000.1000.0000)
161+%.n
130162```
131163
132164#### Discussion
133165
134−If `a` and `b` are both atoms, `dor` is equivalent to [`lte`](/docs/hoon/reference/stdlib/1a). If they're
166+If `a` and `b` are both atoms, `dor` is equivalent to [`lte`](/docs/hoon/reference/stdlib/1a#lte). If they're
135167cells, `dor` recurses on the heads, and then if the heads are the same it checks
136168the tails.
137169
138170If one sample is a cell and the other is an atom, the cell sample is treated as
139171"greater."
140172
141−
142173---
174+
143175### `++gor`
144176
145−Hash order
177+Mug order
146178
147179Computes whether of `(mug a)` and `(mug b)` are in ascending numeric order,
148180producing a flag. If the `mug` hashes are equal, `a` and `b` are compared by
149181`dor` instead.
150182
151−[`mug`](/docs/hoon/reference/stdlib/2e) is the the 31-bit nonzero FNV-1a hash algorithm.
183+[`mug`](/docs/hoon/reference/stdlib/2e#mug) is the the 31-bit nonzero FNV-1a hash algorithm.
152184
153185#### Accepts
154186
@@ -163,223 +195,70 @@ A flag.
163195#### Source
164196
165197```hoon
166− ++ gor
167− ~/ %gor
168− |= [a=* b=*]
169− ^- ?
170− =+ [c=(mug a) d=(mug b)]
171− ?: =(c d)
172− (dor a b)
173− (lth c d)
198+++ gor
199+ ~/ %gor
200+ |= [a=* b=*]
201+ ^- ?
202+ =+ [c=(mug a) d=(mug b)]
203+ ?: =(c d)
204+ (dor a b)
205+ (lth c d)
174206```
175207
176208#### Examples
177209
178210```
179− > (gor 'd' 'c')
180− %.y
181−
182− > 'd'
183− 'd'
184−
185− > 'c'
186− 'c'
187−
188− > `@ud`'d'
189− 100
190−
191− > `@ud`'c'
192− 99
193−
194− > (mug 'd')
195− 1.628.185.714
196−
197− > (mug 'c')
198− 1.712.073.811
199−
200− > (gor 'd' 'c')
201− %.y
202−
203− > (gor 'c' 'd')
204− %.n
205−
206− > (gor "foo" "bar")
207− %.n
208−
209− > (gor (some 10) `(list @)`[1 2 3 ~])
210− %.n
211−```
212−
213−#### Discussion
214−
215−`map`s use `gor` on the key for horizontal ordering and `vor` for
216−vertical order. `map`s only look at the keys (the head of the key-value pair
217−elements) for ordering.
218−
219−---
220−### `++hor`
221−
222−Horizontal hash order
223−
224−If `a` and `b` are atoms, they are computed as samples of `gor`, producing a
225−flag.
226−
227−If `a` and `b` are cells, `hor` checks to see if their heads are equal. If their
228−heads are equal, `gor` is computed on their tails, producing a flag. If their
229−heads are not equal, `gor` is computed on their heads, producing a flag.
230−
231−If `a` is an atom and `b` is not, then `%.y` is produced. If `b` is an atom and
232−`a` is not, `%.n` is produced.
233−
234−#### Accepts
235−
236−`a` is a noun.
237−
238−`b` is a noun.
239−
240−#### Produces
241−
242−A flag.
243−
244−#### Source
245−
246−```hoon
247− ++ hor
248− ~/ %hor
249− |= [a=* b=*]
250− ^- ?
251− ?: ?=(@ a)
252− ?. ?=(@ b) &
253− (gor a b)
254− ?: ?=(@ b) |
255− ?: =(-.a -.b)
256− (gor +.a +.b)
257− (gor -.a -.b)
258−```
259−
260−#### Examples
261−
211+> (gor 'd' 'c')
212+%.y
213+
214+> 'd'
215+'d'
216+> 'c'
217+'c'
218+
219+> `@ud`'d'
220+100
221+> `@ud`'c'
222+99
223+
224+> (mug 'd')
225+1.628.185.714
226+> (mug 'c')
227+1.712.073.811
228+
229+> (gor 'd' 'c')
230+%.y
231+> (gor 'c' 'd')
232+%.n
262233```
263− > (hor . 1)
264− %.n
265−
266− > (hor 1 2)
267− %.y
268−
269− > (hor "abc" "cba")
270− %.y
271−
272− > (hor 'c' 'd')
273− %.n
274−
275− > (hor 100 [1 1])
276− %.y
277−
278− > (hor [1 1] 100)
279− %.n
280−
281− > (hor 500.000.000 "foo")
282− %.y
283−
284− > (hor "foo" 500.000.000)
285− %.n
286−
287− > (hor 0 "foo")
288− %.y
289234
290− > (gor `(list @)`[0 ~] 1)
291− %.n
292−
293− > (hor `(list @)`[50 500 5.000 ~] 1)
294− %.n
295235```
296−
297−#### Discussion
298−
299−Sets (+set, +in) use `hor` for their horizontal order and `vor` for their
300−vertical order. See [`apt:in`](/docs/hoon/reference/stdlib/2h) to see how a set verifies its correctness.
301−`vor` is used to verify.
302−
303−---
304−### `++lor`
305−
306−Leg order
307−
308−Computes whether the corresponding legs of `a` and `b` are in ascending
309−numeric order, producing a flag.
310−
311−#### Accepts
312−
313−`a` is a noun.
314−
315−`b` is a noun.
316−
317−#### Accepts
318−
319−A flag.
320−
321−#### Source
322−
323−```hoon
324− ++ lor
325− ~/ %lor
326− |= [a=* b=*]
327− ^- ?
328− ?: =(a b) &
329− ?@ a
330− ?^ b &
331− (lth a b)
332− ?: =(-.a -.b)
333− $(a +.a, b +.b)
334− $(a -.a, b -.b)
236+> (gor "foo" "bar")
237+%.n
335238```
336239
337−#### Examples
338−
339240```
340− > (lor 1 2)
341− %.y
342−
343− > (lor 2 1)
344− %.n
345−
346− > (lor 9 [1 2])
347− %.y
348−
349− > (lor `(list @)`[1 2 3 ~] `(list @)`[1 2 3 4 ~])
350− %.y
351−
352− > (lor `(list @)`[1 2 3 ~] `(list @)`[1 2 2 ~])
353− %.n
354−
355− > (lor `(list @)`[1 2 3 ~] `(list @)`[2 2 ~])
356− %.y
357−
358− > (lor [2 2 5] [1 5 9 8])
359− %.n
360−
361− > (lor [1 5 8] [1 5 9 8])
362− %.y
363−
364− > (lor [1 2 3] [1 2])
365− !! exit
241+> (gor (some 10) `(list @)`[1 2 3 ~])
242+%.n
366243```
367244
368245#### Discussion
369246
370−`lor` is no longer used internally.
247+`map`s use `gor` on the key for horizontal ordering and `mor` for
248+vertical order. `map`s only look at the keys (the head of the key-value pair
249+elements) for ordering.
371250
372251---
373−### `++vor`
374252
375−Vertical order
253+### `++mor`
254+
255+(more) mug order
376256
377257Computes whether the double-hashes `(mug (mug a))` and `(mug (mug b))` are in
378258ascending numeric order, producing a flag. If the double-`mug` hashes are
379259equal, `a` and `b` are compared by `dor` instead.
380260
381−[`mug`](/docs/hoon/reference/stdlib/2e) is the the 31-bit nonzero FNV-1a hash algorithm.
382−
261+[`mug`](/docs/hoon/reference/stdlib/2e#mug) is the the 31-bit nonzero FNV-1a hash algorithm.
383262
384263#### Accepts
385264
@@ -394,20 +273,20 @@ A flag.
394273#### Source
395274
396275```hoon
397− ++ vor
398− ~/ %vor
399− |= [a=* b=*]
400− ^- ?
401− =+ [c=(mug (mug a)) d=(mug (mug b))]
402− ?: =(c d)
403− (dor a b)
404− (lth c d)
276+++ mor
277+ ~/ %mor
278+ |= [a=* b=*]
279+ ^- ?
280+ =+ [c=(mug (mug a)) d=(mug (mug b))]
281+ ?: =(c d)
282+ (dor a b)
283+ (lth c d)
405284```
406285
407286#### Examples
408287
409288```
410− > (vor 'f' 'g')
289+ > (mor 'f' 'g')
411290 %.y
412291
413292 > [(mug 'f') (mug 'g')]
@@ -416,22 +295,21 @@ A flag.
416295 > [(mug (mug 'f')) (mug (mug 'g'))]
417296 [261.421.509 1.861.258.547]
418297
419− > (vor 'a' 'z')
298+ > (mor 'a' 'z')
420299 %.n
421300
422− > (vor 43.326 41.106)
301+ > (mor 43.326 41.106)
423302 %.n
424303```
425304
426305#### Discussion
427306
428−Maps, sets, and queues all use `vor` to check for vertical ordering. Maps and
429−sets also use `gor` and `hor` for horizontal order, respectively, but queues use
307+Maps, sets, and queues all use `mor` to check for vertical ordering. Maps and
308+sets also use `gor` for horizontal order, but queues use
430309vertical ordering alone.
431310
432−Since hashing removes correlation, double-`mug`ging with `vor` removes
433−correlation with single-`mug`ged `hor`. Vertical order becomes uncorrelated
311+Since hashing removes correlation, double-`mug`ging with `mor` removes
312+correlation with single-`mug`ged `gor`. Vertical order becomes uncorrelated
434313with horizontal order.
435314
436−
437−---
315+---
content/docs/hoon/reference/stdlib/2g.md+24−24
@@ -21,14 +21,14 @@ An atom.
2121#### Source
2222
2323```hoon
24− ++ pow
25− ~/ %pow
26− |= [a=@ b=@]
27− ?: =(b 0) 1
28− |- ?: =(b 1) a
29− =+ c=$(b (div b 2))
30− =+ d=(mul c c)
31− ?~ (dis b 1) d (mul d a)
24+++ pow
25+ ~/ %pow
26+ |= [a=@ b=@]
27+ ?: =(b 0) 1
28+ |- ?: =(b 1) a
29+ =+ c=$(b (div b 2))
30+ =+ d=(mul c c)
31+ ?~ (dis b 1) d (mul d a)
3232```
3333
3434#### Examples
@@ -51,6 +51,7 @@ An atom.
5151```
5252
5353---
54+
5455### `++sqt`
5556
5657Computes the square root of `a` and its remainder.
@@ -66,20 +67,20 @@ A cell of atoms.
6667#### Source
6768
6869```hoon
69− ++ sqt
70− ~/ %sqt
71− |= a=@ ^- [p=@ q=@]
72− ?~ a [0 0]
73− =+ [q=(div (dec (xeb a)) 2) r=0]
74− =- [-.b (sub a +.b)]
75− ^= b |-
76− =+ s=(add r (bex q))
77− =+ t=(mul s s)
78− ?: =(q 0)
79− ?:((lte t a) [s t] [r (mul r r)])
80− ?: (lte t a)
81− $(r s, q (dec q))
82− $(q (dec q))
70+++ sqt
71+ ~/ %sqt
72+ |= a=@ ^- [p=@ q=@]
73+ ?~ a [0 0]
74+ =+ [q=(div (dec (xeb a)) 2) r=0]
75+ =- [-.b (sub a +.b)]
76+ ^= b |-
77+ =+ s=(add r (bex q))
78+ =+ t=(mul s s)
79+ ?: =(q 0)
80+ ?:((lte t a) [s t] [r (mul r r)])
81+ ?: (lte t a)
82+ $(r s, q (dec q))
83+ $(q (dec q))
8384```
8485
8586#### Examples
@@ -101,5 +102,4 @@ A cell of atoms.
101102 ! exit
102103```
103104
104−
105−---
105+---
content/docs/hoon/reference/stdlib/2h.md+345−345
@@ -4,7 +4,7 @@ weight = 11
44template = "doc.html"
55+++
66
7−### `++in`
7+## `++in`
88
99Set operations
1010
@@ -18,16 +18,16 @@ A `set`.
1818#### Source
1919
2020```hoon
21− ++ in
22− ~/ %in
23− |_ a=(set)
21+ ~/ %in
22+ =| a=(tree)
23+ |@
2424```
2525
2626#### Examples
2727
2828```
29− > ~(. in (sy "asd"))
30− <13.evb [nlr(^$1{@tD $1}) <414.fvk 101.jzo 1.ypj %164>]>
29+> ~(. in (sy "asd"))
30+<16.ufw [a=?(%~ [?(n=@tD n=#1) l=nlr(?(@tD #1)) r=nlr(?(@tD ^#1.?(@tD #1)))]) <123.zao 46.hgz 1.pnw %140>]>
3131```
3232
3333### `++all:in`
@@ -39,9 +39,9 @@ flag.
3939
4040#### Accepts
4141
42−`a` is a `set`.
42+`a` is a `set`, and is the sample of `+in`.
4343
44−`b` is a wet gate that accepts a noun and produces a flag.
44+`b` is a gate that accepts a noun and produces a flag.
4545
4646#### Produces
4747
@@ -50,28 +50,27 @@ A flag.
5050#### Source
5151
5252```hoon
53− ++ all :: logical AND
54− ~/ %all
55− |* b=$-(* ?)
56− |- ^- ?
57− ?~ a
58− &
59− ?&((b n.a) $(a l.a) $(a r.a))
53+++ all
54+ ~/ %all
55+ |* b=$-(* ?)
56+ |- ^- ?
57+ ?~ a
58+ &
59+ ?&((b n.a) $(a l.a) $(a r.a))
6060```
6161
6262#### Examples
6363
6464```
65− > =b (sy `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
66− > (~(all in b) |=(a=* ?@(+.a & |)))
67− %.n
65+> (~(all in (silt ~[1 2 3 4])) |=(a=@ (lth a 5)))
66+%.y
6867
69− > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
70− > (~(all in b) |=(a=@t (gte a 100)))
71− %.y
68+> (~(all in (silt ~[1 2 3 4 5])) |=(a=@ (lth a 5)))
69+%.n
7270```
7371
7472---
73+
7574### `++any:in`
7675
7776Logical OR
@@ -81,7 +80,7 @@ flag.
8180
8281#### Accepts
8382
84−`a` is a `set`.
83+`a` is a `set`, and is the sample of `+in`.
8584
8685`b` is a gate that accepts a noun and produces a flag.
8786
@@ -92,28 +91,27 @@ A flag.
9291#### Source
9392
9493```hoon
95− ++ any :: logical OR
96− ~/ %any
97− |* b=$-(* ?)
98− |- ^- ?
99− ?~ a
100− |
101− ?|((b n.a) $(a l.a) $(a r.a))
94+++ any
95+ ~/ %any
96+ |* b=$-(* ?)
97+ |- ^- ?
98+ ?~ a
99+ |
100+ ?|((b n.a) $(a l.a) $(a r.a))
102101```
103102
104103#### Examples
105104
106105```
107− > =b (sy `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
108− > (~(any in b) |=(a/* ?@(+.a & |)))
109− %.y
106+> (~(any in (silt ~[2 3 4 5])) |=(a=@ (lth a 3)))
107+%.y
110108
111− > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
112− > (~(any in b) |=(a=@t (lte a 100)))
113− %.n
109+> (~(any in (silt ~[3 4 5])) |=(a=@ (lth a 3)))
110+%.n
114111```
115112
116113---
114+
117115### `++apt:in`
118116
119117Check correctness
@@ -132,36 +130,38 @@ A flag.
132130#### Source
133131
134132```hoon
135− ++ apt :: check correctness
136− =< $
137− ~/ %apt
138− =| [l=(unit) r=(unit)]
139− |. ^- ?
140− ?~ a &
141− ?& ?~(l & (gor n.a u.l))
142− ?~(r & (gor u.r n.a))
143− ?~(l.a & ?&((mor n.a n.l.a) $(a l.a, l `n.a)))
144− ?~(r.a & ?&((mor n.a n.r.a) $(a r.a, r `n.a)))
145− ==
133+++ apt
134+ =< $
135+ ~/ %apt
136+ =| [l=(unit) r=(unit)]
137+ |. ^- ?
138+ ?~ a &
139+ ?& ?~(l & (gor n.a u.l))
140+ ?~(r & (gor u.r n.a))
141+ ?~(l.a & ?&((mor n.a n.l.a) $(a l.a, l `n.a)))
142+ ?~(r.a & ?&((mor n.a n.r.a) $(a r.a, r `n.a)))
143+ ==
146144```
147145
148146#### Examples
149147
150148```
151− > ~(apt in ~)
152− %.y
149+> ~(apt in ~)
150+%.y
151+```
153152
154− > =a (sy [1 2 3 4 5 6 ~])
155− > a
156− [n=6 l={5 4} r={1 3 2}]
157− > ~(apt in a)
158− %.y
153+```
154+> =a (silt ~[1 2 3])
155+> a
156+[n=2 l={1} r={3}]
157+> ~(apt in a)
158+%.y
159159
160− > =z ?~ a ~ a(n 7)
161− > z
162− [n=7 l={5 4} r={1 3 2}]
163− > ~(apt in z)
164− %.n
160+> =z ?~(a ~ a(n 10))
161+> z
162+[n=10 l={1} r={3}]
163+> ~(apt in z)
164+%.n
165165```
166166
167167#### Discussion
@@ -169,15 +169,16 @@ A flag.
169169See section [`2f`](/docs/hoon/reference/stdlib/2f) for more information on noun ordering.
170170
171171---
172+
172173### `++bif:in`
173174
174175Bifurcate
175176
176−Splits set `a` into two sets `l` and `r`, with any noun `b` removed.
177+Splits set `a` into sets `l` and `r`, which contain the items either side of `b` but not including `b`.
177178
178179#### Accepts
179180
180−`a` is a set.
181+`a` is a set, and is the sample of `+in`.
181182
182183`b` is a noun.
183184
@@ -188,40 +189,45 @@ A cell of two sets.
188189#### Source
189190
190191```hoon
191− ++ bif :: splits a by b
192− ~/ %bif
193− |* b=*
194− ^+ [l=a r=a]
195− =< +
196− |- ^+ a
197− ?~ a
198− [b ~ ~]
199− ?: =(b n.a)
200− a
201− ?: (gor b n.a)
202− =+ c=$(a l.a)
203− ?> ?=(^ c)
204− c(r a(l r.c))
205− =+ c=$(a r.a)
192+++ bif
193+ ~/ %bif
194+ |* b=*
195+ ^+ [l=a r=a]
196+ =< +
197+ |- ^+ a
198+ ?~ a
199+ [b ~ ~]
200+ ?: =(b n.a)
201+ a
202+ ?: (gor b n.a)
203+ =+ c=$(a l.a)
206204 ?> ?=(^ c)
207− c(l a(r l.c))
205+ c(r a(l r.c))
206+ =+ c=$(a r.a)
207+ ?> ?=(^ c)
208+ c(l a(r l.c))
208209```
209210
210211#### Examples
211212
212213```
213− > =a (sy `(list @)`[1 2 3 4 5 6 ~])
214− > a
215− [n=6 l={5 4} r={1 3 2}]
214+> =a `(set @)`(silt (gulf 1 20))
215+> a
216+{17 8 20 13 11 5 19 7 15 10 18 14 6 12 9 1 2 3 16 4}
216217
217− > (~(bif in a) 6)
218− [l=[n=4 l=[n=5 l={} r={}] r=~] r=[n=2 l=[n=1 l={} r={3}] r=~]]
218+> (~(bif in a) 10)
219+[l=[n=11 l={17 8 20 13} r={5 19 7 15}] r=[n=12 l={18 14 6} r={9 1 2 3 16 4}]]
219220
220− > (~(bif in a) 100)
221− [l=[n=6 l=[n=4 l={5} r={}] r=[n=2 l={1 3} r={}]] r=~]
221+> `[(set @) (set @)]`(~(bif in a) 10)
222+[{17 8 20 13 11 5 19 7 15} {18 14 6 12 9 1 2 3 16 4}]
222223```
223224
225+#### Discussion
226+
227+Note that `set`s are horizontally ordered by the [mug](/docs/hoon/reference/stdlib/2e#mug) hash of their items and vertically ordered by the double-`mug` hash of their items. This means bifurcating the set of numbers `(silt ~[10 20 30 40 50])` at `30` will not produce `[{10 20} {40 50}]`, but rather `[{20} {10 40 50}]` due to the tree structure resulting from their `mug` hashes.
228+
224229---
230+
225231### `++del:in`
226232
227233Remove noun
@@ -230,7 +236,7 @@ Removes `b` from the `set` `a`.
230236
231237#### Accepts
232238
233−`a` is a set.
239+`a` is a set, and is the sample of `+in`.
234240
235241`b` is a noun.
236242
@@ -241,41 +247,48 @@ A set.
241247#### Source
242248
243249```hoon
244− ++ del :: b without any a
245− ~/ %del
246− |* b=*
247− |- ^+ a
248− ?~ a
249− ~
250− ?. =(b n.a)
251− ?: (gor b n.a)
252− a(l $(a l.a))
253− a(r $(a r.a))
254− |- ^- [$?(~ _a)]
255− ?~ l.a r.a
256− ?~ r.a l.a
257− ?: (mor n.l.a n.r.a)
258− l.a(r $(l.a r.l.a))
259− r.a(l $(r.a l.r.a))
250+++ del
251+ ~/ %del
252+ |* b=*
253+ |- ^+ a
254+ ?~ a
255+ ~
256+ ?. =(b n.a)
257+ ?: (gor b n.a)
258+ a(l $(a l.a))
259+ a(r $(a r.a))
260+ |- ^- [$?(~ _a)]
261+ ?~ l.a r.a
262+ ?~ r.a l.a
263+ ?: (mor n.l.a n.r.a)
264+ l.a(r $(l.a r.l.a))
265+ r.a(l $(r.a l.r.a))
260266```
261267
262−
263268#### Examples
264269
265270```
266− > =b (sy `(list @t)`['a' 'b' 'c' ~])
267− > (~(del in b) 'a')
268− [n='b' l=[n='c' l={} r={}] r=~]
271+> `(set @)`(~(del in (silt ~[1 2 3 4 5])) 3)
272+{5 1 2 4}
273+```
269274
270− > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
271− > (~(del in b) 'john')
272− [n='madeleine' l=[n='daniel' l={} r={'bonita'}] r=~]
275+```
276+> `(set @t)`(~(del in (silt ~['foo' 'bar' 'baz'])) 'bar')
277+{'baz' 'foo'}
278+```
273279
274− > (~(del in b) 'susan')
275− [n='madeleine' l=[n='daniel' l={} r={'bonita'}] r=[n='john' l={} r={}]]
280+```
281+> `(set @)`(~(del in (silt ~[1 2 3 4 5])) 10)
282+{5 1 2 3 4}
283+```
284+
285+```
286+> `(set @)`(~(del in ~) 10)
287+{}
276288```
277289
278290---
291+
279292### `++dif:in`
280293
281294Difference
@@ -285,7 +298,7 @@ that are not in `b`.
285298
286299#### Accepts
287300
288−`a` is a set.
301+`a` is a set, and is the sample of `+in`.
289302
290303`b` is a set.
291304
@@ -296,46 +309,39 @@ A set.
296309#### Source
297310
298311```hoon
299− ++ dif :: difference
300− ~/ %dif
301− =+ b=a
302− |@
303− ++ $
304− |- ^+ a
305− ?~ b
306− a
307− =+ c=(bif n.b)
308− ?> ?=(^ c)
309− =+ d=$(a l.c, b l.b)
310− =+ e=$(a r.c, b r.b)
311− |- ^- [$?(~ _a)]
312− ?~ d e
313− ?~ e d
314− ?: (mor n.d n.e)
315− d(r $(d r.d))
316− e(l $(e l.e))
317− --
312+++ dif
313+ ~/ %dif
314+ =+ b=a
315+ |@
316+ ++ $
317+ |- ^+ a
318+ ?~ b
319+ a
320+ =+ c=(bif n.b)
321+ ?> ?=(^ c)
322+ =+ d=$(a l.c, b l.b)
323+ =+ e=$(a r.c, b r.b)
324+ |- ^- [$?(~ _a)]
325+ ?~ d e
326+ ?~ e d
327+ ?: (mor n.d n.e)
328+ d(r $(d r.d))
329+ e(l $(e l.e))
330+ --
318331```
319332
320333#### Examples
321334
322335```
323− > =c (sy 1 2 3 ~)
324− > =d (sy 2 3 4 ~)
325− > (~(dif in c) d)
326− [n=1 l=~ r=~]
336+> =a (silt ~[1 2 3 4 5])
337+> =b (silt ~[3 4])
327338
328− > (~(dif in d) c)
329− [n=4 l=~ r=~]
330−
331− > `(set @ud)`(~(dif in c) d)
332− {1}
333−
334− > `(set @ud)`(~(dif in d) c)
335− {4}
339+> `(set @)`(~(dif in a) b)
340+{5 1 2}
336341```
337342
338343---
344+
339345### `++dig:in`
340346
341347Address b in a
@@ -344,7 +350,7 @@ Produce the tree address of `b` within `a`.
344350
345351#### Accepts
346352
347−`a` is a set.
353+`a` is a set, and is the sample of `+in`.
348354
349355`b` is a noun.
350356
@@ -355,36 +361,36 @@ The `unit` of an atom.
355361#### Source
356362
357363```hoon
358− ++ dig :: axis of a in b
359− |= b=*
360− =+ c=1
361− |- ^- (unit @)
362− ?~ a ~
363− ?: =(b n.a) [~ u=(peg c 2)]
364− ?: (gor b n.a)
365− $(a l.a, c (peg c 6))
366− $(a r.a, c (peg c 7))
364+++ dig
365+ |= b=*
366+ =+ c=1
367+ |- ^- (unit @)
368+ ?~ a ~
369+ ?: =(b n.a) [~ u=(peg c 2)]
370+ ?: (gor b n.a)
371+ $(a l.a, c (peg c 6))
372+ $(a r.a, c (peg c 7))
367373```
368374
369−
370375#### Examples
371376
372377```
373− > =a (sy `(list @)`[1 2 3 4 5 6 7 ~])
374− > `(set @)`a
375− {5 4 7 6 1 3 2}
378+> =a (silt ~[1 2 3 4 5 6 7])
376379
377− > -.a
378− n=6
380+> -.a
381+n=6
379382
380− > (~(dig in a) 7)
381− [~ u=12]
383+> (~(dig in a) 7)
384+[~ 12]
382385
383− > (~(dig in a) 2)
384− [~ u=14]
386+> (~(dig in a) 2)
387+[~ 60]
385388
386− > (~(dig in a) 6)
387− [~ u=2]
389+> (~(dig in a) 6)
390+[~ 2]
391+
392+> (~(dig in a) 10)
393+~
388394```
389395
390396#### Discussion
@@ -392,6 +398,7 @@ The `unit` of an atom.
392398For more on the tree addressing system, see section [1b](/docs/hoon/reference/stdlib/1b).
393399
394400---
401+
395402### `++gas:in`
396403
397404Concatenate
@@ -400,7 +407,7 @@ Insert the elements of a `list` `b` into a `set` `a`.
400407
401408#### Accepts
402409
403−`a` is a set.
410+`a` is a set, and is the sample of `+in`.
404411
405412`b` is a list.
406413
@@ -411,31 +418,31 @@ A `set`.
411418#### Source
412419
413420```hoon
414− ++ gas :: concatenate
415− ~/ %gas
416− |= b=(list _?>(?=(^ a) n.a))
417− |- ^+ a
418− ?~ b
419− a
420− $(b t.b, a (put i.b))
421+++ gas
422+ ~/ %gas
423+ |= b=(list _?>(?=(^ a) n.a))
424+ |- ^+ a
425+ ?~ b
426+ a
427+ $(b t.b, a (put i.b))
421428```
422429
423430#### Examples
424431
425432```
426− > =b `(set @t)`(sy `(list @t)`['bonita' 'madeleine' 'rudolf' 'john' ~])
427− > b
428− {'bonita' 'madeleine' 'rudolf' 'john'}
433+> =a (silt ~['foo' 'bar' 'baz'])
434+> `(set @t)`a
435+{'bar' 'baz' 'foo'}
429436
430− > (~(gas in b) `(list @t)`['14' 'things' 'number' '1.337' ~])
431− [n='number' l={'1.337' '14'} r={'things' 'bonita' 'madeleine' 'rudolf' 'john'}]
437+> `(set @t)`(~(gas in a) ~['foo' 'foo' 'foo' 'foo'])
438+{'bar' 'baz' 'foo'}
432439
433− > =s (sy `(list @t)`['a' 'b' 'c' 'd' 'e' ~])
434− > (~(gas in s) `(list @t)`['1' '2' '3' ~])
435− [n='e' l=[n='1' l={} r={'3' '2'}] r=[n='b' l={'d' 'a' 'c'} r={}]]
440+> `(set @t)`(~(gas in a) ~['abc' 'xyz' '123'])
441+{'xyz' 'bar' 'baz' 'foo' 'abc' '123'}
436442```
437443
438444---
445+
439446### `++has:in`
440447
441448b in a?
@@ -444,7 +451,7 @@ Checks if `b` is an element of `a`, producing a flag.
444451
445452#### Accepts
446453
447−`a` is a set.
454+`a` is a set, and is the sample of `+in`.
448455
449456`b` is a noun.
450457
@@ -455,46 +462,37 @@ A flag.
455462#### Source
456463
457464```hoon
458− ++ has
459− ~/ %has
460− |* b=*
461− ^- ?
462− :: wrap extracted item type in a unit because bunting fails
463− ::
464− :: If we used the real item type of _?^(a n.a !!) as the sample type,
465− :: then hoon would bunt it to create the default sample for the gate.
466− ::
467− :: However, bunting that expression fails if :a is ~. If we wrap it
468− :: in a unit, the bunted unit doesn't include the bunted item type.
469− ::
470− :: This way we can ensure type safety of :b without needing to perform
471− :: this failing bunt. It's a hack.
472− ::
473− %. [~ b]
474− |= b=(unit _?>(?=(^ a) n.a))
475− => .(b ?>(?=(^ b) u.b))
476− |- ^- ?
477− ?~ a
478− |
479− ?: =(b n.a)
480− &
481− ?: (gor b n.a)
482− $(a l.a)
483− $(a r.a)
465+++ has
466+ ~/ %has
467+ |* b=*
468+ ^- ?
469+ %. [~ b]
470+ |= b=(unit _?>(?=(^ a) n.a))
471+ => .(b ?>(?=(^ b) u.b))
472+ |- ^- ?
473+ ?~ a
474+ |
475+ ?: =(b n.a)
476+ &
477+ ?: (gor b n.a)
478+ $(a l.a)
479+ $(a r.a)
484480```
485481
486482#### Examples
487483
488484```
489− > =a (~(gas in `(set @t)`~) `(list @t)`['a' 'b' 'c' ~])
490− > (~(has in a) 'a')
491− %.y
485+> =a (silt ~[1 2 3 4 5])
492486
493− > (~(has in a) 'z')
494− %.n
487+> (~(has in a) 2)
488+%.y
489+
490+> (~(has in a) 6)
491+%.n
495492```
496493
497494---
495+
498496### `++int:in`
499497
500498Intersection
@@ -504,7 +502,7 @@ Produces a set of the intersection between two sets of the same type,
504502
505503#### Accepts
506504
507−`a` is a set.
505+`a` is a set, and is the sample of `+in`.
508506
509507`b` is a set.
510508
@@ -515,41 +513,41 @@ A `set`.
515513#### Source
516514
517515```hoon
518− ++ int :: intersection
519− ~/ %int
520− =+ b=a
521− |@
522− ++ $
523− |- ^+ a
524− ?~ b
525− ~
526− ?~ a
527− ~
528− ?. (mor n.a n.b)
529− $(a b, b a)
530− ?: =(n.b n.a)
531− a(l $(a l.a, b l.b), r $(a r.a, b r.b))
532− ?: (gor n.b n.a)
533− %- uni(a $(a l.a, r.b ~)) $(b r.b)
534− %- uni(a $(a r.a, l.b ~)) $(b l.b)
535− --
516+++ int
517+ ~/ %int
518+ =+ b=a
519+ |@
520+ ++ $
521+ |- ^+ a
522+ ?~ b
523+ ~
524+ ?~ a
525+ ~
526+ ?. (mor n.a n.b)
527+ $(a b, b a)
528+ ?: =(n.b n.a)
529+ a(l $(a l.a, b l.b), r $(a r.a, b r.b))
530+ ?: (gor n.b n.a)
531+ %- uni(a $(a l.a, r.b ~)) $(b r.b)
532+ %- uni(a $(a r.a, l.b ~)) $(b l.b)
533+ --
536534```
537535
538−
539536#### Examples
540537
541538```
542− > (~(int in `(set @t)`(sy "acmo")) `(set @t)`(sy "ham"))
543− [n='m' l={'a'} r={}]
539+> `(set @tD)`(~(int in (silt "foobar")) (silt "bar"))
540+{'r' 'b' 'a'}
544541
545− > (~(int in (sy "acmo")) ~)
546− ~
542+> `(set @tD)`(~(int in (silt "foobar")) ~)
543+{}
547544
548− > (~(int in `(set @t)`(sy "ac")) `(set @t)`(sy "ha"))
549− [n='a' l={} r={}]
545+> `(set @tD)`(~(int in (silt "foobar")) (silt "baz"))
546+{'b' 'a'}
550547```
551548
552549---
550+
553551### `++put:in`
554552
555553Put b in a
@@ -558,7 +556,7 @@ Add an element `b` to the set `a`, producing a set.
558556
559557#### Accepts
560558
561−`a` is a set.
559+`a` is a set, and is the sample of `+in`.
562560
563561`b` is a noun.
564562
@@ -569,49 +567,48 @@ A `set`.
569567#### Source
570568
571569```hoon
572− ++ put :: puts b in a, sorted
573− ~/ %put
574− |* b=*
575− |- ^+ a
576− ?~ a
577− [b ~ ~]
578− ?: =(b n.a)
579− a
580− ?: (gor b n.a)
581− =+ c=$(a l.a)
582− ?> ?=(^ c)
583− ?: (mor n.a n.c)
584− a(l c)
585− c(r a(l r.c))
586− =+ c=$(a r.a)
570+++ put
571+ ~/ %put
572+ |* b=*
573+ |- ^+ a
574+ ?~ a
575+ [b ~ ~]
576+ ?: =(b n.a)
577+ a
578+ ?: (gor b n.a)
579+ =+ c=$(a l.a)
587580 ?> ?=(^ c)
588581 ?: (mor n.a n.c)
589− a(r c)
590− c(l a(r l.c))
582+ a(l c)
583+ c(r a(l r.c))
584+ =+ c=$(a r.a)
585+ ?> ?=(^ c)
586+ ?: (mor n.a n.c)
587+ a(r c)
588+ c(l a(r l.c))
591589```
592590
593591#### Examples
594592
595593```
596− > =a (~(gas in `(set @t)`~) `(list @t)`['a' 'b' 'c' ~])
597− > =b (~(put in a) 'd')
598− > `(set @t)`b
599− {'d' 'a' 'c' 'b'}
594+> `(set @)`(~(put in (silt ~[1 2 3])) 4)
595+{1 2 3 4}
600596
601− > -.l.+.b
602− n='d'
597+> `(set @)`(~(put in `(set @)`~) 42)
598+{42}
603599```
604600
605601---
602+
606603### `++rep:in`
607604
608605Accumulate
609606
610−Accumulate the elements of `a` using a gate `b`.
607+Accumulate the elements of `a` using binary gate `b`.
611608
612609#### Accepts
613610
614−`a` is a `set`.
611+`a` is a `set`, and is the sample of `+in`.
615612
616613`b` is a gate.
617614
@@ -622,26 +619,28 @@ A noun.
622619#### Source
623620
624621```hoon
625− ++ rep :: reduce to product
626− ~/ %rep
627− |* b=_=>(~ |=([* *] +<+))
628− |-
629− ?~ a +<+.b
630− $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
622+++ rep
623+ ~/ %rep
624+ |* b=_=>(~ |=([* *] +<+))
625+ |-
626+ ?~ a +<+.b
627+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
631628```
632629
633630#### Examples
634631
635632```
636− > =a (~(gas in *(set @)) [1 2 3 ~])
637− > `(set @)`a
638− {1 3 2}
633+> (~(rep in (silt ~[1 2 3 4 5])) add)
634+b=15
635+```
639636
640− > (~(rep in a) |=([a=@ b=@] (add a b)))
641− b=6
637+```
638+> `@t`(~(rep in (silt ~['foo' 'bar' 'baz'])) |=(a=[@ @] (cat 3 a)))
639+'foobarbaz'
642640```
643641
644642---
643+
645644### `++run:in`
646645
647646Apply gate to set
@@ -662,28 +661,29 @@ A set.
662661#### Source
663662
664663```hoon
665− ++ run :: apply gate to values
666− ~/ %run
667− |* b=gate
668− =+ c=`(set _?>(?=(^ a) (b n.a)))`~
669− |- ?~ a c
670− =. c (~(put in c) (b n.a))
671− =. c $(a l.a, c c)
672− $(a r.a, c c)
664+++ run
665+ ~/ %run
666+ |* b=gate
667+ =+ c=`(set _?>(?=(^ a) (b n.a)))`~
668+ |- ?~ a c
669+ =. c (~(put in c) (b n.a))
670+ =. c $(a l.a, c c)
671+ $(a r.a, c c)
673672```
674673
675674#### Examples
676675
677676```
678− > =s (sy ~["a" "A" "b" "c"])
679− > `(set tape)`s
680− {"A" "a" "c" "b"}
677+> =s (silt ~["a" "A" "b" "c"])
678+> `(set tape)`s
679+{"A" "a" "c" "b"}
681680
682− > (~(run in s) cuss)
683− {"A" "C" "B"}
681+> (~(run in s) cuss)
682+{"A" "C" "B"}
684683```
685684
686685---
686+
687687### `++tap:in`
688688
689689Set to list
@@ -701,29 +701,30 @@ A list.
701701#### Source
702702
703703```hoon
704− ++ tap :: convert to list
705− =< $
706− ~/ %tap
707− =+ b=`(list _?>(?=(^ a) n.a))`~
708− |. ^+ b
709− ?~ a
710− b
711− $(a r.a, b [n.a $(a l.a)])
704+++ tap
705+ =< $
706+ ~/ %tap
707+ =+ b=`(list _?>(?=(^ a) n.a))`~
708+ |. ^+ b
709+ ?~ a
710+ b
711+ $(a r.a, b [n.a $(a l.a)])
712712```
713713
714−
715714#### Examples
716715
717716```
718− > =s (sy `(list @t)`['a' 'b' 'c' 'd' 'e' ~])
719− > s
720− [n='e' l={} r={'d' 'a' 'c' 'b'}]
717+> ~(tap in (silt "foobar"))
718+"oafbr"
719+```
721720
722− > ~(tap in s)
723− ~['b' 'c' 'a' 'd' 'e']
721+```
722+> ~(tap in (silt ~[1 2 3 4 5]))
723+~[4 3 2 1 5]
724724```
725725
726726---
727+
727728### `++uni:in`
728729
729730Union
@@ -733,7 +734,7 @@ Produces a set of the union between two sets of the same type, `a` and
733734
734735#### Accepts
735736
736−`a` is a set.
737+`a` is a set, and is the sample of `+in`.
737738
738739`b` is a set.
739740
@@ -744,47 +745,47 @@ A set.
744745#### Source
745746
746747```hoon
747− ++ uni :: union
748− ~/ %uni
749− =+ b=a
750− |@
751− ++ $
752− ?: =(a b) a
753− |- ^+ a
754− ?~ b
755− a
756− ?~ a
757− b
758− ?: =(n.b n.a)
759− b(l $(a l.a, b l.b), r $(a r.a, b r.b))
760− ?: (mor n.a n.b)
761− ?: (gor n.b n.a)
762− $(l.a $(a l.a, r.b ~), b r.b)
763− $(r.a $(a r.a, l.b ~), b l.b)
764− ?: (gor n.a n.b)
765− $(l.b $(b l.b, r.a ~), a r.a)
766− $(r.b $(b r.b, l.a ~), a l.a)
767− --
748+++ uni
749+ ~/ %uni
750+ =+ b=a
751+ |@
752+ ++ $
753+ ?: =(a b) a
754+ |- ^+ a
755+ ?~ b
756+ a
757+ ?~ a
758+ b
759+ ?: =(n.b n.a)
760+ b(l $(a l.a, b l.b), r $(a r.a, b r.b))
761+ ?: (mor n.a n.b)
762+ ?: (gor n.b n.a)
763+ $(l.a $(a l.a, r.b ~), b r.b)
764+ $(r.a $(a r.a, l.b ~), b l.b)
765+ ?: (gor n.a n.b)
766+ $(l.b $(b l.b, r.a ~), a r.a)
767+ $(r.b $(b r.b, l.a ~), a l.a)
768+ --
768769```
769770
770−
771771#### Examples
772772
773773```
774− > (~(uni in `(set @t)`(sy "ac")) `(set @)`(sy "ha"))
775− [n='c' l={'a'} r={'h'}]
774+> =a (silt ~[1 2 3 4 5])
775+> =b (silt ~[4 5 6 7 8])
776776
777− > (~(uni in `(set @t)`(sy "acmo")) ~)
778− [n='c' l={'a'} r={'m' 'o'}]
777+> `(set @)`(~(uni in a) b)
778+{8 5 7 6 1 2 3 4}
779779
780− > (~(uni in `(set @t)`(sy "acmo")) `(set @t)`(sy "ham"))
781− [n='c' l={'a'} r={'m' 'o' 'h'}]
780+> `(set @)`(~(uni in a) ~)
781+{5 1 2 3 4}
782782
783− > (~(uni in `(set @t)`(sy "acmo")) `(set @t)`(sy "lep"))
784− [n='e' l={} r={'a' 'c' 'm' 'l' 'o' 'p'}]
783+> `(set @)`(~(uni in `(set @)`~) b)
784+{8 5 7 6 4}
785785```
786786
787787---
788+
788789### `++wyt:in`
789790
790791Set size
@@ -802,25 +803,24 @@ An atom.
802803#### Source
803804
804805```hoon
805− ++ wyt :: size of set
806− =< $
807− ~% %wyt + ~
808− |. ^- @
809− ?~(a 0 +((add $(a l.a) $(a r.a))))
810− --
806+++ wyt
807+ =< $
808+ ~% %wyt + ~
809+ |. ^- @
810+ ?~(a 0 +((add $(a l.a) $(a r.a))))
811+--
811812```
812813
813−
814814#### Examples
815815
816816```
817− > =a (~(put in (~(put in (sy)) 'a')) 'b')
818− > ~(wyt in a)
819− 2
817+> ~(wyt in (silt ~[1 2 3 4]))
818+4
819+```
820820
821− > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
822− > ~(wyt in b)
823− 4
821+```
822+> ~(wyt in `(set @)`~)
823+0
824824```
825825
826826---
content/docs/hoon/reference/stdlib/2i.md+720−436
@@ -4,44 +4,47 @@ weight = 12
44template = "doc.html"
55+++
66
7−### `++by`
7+## `++by`
88
99Map operations
1010
1111Container arm for map operation arms. A map is a set of key-value pairs. The
1212contained arms inherit its sample map, `a`.
1313
14−### Accepts
14+#### Accepts
1515
1616`a` is a map.
1717
1818#### Source
1919
2020```hoon
21− ++ by
22− ~/ %by
23− =| a=(tree (pair))
24− =* node ?>(?=(^ a) n.a)
21+++ by
22+ ~/ %by
23+ =| a=(tree (pair)) :: (map)
24+ =* node ?>(?=(^ a) n.a)
25+ |@
2526```
2627
2728#### Examples
2829
2930```
30− > ~(. by (my [%a 1] [%b 2] ~))
31− < 27.zjr
32− { a
33− ?(
34− { n/{?(p/$a p/$b) q/@ud}
35− l/nlr({p/?($b $a) q/@ud})
36− r/nlr({p/?($b $a) q/@ud})
37− }
38− $~
39− )
40− <119.wim 31.ohr 1.jmk $143>
41− }
31+> ~(. by (malt (limo ~[a+1 b+2 c+3])))
32+< 27.jus
33+ [ a
34+ ?(
35+ %~
36+ [ n=[?(p=%a p=%b p=%c) q=@ud]
37+ l=nlr([p=?(%a %b %c) q=@ud])
38+ r=nlr([p=?(%a %b %c) q=@ud])
39+ ]
40+ )
41+ <123.zao 46.hgz 1.pnw %140>
42+ ]
43+>
4244```
4345
4446---
47+
4548### `++all:by`
4649
4750Logical AND
@@ -51,9 +54,9 @@ with gate `b`.
5154
5255#### Accepts
5356
54−`a` is a map.
57+`a` is a map, and is the sample of `+by`.
5558
56−`b` is a wet gate.
59+`b` is a gate.
5760
5861#### Produces
5962
@@ -62,31 +65,36 @@ A flag.
6265#### Source
6366
6467```hoon
65− ++ all :: logical AND
66− ~/ %all
67− |* b=$-(* ?)
68− |- ^- ?
69− ?~ a
70− &
71− ?&((b n.a) $(a l.a) $(a r.a))
68+++ all
69+ ~/ %all
70+ |* b=$-(* ?)
71+ |- ^- ?
72+ ?~ a
73+ &
74+ ?&((b q.n.a) $(a l.a) $(a r.a))
7275```
7376
7477#### Examples
7578
7679```
77− > =b (my [['a' 1] ['b' [2 3]] ~])
78− > (~(all by b) |=(a=* ?@(a & |)))
79− %.n
80+> =a (malt (limo ~[a+1 b+[2 3]]))
8081
81− > =a (my [['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
82− > (~(all by a) |=(a=@ (lte a 6)))
83− %.y
82+> (~(all by a) |=(a=* ?@(a & |)))
83+%.n
84+```
8485
85− > (~(all by a) |=(a=@ (lte a 4)))
86− %.n
86+```
87+> =a (malt (limo ~[a+1 b+2 c+3 d+4 e+5]))
88+
89+> (~(all by a) |=(a=@ (lte a 6)))
90+%.y
91+
92+> (~(all by a) |=(a=@ (lte a 4)))
93+%.n
8794```
8895
8996---
97+
9098### `++any:by`
9199
92100Logical OR
@@ -96,7 +104,7 @@ gate `b`.
96104
97105#### Accepts
98106
99−`a` is a map.
107+`a` is a map, and is the sample of `+by`.
100108
101109`b` is a wet gate.
102110
@@ -107,28 +115,33 @@ A flag.
107115#### Source
108116
109117```hoon
110− ++ any :: logical OR
111− ~/ %any
112− |* b=$-(* ?)
113− |- ^- ?
114− ?~ a
115− |
116− ?|((b q.n.a) $(a l.a) $(a r.a))
118+++ any
119+ ~/ %any
120+ |* b=$-(* ?)
121+ |- ^- ?
122+ ?~ a
123+ |
124+ ?|((b q.n.a) $(a l.a) $(a r.a))
117125```
118126
119127#### Examples
120128
121129```
122− > =b (my [['a' 1] ['b' [2 3]] ~])
123− > (~(any by b) |=(a=* ?@(a & |)))
124− %.y
130+> =a (malt (limo ~[a+1 b+[2 3]]))
125131
126− > =a (my [['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
127− > (~(any by a) |=(a=@ (lte a 4)))
128− %.y
132+> (~(any by a) |=(a=* ?@(a & |)))
133+%.y
134+```
135+
136+```
137+> =a (malt (limo ~[a+1 b+2 c+3 d+4 e+5]))
138+
139+> (~(any by a) |=(a=@ (lte a 4)))
140+%.y
129141```
130142
131143---
144+
132145### `++apt:by`
133146
134147Check correctness
@@ -147,35 +160,36 @@ A flag.
147160#### Source
148161
149162```hoon
150− ++ apt :: check correctness
151− =< $
152− ~/ %apt
153− =| [l=(unit) r=(unit)]
154− |. ^- ?
155− ?~ a &
156− ?& ?~(l & &((gor p.n.a u.l) !=(p.n.a u.l)))
157− ?~(r & &((gor u.r p.n.a) !=(u.r p.n.a)))
158− ?~ l.a &
159− &((mor p.n.a p.n.l.a) !=(p.n.a p.n.l.a) $(a l.a, l `p.n.a))
160− ?~ r.a &
161− &((mor p.n.a p.n.r.a) !=(p.n.a p.n.r.a) $(a r.a, r `p.n.a))
162− ==
163+++ apt
164+ =< $
165+ ~/ %apt
166+ =| [l=(unit) r=(unit)]
167+ |. ^- ?
168+ ?~ a &
169+ ?& ?~(l & &((gor p.n.a u.l) !=(p.n.a u.l)))
170+ ?~(r & &((gor u.r p.n.a) !=(u.r p.n.a)))
171+ ?~ l.a &
172+ &((mor p.n.a p.n.l.a) !=(p.n.a p.n.l.a) $(a l.a, l `p.n.a))
173+ ?~ r.a &
174+ &((mor p.n.a p.n.r.a) !=(p.n.a p.n.r.a) $(a r.a, r `p.n.a))
175+ ==
163176```
164177
165178#### Examples
166179
167180```
168− > =a (my [['a' 1] ['b' [2 3]] ~])
169− > ~(apt by a)
170− %.y
181+> =a (malt `(list [@tas @])`~[a+1 b+2 c+3 d+4 e+5])
182+
183+> ~(apt by a)
184+%.y
185+
186+> =z ?~(a ~ a(p.n `@tas`%z))
171187
172− > =s (my [[1 2] [3 4] ~])
173− > =z ?~ s ~ s(p.n 10)
174− > z
175− [n=[p=10 q=2] l={} r={[p=3 q=4]}]
188+> z
189+[n=[p=%z q=2] l={[p=%e q=5]} r={[p=%d q=4] [p=%a q=1] [p=%c q=3]}]
176190
177− > ~(apt by z)
178− %.n
191+> ~(apt by z)
192+%.n
179193```
180194
181195#### Discussion
@@ -186,11 +200,11 @@ See section [`2f`](/docs/hoon/reference/stdlib/2f) for more information on noun
186200
187201Bifurcate
188202
189−Splits map `a` into two maps `l` and `r`, with the head at `b` discarded.
203+Splits map `a` into two maps `l` and `r`, which contain the items either side of key `b` with value `c` but not including `b`-`c`.
190204
191205#### Accepts
192206
193−`a` is a map.
207+`a` is a map, and is the sample of `+by`.
194208
195209`b` is a noun.
196210
@@ -203,38 +217,45 @@ A cell of two maps.
203217#### Source
204218
205219```hoon
206− ++ bif :: splits a by b
207− ~/ %bif
208− |* [b=* c=*]
209− ^+ [l=a r=a]
210− =< +
211− |- ^+ a
212− ?~ a
213− [[b c] ~ ~]
214− ?: =(b p.n.a)
215− ?: =(c q.n.a)
216− a
217− a(n [b c])
218− ?: (gor b p.n.a)
219− =+ d=$(a l.a)
220− ?> ?=(^ d)
221− d(r a(l r.d))
222− =+ d=$(a r.a)
220+++ bif
221+ ~/ %bif
222+ |* [b=* c=*]
223+ ^+ [l=a r=a]
224+ =< +
225+ |- ^+ a
226+ ?~ a
227+ [[b c] ~ ~]
228+ ?: =(b p.n.a)
229+ ?: =(c q.n.a)
230+ a
231+ a(n [b c])
232+ ?: (gor b p.n.a)
233+ =+ d=$(a l.a)
223234 ?> ?=(^ d)
224− d(l a(r l.d))
235+ d(r a(l r.d))
236+ =+ d=$(a r.a)
237+ ?> ?=(^ d)
238+ d(l a(r l.d))
225239```
226240
227241#### Examples
228242
229243```
230− > =a (my [['a' 1] ['b' 2] ['c' 3] ~])
244+> =a (malt `(list [@tas @])`~[a+1 b+2 c+3 d+4 e+5])
231245
232− > (~(bif by a) ['b' 2])
233− [l=[n=[p='c' q=3] l=[n=[p='a' q=1] l={} r={}] r=~] r=~]
246+> (~(bif by a) b+2)
247+[l=[n=[p=%e q=5] l=~ r=~] r=[n=[p=%d q=4] l=~ r=[n=[p=%c q=3] l={[p=%a q=1]} r={}]]]
248+
249+> `[(map @tas @) (map @tas @)]`(~(bif by a) b+2)
250+[{[p=%e q=5]} {[p=%d q=4] [p=%a q=1] [p=%c q=3]}]
234251```
235252
253+#### Discussion
254+
255+Note that `map`s are horizontally ordered by the [mug](/docs/hoon/reference/stdlib/2e#mug) hash of their keys and vertically ordered by the double-`mug` hash of their keys. This means bifurcating the map `(malt ~[10^10 20^20 30^30 40^40 50^50])` at `30^30` will not produce `[{10^10 20^20} {40^40 50^50}]`, but rather `[{20^20} {10^10 40^40 50^50}]` due to the tree structure resulting from their `mug` hashes.
236256
237257---
258+
238259### `++del:by`
239260
240261Delete
@@ -243,7 +264,7 @@ Produces map `a` with the element located at key `b` removed.
243264
244265#### Accepts
245266
246−`a` is a map.
267+`a` is a map, and is the sample of `+by`.
247268
248269`b` is a key as a noun.
249270
@@ -254,33 +275,112 @@ A map.
254275#### Source
255276
256277```hoon
257− ++ del :: delete at key b
258− ~/ %del
259− |* b=*
278+++ del
279+ ~/ %del
280+ |* b=*
281+ |- ^+ a
282+ ?~ a
283+ ~
284+ ?. =(b p.n.a)
285+ ?: (gor b p.n.a)
286+ a(l $(a l.a))
287+ a(r $(a r.a))
288+ |- ^- [$?(~ _a)]
289+ ?~ l.a r.a
290+ ?~ r.a l.a
291+ ?: (mor p.n.l.a p.n.r.a)
292+ l.a(r $(l.a r.l.a))
293+ r.a(l $(r.a l.r.a))
294+```
295+
296+#### Examples
297+
298+```
299+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
300+> a
301+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
302+
303+> `(map @tas @)`(~(del by a) %z)
304+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
305+
306+> `(map @tas @)`(~(del by a) %b)
307+{[p=%d q=4] [p=%a q=1] [p=%c q=3]}
308+```
309+
310+---
311+
312+### `++dif:by`
313+
314+Difference
315+
316+Computes the difference between `a` and `b`, producing the map of key-value pairs in `a` whose keys are not in `b`.
317+
318+#### Accepts
319+
320+`a` is a `map`, and is the sample of `+by`.
321+
322+`b` is a `map`.
323+
324+#### Produces
325+
326+A `map`.
327+
328+#### Source
329+
330+```hoon
331+++ dif
332+ ~/ %dif
333+ =+ b=a
334+ |@
335+ ++ $
260336 |- ^+ a
261− ?~ a
262− ~
263− ?. =(b p.n.a)
264− ?: (gor b p.n.a)
265− a(l $(a l.a))
266− a(r $(a r.a))
337+ ?~ b
338+ a
339+ =+ c=(bif p.n.b q.n.b)
340+ ?> ?=(^ c)
341+ =+ d=$(a l.c, b l.b)
342+ =+ e=$(a r.c, b r.b)
267343 |- ^- [$?(~ _a)]
268− ?~ l.a r.a
269− ?~ r.a l.a
270− ?: (mor p.n.l.a p.n.r.a)
271− l.a(r $(l.a r.l.a))
272− r.a(l $(r.a l.r.a))
344+ ?~ d e
345+ ?~ e d
346+ ?: (mor p.n.d p.n.e)
347+ d(r $(d r.d))
348+ e(l $(e l.e))
349+ --
273350```
274351
275352#### Examples
276353
277354```
278− > =b (my [['a' 1] ['b' [2 3]] ~])
279− > (~(del by b) 'a')
280− [n=[p='b' q=[2 3]] l=~ r=~]
355+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
356+> =b `(map @tas @)`(malt (limo ~[c+3 d+4 e+5 f+6]))
357+> a
358+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
359+> b
360+{[p=%e q=5] [p=%d q=4] [p=%f q=6] [p=%c q=3]}
361+
362+> `(map @tas @)`(~(dif by a) b)
363+{[p=%b q=2] [p=%a q=1]}
364+```
365+
366+```
367+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
368+> =b `(map @tas @)`(malt (limo ~[a+2 e+4 f+5]))
369+> a
370+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
371+> b
372+{[p=%e q=4] [p=%f q=5] [p=%a q=2]}
373+
374+> `(map @tas @)`(~(dif by a) b)
375+{[p=%b q=2] [p=%d q=4] [p=%c q=3]}
281376```
282377
378+#### Discussion
379+
380+This only compares keys, so if both maps contain the same key with different values, that key-value pair is not considered a difference and will not be included in the resulting map.
381+
283382---
383+
284384### `++dig:by`
285385
286386Address of key
@@ -289,7 +389,7 @@ Produce the address of key `b` within map `a`.
289389
290390#### Accepts
291391
292−`a` is a map.
392+`a` is a map, and is the sample of `+by`.
293393
294394`b` is a key as a noun.
295395
@@ -300,35 +400,43 @@ A unit.
300400#### Source
301401
302402```hoon
303− ++ dig :: axis of b key
304− |= b=*
305− =+ c=1
306− |- ^- (unit @)
307− ?~ a ~
308− ?: =(b p.n.a) [~ u=(peg c 2)]
309− ?: (gor b p.n.a)
310− $(a l.a, c (peg c 6))
311− $(a r.a, c (peg c 7))
403+++ dig
404+ |= b=*
405+ =+ c=1
406+ |- ^- (unit @)
407+ ?~ a ~
408+ ?: =(b p.n.a) [~ u=(peg c 2)]
409+ ?: (gor b p.n.a)
410+ $(a l.a, c (peg c 6))
411+ $(a r.a, c (peg c 7))
312412```
313413
314414#### Examples
315415
316416```
317− > =b (my [['a' 1] ['b' [2 3]] ~])
318− > (~(dig by b) 'b')
319− [~ u=2]
417+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
418+
419+> (~(dig by a) %a)
420+[~ 252]
421+
422+> (~(dig by a) %b)
423+[~ 2]
424+
425+> (~(dig by a) %e)
426+~
320427```
321428
322429---
430+
323431### `++gas:by`
324432
325433Concatenate
326434
327−Insert a list of key-value pairs `b` into map `a`.
435+Insert a list of key-value pairs `b` into map `a`. For a key which exists in both `a` and `b`, the value is replaced with the value in `b`.
328436
329437#### Accepts
330438
331−`a` is a map.
439+`a` is a map, and is the sample of `+by`.
332440
333441`b` is a list of cells of key-value nouns `p` and `q`.
334442
@@ -339,27 +447,43 @@ A map.
339447#### Source
340448
341449```hoon
342− ++ gas :: concatenate
343− ~/ %gas
344− |* b=(list [p=* q=*])
345− => .(b `(list _?>(?=(^ a) n.a))`b)
346− |- ^+ a
347− ?~ b
348− a
349− $(b t.b, a (put p.i.b q.i.b))
450+++ gas
451+ ~/ %gas
452+ |* b=(list [p=* q=*])
453+ => .(b `(list _?>(?=(^ a) n.a))`b)
454+ |- ^+ a
455+ ?~ b
456+ a
457+ $(b t.b, a (put p.i.b q.i.b))
350458```
351459
352460#### Examples
353461
354462```
355− > =a (my [['a' 1] ['b' 2] ~])
356− > =b [['c' 3] ['d' 4] ~]
463+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
464+> a
465+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
357466
358− > (~(gas by a) b)
359− [n=[p='b' q=2] l=[n=[p='d' q=4] l={} r={[p='a' q=1] [p='c' q=3]}] r=~]
467+> `(map @tas @)`(~(gas by a) ~[e+5 f+6 g+7])
468+{[p=%e q=5] [p=%b q=2] [p=%d q=4] [p=%f q=6] [p=%g q=7] [p=%a q=1] [p=%c q=3]}
469+```
470+
471+```
472+> =a `(map @tas @)`(malt (limo ~[a+1 b+2]))
473+> a
474+{[p=%b q=2] [p=%a q=1]}
475+
476+> `(map @tas @)`(~(gas by a) ~[a+100 b+200])
477+{[p=%b q=200] [p=%a q=100]}
478+```
479+
480+```
481+> `(map @tas @)`(~(gas by `(map @tas @)`~) ~[a+100 b+200])
482+{[p=%b q=200] [p=%a q=100]}
360483```
361484
362485---
486+
363487### `++get:by`
364488
365489Grab unit value
@@ -368,7 +492,7 @@ Produce the unit value of the value located at key `b` within map `a`.
368492
369493#### Accepts
370494
371−`a` is a map.
495+`a` is a map, and is the sample of `+by`.
372496
373497`b` is a key as a noun.
374498
@@ -379,34 +503,38 @@ A unit.
379503#### Source
380504
381505```hoon
382− ++ get :: grab value by key
383− ~/ %get
384− |* b=*
385− => .(b `_?>(?=(^ a) p.n.a)`b)
386− |- ^- (unit _?>(?=(^ a) q.n.a))
387− ?~ a
388− ~
389− ?: =(b p.n.a)
390− (some q.n.a)
391− ?: (gor b p.n.a)
392− $(a l.a)
393− $(a r.a)
506+++ get
507+ ~/ %get
508+ |* b=*
509+ => .(b `_?>(?=(^ a) p.n.a)`b)
510+ |- ^- (unit _?>(?=(^ a) q.n.a))
511+ ?~ a
512+ ~
513+ ?: =(b p.n.a)
514+ (some q.n.a)
515+ ?: (gor b p.n.a)
516+ $(a l.a)
517+ $(a r.a)
394518```
395519
396520#### Examples
397521
398522```
399− > =b (my [['a' 1] ['b' [2 3]] ~])
400− > (~(get by b) 'b')
401− [~ u=[2 3]]
523+> a
524+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
525+
526+> (~(get by a) %a)
527+[~ 1]
402528
529+> (~(get by a) %b)
530+[~ 2]
403531
404− > =m (my [['a' 1] ['b' 2] ~])
405− > (~(get by m) 'a')
406− [~ u=1]
532+> (~(get by a) %z)
533+~
407534```
408535
409536---
537+
410538### `++got:by`
411539
412540Assert
@@ -416,7 +544,7 @@ exist.
416544
417545#### Accepts
418546
419−`a` is a map.
547+`a` is a map, and is the sample of `+by`.
420548
421549`b` is a key as a noun.
422550
@@ -424,29 +552,33 @@ exist.
424552
425553A noun.
426554
427−#### Source
555+#### Source
428556
429557```hoon
430− ++ got :: need value by key
431− |* b=*
432− (need (get b))
558+++ got
559+ |* b=*
560+ (need (get b))
433561```
434562
435563#### Examples
436564
437565```
438− > =m (my [['a' 1] ['b' 2] ~])
439− > m
440− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
566+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
567+> a
568+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
569+
570+> (~(got by a) %a)
571+1
441572
442− > (~(got by m) 'a')
443− 1
573+> (~(got by a) %b)
574+2
444575
445− > (~(got by m) 'c')
446− ! exit
576+> (~(got by a) %z)
577+dojo: hoon expression failed
447578```
448579
449580---
581+
450582### `++gut:by`
451583
452584Grab value with default
@@ -456,7 +588,7 @@ key does not exist.
456588
457589#### Accepts
458590
459−`a` is a map.
591+`a` is a map, and is the sample of `+by`.
460592
461593`b` is a key as a noun.
462594
@@ -469,27 +601,30 @@ A noun.
469601#### Source
470602
471603```hoon
472− ++ gut :: fall value by key
473− |* [b=* c=*]
474− (fall (get b) c)
475−
604+++ gut
605+ |* [b=* c=*]
606+ (fall (get b) c)
476607```
477608
478609#### Examples
479610
480611```
481− > =m (my [['a' 1] ['b' 2] ~])
482− > m
483− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
612+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
613+> a
614+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
484615
485− > (~(gut by m) 'a' 0)
486− 1
616+> (~(gut by a) %a 9.999)
617+1
487618
488− > (~(gut by m) 'c' 0)
489− 0
619+> (~(gut by a) %b 9.999)
620+2
621+
622+> (~(gut by a) %z 9.999)
623+9.999
490624```
491625
492626---
627+
493628### `++has:by`
494629
495630Key existence check
@@ -498,7 +633,7 @@ Checks whether map `a` contains an element with key `b`, producing a flag.
498633
499634#### Accepts
500635
501−`a` is a map.
636+`a` is a map, and is the sample of `+by`.
502637
503638`b` is a key as a noun.
504639
@@ -509,24 +644,27 @@ A flag.
509644#### Source
510645
511646```hoon
512− ++ has :: key existence check
513− ~/ %has
514− |* b=*
515− !=(~ (get b))
647+++ has
648+ ~/ %has
649+ |* b=*
650+ !=(~ (get b))
516651```
517652
518653#### Examples
519654
520655```
521− > =b (my [['a' 1] ['b' [2 3]] ~])
522− > (~(has by b) 'b')
523− %.y
656+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
657+> a
658+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
524659
525− > (~(has by b) 'c')
526− %.n
660+> (~(has by a) %a)
661+%.y
662+> (~(has by a) %z)
663+%.n
527664```
528665
529666---
667+
530668### `++int:by`
531669
532670Intersection
@@ -537,7 +675,7 @@ element from map `b` is used.
537675
538676#### Accepts
539677
540−`a` is a map.
678+`a` is a map, and is the sample of `+by`.
541679
542680`b` is a map.
543681
@@ -548,54 +686,113 @@ A map.
548686#### Source
549687
550688```hoon
551− ++ int :: intersection
552− ~/ %int
553− =+ b=a
554− |@
555− ++ $
556− |- ^+ a
557− ?~ b
558− ~
559− ?~ a
560− ~
561− ?: (mor p.n.a p.n.b)
562− ?: =(p.n.b p.n.a)
563− b(l $(a l.a, b l.b), r $(a r.a, b r.b))
564− ?: (gor p.n.b p.n.a)
565− %- uni(a $(a l.a, r.b ~)) $(b r.b)
566− %- uni(a $(a r.a, l.b ~)) $(b l.b)
567− ?: =(p.n.a p.n.b)
568− b(l $(b l.b, a l.a), r $(b r.b, a r.a))
569− ?: (gor p.n.a p.n.b)
570− %- uni(a $(b l.b, r.a ~)) $(a r.a)
571− %- uni(a $(b r.b, l.a ~)) $(a l.a)
572− --
689+++ int
690+ ~/ %int
691+ =+ b=a
692+ |@
693+ ++ $
694+ |- ^+ a
695+ ?~ b
696+ ~
697+ ?~ a
698+ ~
699+ ?: (mor p.n.a p.n.b)
700+ ?: =(p.n.b p.n.a)
701+ b(l $(a l.a, b l.b), r $(a r.a, b r.b))
702+ ?: (gor p.n.b p.n.a)
703+ %- uni(a $(a l.a, r.b ~)) $(b r.b)
704+ %- uni(a $(a r.a, l.b ~)) $(b l.b)
705+ ?: =(p.n.a p.n.b)
706+ b(l $(b l.b, a l.a), r $(b r.b, a r.a))
707+ ?: (gor p.n.a p.n.b)
708+ %- uni(a $(b l.b, r.a ~)) $(a r.a)
709+ %- uni(a $(b r.b, l.a ~)) $(a l.a)
710+ --
573711```
574712
575713#### Examples
576714
577715```
578− > =n (my [['a' 1] ['c' 3] ~])
579− > =m (my [['a' 1] ['b' 2] ~])
716+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
717+> =b `(map @tas @)`(malt (limo ~[c+3 d+4 e+5 f+6]))
718+> a
719+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
720+> b
721+{[p=%e q=5] [p=%d q=4] [p=%f q=6] [p=%c q=3]}
722+
723+> `(map @tas @)`(~(int by a) b)
724+{[p=%d q=4] [p=%c q=3]}
725+```
580726
581− > (~(int by m) n)
582− [n=[p='a' q=1] l=~ r=~]
727+```
728+> =a `(map @tas @)`(malt (limo ~[a+1 b+2]))
729+> =b `(map @tas @)`(malt (limo ~[a+100 b+200]))
730+> a
731+{[p=%b q=2] [p=%a q=1]}
732+> b
733+{[p=%b q=200] [p=%a q=100]}
583734
584− > =p (my [['a' 2] ['b' 2] ~])
585− > p
586− [n=[p='b' q=2] l={[p='a' q=2]} r={}]
587− > (~(int by p) n)
588− [n=[p='a' q=1] l=~ r=~]
735+> `(map @tas @)`(~(int by a) b)
736+{[p=%b q=200] [p=%a q=100]}
737+```
589738
590− > =q (my [['a' 2] ['c' 2] ~])
591− > q
592− [n=[p='c' q=2] l={[p='a' q=2]} r={}]
593− > (~(int by p) q)
594− [n=[p='a' q=2] l=~ r=~]
739+---
740+
741+### `++jab:by`
742+
743+Transform value
744+
745+Produce map `a` with the value at key `b` transformed by gate `c`.
746+
747+#### Accepts
748+
749+`a` is a `map`, and is the sample of `+by`.
750+
751+`b` is a noun, and a key in `a`.
752+
753+`c` is a `gate`.
754+
755+#### Produces
756+
757+A `map`.
758+
759+#### Source
760+
761+```hoon
762+++ jab
763+ ~/ %jab
764+ |* [key=_?>(?=(^ a) p.n.a) fun=$-(_?>(?=(^ a) q.n.a) _?>(?=(^ a) q.n.a))]
765+ ^+ a
766+ ::
767+ ?~ a !!
768+ ::
769+ ?: =(key p.n.a)
770+ a(q.n (fun q.n.a))
771+ ::
772+ ?: (gor key p.n.a)
773+ a(l $(a l.a))
774+ ::
775+ a(r $(a r.a))
776+```
777+
778+#### Examples
595779
596− > =o (my [['c' 3] ['d' 4] ~])
597− > (~(int by m) o)
598− ~
780+```
781+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
782+> a
783+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
784+
785+> `(map @tas @)`(~(jab by a) %d |=(x=@ (pow x 2)))
786+{[p=%b q=2] [p=%d q=16] [p=%a q=1] [p=%c q=3]}
787+
788+> (~(jab by a) %z |=(x=@ (pow x 2)))
789+dojo: hoon expression failed
790+
791+> (~(jab by a) %d |=(a=@ [a a]))
792+-need.?(%~ [n=[p=@tas q=@] l=nlr([p=@tas q=@]) r=nlr([p=@tas q=@])])
793+-have.[n=[p=@tas q=[@ @]] l=nlr([p=@tas q=@]) r=nlr([p=@tas q=@])]
794+nest-fail
795+dojo: hoon expression failed
599796```
600797
601798---
@@ -604,14 +801,11 @@ A map.
604801
605802Set of keys
606803
607−Produces a set of all keys in map `a` that is prepended to set `b`,
608−which is empty by default.
804+Produces a set of all keys in map `a`.
609805
610806#### Accepts
611807
612−`a` is a map.
613−
614−`b` is a set.
808+`a` is a map, and is the sample of `+by`.
615809
616810#### Produces
617811
@@ -621,8 +815,10 @@ A set.
621815
622816```hoon
623817++ key
818+ =< $
819+ ~/ %key
624820 =+ b=`(set _?>(?=(^ a) p.n.a))`~
625− |- ^+ b
821+ |. ^+ b
626822 ?~ a b
627823 $(a r.a, b $(a l.a, b (~(put in b) p.n.a)))
628824```
@@ -630,20 +826,19 @@ A set.
630826#### Examples
631827
632828```
633− > =m (my [['a' 1] ['b' 2] ~])
634− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
829+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
635830
636− > ~(key by m)
637− {'b' 'a'}
831+> ~(key by a)
832+{%b %d %a %c}
638833```
639834
640835---
641836
642837### `++mar:by`
643838
644−Assert and add
839+Add with validation
645840
646−Produces map `a` with the addition of a key-value pair, where the value is a
841+Produces map `a` with the addition of key-value pair `b` and `c`, where the value is a
647842nonempty unit.
648843
649844Accept a noun and a unit of a noun of the type of the map's keys and values,
@@ -652,39 +847,45 @@ If the value is null, delete the key.
652847
653848#### Accepts
654849
655−`a` is a map.
850+`a` is a `map`, and is the sample of `+by`.
851+
852+`b` is a noun.
656853
657−`b` is a unit.
854+`c` is a `unit`.
658855
659856#### Produces
660857
661858A map.
662859
663−#### Assert and Add
860+#### Source
664861
665862```hoon
666− ++ mar :: add with validation
667− |* [b=* c=(unit *)]
668− ?~ c
669− (del b)
670− (put b u.c)
863+++ mar
864+ |* [b=* c=(unit *)]
865+ ?~ c
866+ (del b)
867+ (put b u.c)
671868```
672869
673870#### Examples
674871
675872```
676− > =m (my [['a' 1] ['b' 2] ~])
677− > (~(mar by m) 'c' (some 3))
678− [n=[p='b' q=2] l=[n=[p='c' q=3] l=[n=[p='a' q=1] l={} r={}] r=~] r=~]
873+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
874+> a
875+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
679876
680− > (~(mar by m) 'c' ~)
681− [n=[p='b' q=2] l=[n=[p='a' q=1] l=~ r=~] r=~]
877+> `(map @tas @)`(~(mar by a) %e (some 5))
878+{[p=%e q=5] [p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
682879
683− > (~(mar by m) 'b' ~)
684− [n=[p='a' q=1] l=~ r=~]
880+> `(map @tas @)`(~(mar by a) %a (some 10))
881+{[p=%b q=2] [p=%d q=4] [p=%a q=10] [p=%c q=3]}
882+
883+> `(map @tas @)`(~(mar by a) %a ~)
884+{[p=%b q=2] [p=%d q=4] [p=%c q=3]}
685885```
686886
687887---
888+
688889### `++put:by`
689890
690891Add key-value pair
@@ -693,7 +894,7 @@ Produces `a` with the addition of the key-value pair of `b` and `c`.
693894
694895#### Accepts
695896
696−`a` is a map.
897+`a` is a map, and is the sample of `+by`.
697898
698899`b` is a key of the same type as the keys in `a`.
699900
@@ -706,51 +907,56 @@ A map.
706907#### Source
707908
708909```hoon
709− ++ put :: adds key-value pair
710− ~/ %put
711− |* [b=* c=*]
712− |- ^+ a
713− ?~ a
714− [[b c] ~ ~]
715− ?: =(b p.n.a)
716− ?: =(c q.n.a)
717− a
718− a(n [b c])
719− ?: (gor b p.n.a)
720− =+ d=$(a l.a)
721− ?> ?=(^ d)
722− ?: (mor p.n.a p.n.d)
723− a(l d)
724− d(r a(l r.d))
725− =+ d=$(a r.a)
910+++ put
911+ ~/ %put
912+ |* [b=* c=*]
913+ |- ^+ a
914+ ?~ a
915+ [[b c] ~ ~]
916+ ?: =(b p.n.a)
917+ ?: =(c q.n.a)
918+ a
919+ a(n [b c])
920+ ?: (gor b p.n.a)
921+ =+ d=$(a l.a)
726922 ?> ?=(^ d)
727923 ?: (mor p.n.a p.n.d)
728− a(r d)
729− d(l a(r l.d))
924+ a(l d)
925+ d(r a(l r.d))
926+ =+ d=$(a r.a)
927+ ?> ?=(^ d)
928+ ?: (mor p.n.a p.n.d)
929+ a(r d)
930+ d(l a(r l.d))
730931```
731932
732933#### Examples
733934
734935```
735− > =m (my [['a' 1] ['b' 2] ~])
736− > (~(put by ~) 'c' 3)
737− [n=[p='b' q=2] l=[n=[p='c' q=3] l={[p='a' q=1]} r={}] r=~]
936+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3]))
937+> a
938+{[p=%b q=2] [p=%a q=1] [p=%c q=3]}
738939
739− > (~(put by m) "zod" 26)
740− ! nest-fail
741− ! exit
940+> `(map @tas @)`(~(put by a) %d 4)
941+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
742942
743− > (~(put by m) 'a' 2)
744− [n=[p='b' q=2] l=[n=[p='a' q=2] l={} r={}] r=~]
943+> `(map @tas @)`(~(put by a) %a 10)
944+{[p=%b q=2] [p=%a q=10] [p=%c q=3]}
745945
746− > (put:by m 'a' 2)
747− {[p=[[98 2] [[97 1] 0 0] 0] q=[97 2]]}
946+> (~(put by a) 42 'foo')
947+mull-grow
948+mull-nice
949+-need.?(%~ [n=[p=@tas q=@] l=nlr([p=@tas q=@]) r=nlr([p=@tas q=@])])
950+-have.[[@ud @t] %~ %~]
951+nest-fail
952+dojo: hoon expression failed
748953```
749954
750955---
956+
751957### `++rep:by`
752958
753−Replace by product
959+Reduce to product
754960
755961Accumulate elements of map `a` using gate `b`, producing a noun.
756962
@@ -758,7 +964,7 @@ Accumulate elements of map `a` using gate `b`, producing a noun.
758964
759965`a` is a map.
760966
761−`b` is a wet gate.
967+`b` is a gate.
762968
763969#### Produces
764970
@@ -767,63 +973,91 @@ A noun.
767973#### Source
768974
769975```hoon
770− ++ rep :: reduce to product
771− ~/ %rep
772− |* b=_=>(~ |=([* *] +<+))
773− |-
774− ?~ a +<+.b
775− $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
976+++ rep
977+ ~/ %rep
978+ |* b=_=>(~ |=([* *] +<+))
979+ |-
980+ ?~ a +<+.b
981+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
776982```
777983
778984#### Examples
779985
780986```
781− > =m (my [['a' 1] ['b' 2] ~])
782− > (~(rep by m) |=(a=(pair * *) p.a))
783− q=[97 1]
987+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
988+> a
989+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
990+
991+> (~(rep by a) |=([p=[@tas @] q=@] ~&([p q] (add +.p q))))
992+[[%b 2] 0]
993+[[%d 4] 2]
994+[[%c 3] 6]
995+[[%a 1] 9]
996+q=10
784997```
785998
999+#### Discussion
1000+
1001+The gate will iteratively be fed a cell whose head is a key-value pair from the map and whose tail is an accumulator, producing the final value of the accumulator.
1002+
7861003---
1004+
7871005### `++rib:by`
7881006
789−Replace values with accumulator
1007+Transform + product
1008+
1009+`c` is a gate with a sample like `[[key value] accumulator]` and a product like `[accumulator [key value]]`. Each key-value pair in map `a` is passed to `c` and replaced with the key-value pair `c` produced. The final value of the accumulator and the modified map are returned. `b` is the initial value of the accumulator.
7901010
7911011#### Accepts
7921012
793−`a` is a map.
1013+`a` is a map, and is the sample of `+by`.
7941014
795−`b` is a noun.
1015+`b` is a noun, and is the initial value of the accumulator.
7961016
797−`c` is a wet gate.
1017+`c` is a gate.
7981018
799−####
1019+#### Produces
8001020
801−A cell of nouns.
1021+A cell of a noun and a map.
8021022
8031023#### Source
8041024
8051025```hoon
806− ++ rib :: transform + product
807− |* [b=* c=gate]
808− |- ^+ [b a]
809− ?~ a [b ~]
810− =+ d=(c n.a b)
811− =. n.a +.d
812− =+ e=$(a l.a, b -.d)
813− =+ f=$(a r.a, b -.e)
814− [-.f a(l +.e, r +.f)]
1026+++ rib
1027+ |* [b=* c=gate]
1028+ |- ^+ [b a]
1029+ ?~ a [b ~]
1030+ =+ d=(c n.a b)
1031+ =. n.a +.d
1032+ =+ e=$(a l.a, b -.d)
1033+ =+ f=$(a r.a, b -.e)
1034+ [-.f a(l +.e, r +.f)]
8151035```
8161036
8171037#### Examples
8181038
1039+In this example, all values less than three are changed to zero, and a list of their keys are produced along with the modified map.
1040+
8191041```
820− > =m (my [['a' 1] ['b' 2] ~])
821− > (~(rib by m) [1 2] (con by m))
1042+> =a `(map @t @)`(malt ~[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5]])
1043+> a
1044+{[p='e' q=5] [p='b' q=2] [p='d' q=4] [p='a' q=1] [p='c' q=3]}
8221045
823− > (~(rep by m) [1 2] |=(a=(pair * *) p.a))
1046+> =c |= [[k=@t v=@] acc=(list @t)]
1047+ ?: (lth v 3)
1048+ [[k acc] [k 0]]
1049+ [acc [k v]]
1050+
1051+> `[(list @t) (map @t @)]`(~(rib by a) *(list @t) c)
1052+[<|a b|> {[p='e' q=5] [p='b' q=0] [p='d' q=4] [p='a' q=0] [p='c' q=3]}]
8241053```
8251054
1055+#### Discussion
1056+
1057+Key-value pairs in the map are transformed in their existing tree location. This means if you change the key, you'd likely produce a map with an incorrect order, so typically you should only change the value.
1058+
8261059---
1060+
8271061### `++run:by`
8281062
8291063Transform values
@@ -832,9 +1066,9 @@ Iterates over every value in map `a` using gate `b`, producing a map.
8321066
8331067#### Accepts
8341068
835−`a` is a map.
1069+`a` is a map, and is the sample of `+by`.
8361070
837−`b` is a wet gate.
1071+`b` is a gate.
8381072
8391073#### Produces
8401074
@@ -843,38 +1077,36 @@ A map.
8431077#### Source
8441078
8451079```hoon
846− ++ run :: apply gate to values
847− ~/ %run
848− |* b=gate
849− |-
850− ?~ a a
851− [n=[p=p.n.a q=(b q.n.a)] l=$(a l.a) r=$(a r.a)]
1080+++ run
1081+ ~/ %run
1082+ |* b=gate
1083+ |-
1084+ ?~ a a
1085+ [n=[p=p.n.a q=(b q.n.a)] l=$(a l.a) r=$(a r.a)]
8521086```
8531087
8541088#### Examples
8551089
8561090```
857− > =m (my [['a' 1] ['b' 2] ~])
1091+> =a `(map @t @)`(malt ~[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5]])
8581092
859− > ^+(m (~(run by m) dec))
860− [n=[p='b' q=1] l={[p='a' q=0]} r={}]
861−
862− > `(map @tas @t)`(~(run by m) (cury scot %ux))
863− {[p=%a q='0x1'] [p=%b q='0x2']}
1093+> `(map @t @)`(~(run by a) dec)
1094+{[p='e' q=4] [p='b' q=1] [p='d' q=3] [p='a' q=0] [p='c' q=2]}
8641095```
8651096
8661097---
1098+
8671099### `++rut:by`
8681100
8691101Transform nodes
8701102
871−Applies a gate `b` to nodes in map `a`.
1103+Applies a gate `b` to nodes in map `a`. The sample of gate `b` is a key-value pair, and it produces a new value.
8721104
8731105#### Accepts
8741106
875−`a` is a map.
1107+`a` is a map, and is the sample of `+by`.
8761108
877−`b` is a wet gate.
1109+`b` is a gate.
8781110
8791111#### Produces
8801112
@@ -883,32 +1115,38 @@ A map.
8831115#### Source
8841116
8851117```hoon
886− ++ rut :: apply gate to nodes
887− |* b=gate
888− |-
889− ?~ a a
890− [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
1118+++ rut
1119+ |* b=gate
1120+ |-
1121+ ?~ a a
1122+ [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
8911123```
8921124
8931125#### Examples
8941126
8951127```
896− > =m (my [['a' 1] ['b' 2] ~])
1128+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3] [4 4] [5 5]])
1129+
1130+> =b |= [k=@ v=@]
1131+ ?: (gth v 2)
1132+ (mul k v)
1133+ v
1134+
1135+> `(map @ @)`(~(rut by a) b)
1136+{[p=5 q=25] [p=1 q=1] [p=2 q=2] [p=3 q=9] [p=4 q=16]}
8971137```
8981138
8991139---
1140+
9001141### `++tap:by`
9011142
9021143Listify pairs
9031144
904−Produces the list of all elements in map `a` that is prepended to list `b`,
905−which is empty by default.
1145+Produces the list of all elements in map `a`.
9061146
9071147#### Accepts
9081148
909−`a` is a map.
910−
911−`b` is a list.
1149+`a` is a map, and is the sample of `+by`.
9121150
9131151#### Produces
9141152
@@ -917,41 +1155,37 @@ A list.
9171155#### Source
9181156
9191157```hoon
920− ++ tap :: listify pairs
921− =< $
922− ~/ %tap
923− =+ b=`(list _?>(?=(^ a) n.a))`~
924− |. ^+ b
925− ?~ a
926− b
927− $(a r.a, b [n.a $(a l.a)])
1158+++ tap
1159+ =< $
1160+ ~/ %tap
1161+ =+ b=`(list _?>(?=(^ a) n.a))`~
1162+ |. ^+ b
1163+ ?~ a
1164+ b
1165+ $(a r.a, b [n.a $(a l.a)])
9281166```
9291167
9301168#### Examples
9311169
9321170```
933− > =m (my [['a' 1] ['b' 2] ~])
934− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
935− > `*`m
936− [[98 2] [[97 1] 0 0] 0]
1171+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3] [4 4] [5 5]])
9371172
938− > ~(tap by m)
939− ~[[p='b' q=2] [p='a' q=1]]
940− > `*`~(tap by m)
941− [[98 2] [97 1] 0]
1173+> ~(tap by a)
1174+~[[p=4 q=4] [p=3 q=3] [p=2 q=2] [p=1 q=1] [p=5 q=5]]
9421175```
9431176
9441177---
1178+
9451179### `++uni:by`
9461180
947−Union
1181+Union, merge
9481182
9491183Produces a map of the union between the keys of `a` and `b`. If `b` shares a
9501184key with `a`, the tuple from `b` is preserved.
9511185
9521186#### Accepts
9531187
954−`a` is a map.
1188+`a` is a map, and is the sample `+by`.
9551189
9561190`b` is a map.
9571191
@@ -962,48 +1196,105 @@ A map.
9621196#### Source
9631197
9641198```hoon
965− ++ uni :: union, merge
966− ~/ %uni
967− =+ b=a
968− |@
969− ++ $
970− |- ^+ a
971− ?~ b
972− a
973− ?~ a
974− b
975− ?: =(p.n.b p.n.a)
976− b(l $(a l.a, b l.b), r $(a r.a, b r.b))
977− ?: (mor p.n.a p.n.b)
978− ?: (gor p.n.b p.n.a)
979− $(l.a $(a l.a, r.b ~), b r.b)
980− $(r.a $(a r.a, l.b ~), b l.b)
981− ?: (gor p.n.a p.n.b)
982− $(l.b $(b l.b, r.a ~), a r.a)
983− $(r.b $(b r.b, l.a ~), a l.a)
984− --
1199+++ uni
1200+ ~/ %uni
1201+ =+ b=a
1202+ |@
1203+ ++ $
1204+ |- ^+ a
1205+ ?~ b
1206+ a
1207+ ?~ a
1208+ b
1209+ ?: =(p.n.b p.n.a)
1210+ b(l $(a l.a, b l.b), r $(a r.a, b r.b))
1211+ ?: (mor p.n.a p.n.b)
1212+ ?: (gor p.n.b p.n.a)
1213+ $(l.a $(a l.a, r.b ~), b r.b)
1214+ $(r.a $(a r.a, l.b ~), b l.b)
1215+ ?: (gor p.n.a p.n.b)
1216+ $(l.b $(b l.b, r.a ~), a r.a)
1217+ $(r.b $(b r.b, l.a ~), a l.a)
1218+ --
9851219```
9861220
9871221#### Examples
9881222
9891223```
990− > =m (my [['a' 1] ['b' 2] ~])
1224+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3]])
1225+> =b `(map @ @)`(malt ~[[3 300] [4 400] [5 500]])
1226+> a
1227+{[p=1 q=1] [p=2 q=2] [p=3 q=3]}
1228+> b
1229+{[p=5 q=500] [p=3 q=300] [p=4 q=400]}
1230+
1231+> `(map @ @)`(~(uni by a) b)
1232+{[p=5 q=500] [p=1 q=1] [p=2 q=2] [p=3 q=300] [p=4 q=400]}
1233+```
1234+
1235+---
1236+
1237+### `++uno:by`
1238+
1239+General union
9911240
992− > =o (my [['c' 3] ['d' 4] ~])
1241+Produces a map of the union between the keys of `a` and `b`. If `b` shares a key with `a`, gate `meg` is applied to both and its product is used as the new value of the key in question.
9931242
994− > (~(uni by m) o)
995− [n=[p='b' q=2] l=[n=[p='d' q=4] l={} r={[p='a' q=1] [p='c' q=3]}] r=~]
1243+#### Accepts
1244+
1245+`a` is a `map`, and is the sample of `+by`.
1246+
1247+`b` is a `map`, and is the sample of `~(uno by a)`.
1248+
1249+`meg` is a gate, and is the sample of `(~(uno by a) b)`.
1250+
1251+#### Produces
1252+
1253+A `map`.
1254+
1255+#### Source
1256+
1257+```hoon
1258+++ uno
1259+ =+ b=a
1260+ |@
1261+ ++ $
1262+ |= meg=$-([_p:node _q:node _q:node] _q:node)
1263+ |- ^+ a
1264+ ?~ b
1265+ a
1266+ ?~ a
1267+ b
1268+ ?: =(p.n.b p.n.a)
1269+ :+ [p.n.a (meg p.n.a q.n.a q.n.b)]
1270+ $(b l.b, a l.a)
1271+ $(b r.b, a r.a)
1272+ ?: (mor p.n.a p.n.b)
1273+ ?: (gor p.n.b p.n.a)
1274+ $(l.a $(a l.a, r.b ~), b r.b)
1275+ $(r.a $(a r.a, l.b ~), b l.b)
1276+ ?: (gor p.n.a p.n.b)
1277+ $(l.b $(b l.b, r.a ~), a r.a)
1278+ $(r.b $(b r.b, l.a ~), a l.a)
1279+ --
1280+```
9961281
997− > (~(uni by m) ~)
998− {[p='a' q=1] [p='b' q=2]}
1282+#### Examples
9991283
1000− > n
1001− {[p='a' q=1] [p='c' q=3]}
1002− > (~(uni by o) n)
1003− {[p='d' q=4] [p='a' q=1] [p='c' q=3]}
1284+```
1285+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3]])
1286+> =b `(map @ @)`(malt ~[[3 3] [4 4] [5 5]])
1287+> a
1288+{[p=1 q=1] [p=2 q=2] [p=3 q=3]}
1289+> b
1290+{[p=5 q=5] [p=3 q=3] [p=4 q=4]}
1291+
1292+> `(map @ @)`((~(uno by a) b) |=([k=@ v=@ w=@] (add v w)))
1293+{[p=5 q=5] [p=1 q=1] [p=2 q=2] [p=3 q=6] [p=4 q=4]}
10041294```
10051295
10061296---
1297+
10071298### `++urn:by`
10081299
10091300Turn (with key)
@@ -1015,37 +1306,32 @@ the key and the value of each element as its sample.
10151306
10161307`a` is a map.
10171308
1018−`b` is a wet gate that accepts two nouns.
1309+`b` is a gate that accepts two nouns.
10191310
10201311#### Produces
10211312
1022−A noun.
1313+A `map`.
10231314
10241315#### Source
10251316
10261317```hoon
1027− ++ urn :: apply gate to nodes
1028− ~/ %urn
1029− |* b=$-([* *] *)
1030− |-
1031− ?~ a ~
1032− a(n n.a(q (b p.n.a q.n.a)), l $(a l.a), r $(a r.a))
1318+++ urn
1319+ ~/ %urn
1320+ |* b=$-([* *] *)
1321+ |-
1322+ ?~ a ~
1323+ a(n n.a(q (b p.n.a q.n.a)), l $(a l.a), r $(a r.a))
10331324```
10341325
10351326#### Examples
10361327
10371328```
1038− > m
1039− {[p='a' q=1] [p='b' q=2]}
1040−
1041− > (~(urn by m) |=(a=(pair * *) q.a))
1042− {[p='a' q=1] [p='b' q=2]}
1329+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3]])
1330+> a
1331+{[p=1 q=1] [p=2 q=2] [p=3 q=3]}
10431332
1044− > (~(urn by m) |=(a=(pair * *) 7))
1045− {[p='a' q=7] [p='b' q=7]}
1046−
1047− > (~(urn by m) |=(a=(pair * *) p.a))
1048− {[p='a' q=97] [p='b' q=98]}
1333+> (~(urn by a) |=([k=@ v=@] (pow v 2)))
1334+{[p=1 q=1] [p=2 q=4] [p=3 q=9]}
10491335```
10501336
10511337---
@@ -1058,7 +1344,7 @@ Produce the depth of the tree map `a`.
10581344
10591345#### Accepts
10601346
1061−`a` is a map.
1347+`a` is a map, and is the sample of `+by`.
10621348
10631349#### Produces
10641350
@@ -1067,28 +1353,28 @@ An atom.
10671353#### Source
10681354
10691355```hoon
1070− ++ wyt :: depth of map
1071− =< $
1072− ~% %wyt + ~
1073− |. ^- @
1074− ?~(a 0 +((add $(a l.a) $(a r.a))))
1356+++ wyt
1357+ =< $
1358+ ~% %wyt + ~
1359+ |. ^- @
1360+ ?~(a 0 +((add $(a l.a) $(a r.a))))
10751361```
10761362
10771363#### Examples
10781364
10791365```
1080− > =m (my [['a' 1] ['b' 2] ~])
1366+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3]])
1367+> =b `(map @ @)`(malt ~[[1 1] [2 2] [3 3] [4 4] [5 5]])
1368+> a
1369+{[p=1 q=1] [p=2 q=2] [p=3 q=3]}
1370+> b
1371+{[p=5 q=5] [p=1 q=1] [p=2 q=2] [p=3 q=3] [p=4 q=4]}
10811372
1082− > =o (my [['c' 3] ['d' 4] ~])
1373+> ~(wyt by a)
1374+3
10831375
1084− > ~(wyt by m)
1085− 2
1086−
1087− > ~(wyt by o)
1088− 2
1089−
1090− > ~(wyt by (~(uni by m) o))
1091− 4
1376+> ~(wyt by b)
1377+5
10921378```
10931379
10941380---
@@ -1097,15 +1383,12 @@ An atom.
10971383
10981384List of values
10991385
1100−Produces a list of all values in map `a` that is prepended to list `b`,
1101−which is empty by default.
1386+Produces a list of all values in map `a`.
11021387
11031388#### Accepts
11041389
11051390`a` is a map.
11061391
1107−`b` is a list.
1108−
11091392#### Produces
11101393
11111394A list.
@@ -1123,11 +1406,12 @@ A list.
11231406#### Examples
11241407
11251408```
1126− > =m (my [['a' 1] ['b' 2] ~])
1127− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
1409+> =a `(map @t @)`(malt ~[['a' 1] ['b' 2] ['c' 3]])
1410+> a
1411+{[p='b' q=2] [p='a' q=1] [p='c' q=3]}
11281412
1129− > ~(val by m)
1130− ~[1 2]
1413+> ~(val by a)
1414+~[3 1 2]
11311415```
11321416
11331417---
content/docs/hoon/reference/stdlib/table-of-contents.md+21−22
@@ -127,6 +127,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
127127<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#demag' title="Parse decmal with dots"><code>++dem:ag</code></a>
128128<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#denfl' title="Denormalizes (floating point)"><code>++den:fl</code></a>
129129<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#depto' title="Maximum depth (queue)"><code>++dep:to</code></a>
130+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#difby' title="Difference between maps"><code>++dif:by</code></a>
130131<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#diffe' title="Difference between atoms (modular basis)"><code>++dif:fe</code></a>
131132<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#diffo' title='Subtraction (modular base)'><code>++dif:fo</code></a>
132133<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#difin' title='Difference (set)'><code>++dif:in</code></a>
@@ -148,7 +149,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
148149<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#dog' title="Optional gap"><code>++dog</code></a>
149150<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#doh' title="@p separator"><code>++doh</code></a>
150151<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#doq' title="Parse double quote"><code>++doq</code></a>
151−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#dor' title="Numeric order"><code>++dor</code></a>
152+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#dor' title="Depth order"><code>++dor</code></a>
152153<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#dot' title="Parse period"><code>++dot</code></a>
153154<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#drgff' title="@r to decimal float"><code>++drg:ff</code></a>
154155<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#drgfl' title="Get printable decimal (signed and unsigned integer cell)"><code>++drg:fl</code></a>
@@ -211,7 +212,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
211212<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fmarh' title="Fused multiplyadd (halfprecision float)"><code>++fma:rh</code></a>
212213<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fmars' title="Fused multiplyadd (singleprecision float)"><code>++fma:rs</code></a>
213214<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fmarq' title="Fused multiplyadd (quadprecision float)"><code>++fma:rq</code></a>
214−<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#fnv' title="FNV scrambler"><code>++fnv</code></a>
215215<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#fo' title="Modulo prime"><code>++fo</code></a>
216216<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#foot' title="Cases of arms by variance model"><code>++foot</code></a>
217217<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fosrh' title="@rs to @rh"><code>++fos:rh</code></a>
@@ -239,7 +239,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
239239<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#getto' title="Headtail pair"><code>++get:to</code></a>
240240<a class="tooltip" href='/docs/hoon/reference/stdlib/4e/#glue' title="Skip delimiter"><code>++glue</code></a>
241241<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#gon' title="Parse long numbers"><code>++gon</code></a>
242−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#gor' title="Hash order"><code>++gor</code></a>
242+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#gor' title="Mug order"><code>++gor</code></a>
243243<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gotby' title="Assert for value (map)"><code>++got:by</code></a>
244244<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#grdff' title="Decimal float to @r"><code>++grd:ff</code></a>
245245<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#grdfl' title="Decimal to float"><code>++grd:fl</code></a>
@@ -281,7 +281,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
281281<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#hig' title="Parse single uppercase letter"><code>++hig</code></a>
282282<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#hit' title="Parse single hexadecimal digit"><code>++hit</code></a>
283283<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#homo' title="Homogenize list"><code>++homo</code></a>
284−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#hor' title="Horizontal hash order"><code>++hor</code></a>
285284<a class="tooltip" href='/docs/hoon/reference/stdlib/3c/#horyo' title="Seconds in hour"><code>++hor:yo</code></a>
286285<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#hufab' title="Parse two phonetic pairs"><code>++huf:ab</code></a>
287286<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#hunt' title="Select between two units by a rule"><code>++hunt</code></a>
@@ -303,6 +302,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
303302### j
304303
305304<a class="tooltip" href='/docs/hoon/reference/stdlib/2j/#ja' title="Jar engine"><code>++ja</code></a>
305+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#jabby' title="Transform value (map)"><code>++jab:by</code></a>
306306<a class="tooltip" href='/docs/hoon/reference/stdlib/2p/#jam' title="Pack noun to atom"><code>++jam</code></a>
307307<a class="tooltip" href='/docs/hoon/reference/stdlib/2o/#jar' title="Mold generator (jar)"><code>++jar</code></a>
308308<a class="tooltip" href='/docs/hoon/reference/stdlib/3c/#jesyo' title="Maximum 64bit timestamp"><code>++jes:yo</code></a>
@@ -338,7 +338,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
338338<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#lipag' title="Parse IPv4 address"><code>++lip:ag</code></a>
339339<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#list' title="Mold constructor (list)"><code>++list</code></a>
340340<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#lone' title="Mold generator (face on mold)"><code>++lone</code></a>
341−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#lor' title="Leg order"><code>++lor</code></a>
342341<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#low' title="Parse lowercase letter"><code>++low</code></a>
343342<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#lsh' title="Leftshift"><code>++lsh</code></a>
344343<a class="tooltip" href='/docs/hoon/reference/stdlib/1a/#lte' title="Less than / equal (atom)"><code>++lte</code></a>
@@ -370,7 +369,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
370369<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mack' title="Nock subject to unit"><code>++mack</code></a>
371370<a class="tooltip" href='/docs/hoon/reference/stdlib/2l/#malt' title="Map from list"><code>++malt</code></a>
372371<a class="tooltip" href='/docs/hoon/reference/stdlib/2o/#map' title="Mold generator (map)"><code>++map</code></a>
373−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#marby' title="Assert and add (map)"><code>++mar:by</code></a>
372+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#marby' title="Add with validation (map)"><code>++mar:by</code></a>
374373<a class="tooltip" href='/docs/hoon/reference/stdlib/1b/#mas' title="Address within head/tail"><code>++mas</code></a>
375374<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#mask' title="Match character"><code>++mask</code></a>
376375<a class="tooltip" href='/docs/hoon/reference/stdlib/2p/#mat' title="Lengthencode"><code>++mat</code></a>
@@ -392,6 +391,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
392391<a class="tooltip" href='/docs/hoon/reference/stdlib/2l/#molt' title="Map from pair list"><code>++molt</code></a>
393392<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mong' title="Slam gate with sample"><code>++mong</code></a>
394393<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mook' title="Intelligently render crash annotation"><code>++mook</code></a>
394+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#mor' title="(more) mug order"><code>++mor</code></a>
395395<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#more' title="Parse list with delimiter"><code>++more</code></a>
396396<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#most' title="Parse list of at least one match"><code>++most</code></a>
397397<a class="tooltip" href='/docs/hoon/reference/stdlib/3c/#moyyo' title="Days in months of leapyear"><code>++moy:yo</code></a>
@@ -407,7 +407,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
407407<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#mulrq' title="Multiply (quadprecision float)"><code>++mul:rq</code></a>
408408<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mule' title="Typed virtual"><code>++mule</code></a>
409409<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mute' title="Untyped virtual"><code>++mute</code></a>
410−<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#mum' title="31bit MurmurHash3 scrambler"><code>++mum</code></a>
411410<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#murn' title="Maybe transform"><code>++murn</code></a>
412411<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#my' title="Map from raw noun"><code>++my</code></a>
413412<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#mynl' title="Construct map from nullterminated noun"><code>++my:nl</code></a>
@@ -507,11 +506,11 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
507506<a class="tooltip" href='/docs/hoon/reference/stdlib/4k/#rendco' title="Render coin lot as tape"><code>++rend:co</code></a>
508507<a class="tooltip" href='/docs/hoon/reference/stdlib/4k/#rentco' title="Render coin lot as span"><code>++rent:co</code></a>
509508<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rep' title="Assemble single"><code>++rep</code></a>
510−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#repby' title="Replace by product (map)"><code>++rep:by</code></a>
509+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#repby' title="Reduce to product (map)"><code>++rep:by</code></a>
511510<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#repin' title="Accumulate elements (set)"><code>++rep:in</code></a>
512511<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rev' title="Reverse"><code>++rev</code></a>
513512<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#rfat' title="(Undocumented)"><code>++rf:at</code></a>
514−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#ribby' title="Replace values with accumulator (map)"><code>++rib:by</code></a>
513+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#ribby' title="Transform + product (map)"><code>++rib:by</code></a>
515514<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#rigre' title="Wrap tape in / (tank)"><code>++rig:re</code></a>
516515<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rip' title="Disassemble"><code>++rip</code></a>
517516<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#rnat' title="(Undocumented)"><code>++rn:at</code></a>
@@ -739,10 +738,11 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
739738### u
740739
741740<a class="tooltip" href='/docs/hoon/reference/stdlib/3f/#un' title="Reversible scrambling"><code>++un</code></a>
742−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#uniby' title="Union (map between keys of two lists)"><code>++uni:by</code></a>
741+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#uniby' title="Union, merge (map)"><code>++uni:by</code></a>
743742<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#unifl' title="Change representation to odd"><code>++uni:fl</code></a>
744743<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#uniin' title="Union (sets)"><code>++uni:in</code></a>
745744<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#unit' title="Mold generator (maybe)"><code>++unit</code></a>
745+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#unoby' title="General union (map)"><code>++uno:by</code></a>
746746<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#urnby' title="Turn (with key) (map)"><code>++urn:by</code></a>
747747<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#ursab' title="Parse span characters"><code>++urs:ab</code></a>
748748<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#urtab' title="Parse non_ span"><code>++urt:ab</code></a>
@@ -757,7 +757,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
757757<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#vise' title="Convert during reboot"><code>++vise</code></a>
758758<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#vit' title="Parse base 64 digit"><code>++vit</code></a>
759759<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#vizag' title="Parse base 32 digit with dot separators"><code>++viz:ag</code></a>
760−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#vor' title="Vertical order"><code>++vor</code></a>
761760<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#voyab' title="Parse bas, soq, or bix"><code>++voy:ab</code></a>
762761<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#vul' title="Comments to null"><code>++vul</code></a>
763762<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#vumag' title="Parse base 32 string"><code>++vum:ag</code></a>
@@ -948,19 +947,15 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
948947
949948### 2e: insecure hashing
950949
951−<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#fnv' title="FNV scrambler"><code>++fnv</code></a>
952950<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#mug' title="FNV1a scrambler"><code>++mug</code></a>
953951<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#muk' title="Standard MurmurHash3"><code>++muk</code></a>
954−<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#mum' title="31bit MurmurHash3 scrambler"><code>++mum</code></a>
955952
956953### 2f: noun ordering
957954
958955<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#aor' title="Alphabetical order"><code>++aor</code></a>
959−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#dor' title="Numeric order"><code>++dor</code></a>
960−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#gor' title="Hash order"><code>++gor</code></a>
961−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#hor' title="Horizontal hash order"><code>++hor</code></a>
962−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#lor' title="Leg order"><code>++lor</code></a>
963−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#vor' title="Vertical order"><code>++vor</code></a>
956+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#dor' title="Depth order"><code>++dor</code></a>
957+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#gor' title="Mug order"><code>++gor</code></a>
958+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#mor' title="(more) mug order"><code>++mor</code></a>
964959
965960### 2g: unsigned powers
966961
@@ -995,20 +990,24 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
995990<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#aptby' title="Check correctness (map)"><code>++apt:by</code></a>
996991<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#bifby' title="Bifurcate map"><code>++bif:by</code></a>
997992<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#delby' title="Delete (map)"><code>++del:by</code></a>
993+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#difby' title="Difference between maps"><code>++dif:by</code></a>
998994<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#digby' title="Address of key (map)"><code>++dig:by</code></a>
999995<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gasby' title="Concatenate (map)"><code>++gas:by</code></a>
1000996<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#getby' title="Grab unit value"><code>++get:by</code></a>
1001997<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gotby' title="Assert for value (map)"><code>++got:by</code></a>
1002998<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#hasby' title="Key existence check (map)"><code>++has:by</code></a>
1003999<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#intby' title="Intersection (map)"><code>++int:by</code></a>
1004−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#marby' title="Assert and add (map)"><code>++mar:by</code></a>
1000+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#jabby' title="Transform value (map)"><code>++jab:by</code></a>
1001+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#keyby' title="Set of keys"><code>++key:by</code></a>
1002+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#marby' title="Add with validation (map)"><code>++mar:by</code></a>
10051003<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#putby' title="Add keyvalue pair (map)"><code>++put:by</code></a>
1006−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#repby' title="Replace by product (map)"><code>++rep:by</code></a>
1007−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#ribby' title="Replace values with accumulator (map)"><code>++rib:by</code></a>
1004+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#repby' title="Reduce to product (map)"><code>++rep:by</code></a>
1005+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#ribby' title="Transform + product (map)"><code>++rib:by</code></a>
10081006<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#runby' title="Transform values (map)"><code>++run:by</code></a>
10091007<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#rutby' title="Transform nodes (map)"><code>++rut:by</code></a>
10101008<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#tapby' title="Listify pairs"><code>++tap:by</code></a>
1011−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#uniby' title="Union (map between keys of two lists)"><code>++uni:by</code></a>
1009+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#uniby' title="Union, merge (map)"><code>++uni:by</code></a>
1010+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#unoby' title="General union (map)"><code>++uno:by</code></a>
10121011<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#urnby' title="Turn (with key) (map)"><code>++urn:by</code></a>
10131012<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#wytby' title="Produce depth of tree map"><code>++wyt:by</code></a>
10141013
lib/glossary.js+41−41
@@ -2130,6 +2130,13 @@ export const glossary = [
21302130 slug: "https://urbit.org/docs/reference/library/2k/#dep-to",
21312131 desc: "Used in the Hoon standard library.",
21322132 },
2133+ {
2134+ name: "Difference between maps",
2135+ symbol: "dif:by",
2136+ usage: "stdlib",
2137+ slug: "https://urbit.org/docs/reference/library/2i/#difby",
2138+ desc: "Used in the Hoon standard library.",
2139+ },
21332140 {
21342141 name: "Difference between atoms (modular basis)",
21352142 symbol: "dif:fe",
@@ -2278,7 +2285,7 @@ export const glossary = [
22782285 desc: "Used in the Hoon standard library.",
22792286 },
22802287 {
2281− name: "Numeric order",
2288+ name: "Depth order",
22822289 symbol: "dor",
22832290 usage: "stdlib",
22842291 slug: "https://urbit.org/docs/reference/library/2f/#dor",
@@ -2676,13 +2683,6 @@ export const glossary = [
26762683 slug: "https://urbit.org/docs/reference/library/3b/#fma-rq",
26772684 desc: "Used in the Hoon standard library.",
26782685 },
2679− {
2680− name: "FNV scrambler",
2681− symbol: "fnv",
2682− usage: "stdlib",
2683− slug: "https://urbit.org/docs/reference/library/2e/#fnv",
2684− desc: "Used in the Hoon standard library.",
2685− },
26862686 {
26872687 name: "Modulo prime",
26882688 symbol: "fo",
@@ -2852,7 +2852,7 @@ export const glossary = [
28522852 desc: "Used in the Hoon standard library.",
28532853 },
28542854 {
2855− name: "Hash order",
2855+ name: "Mug order",
28562856 symbol: "gor",
28572857 usage: "stdlib",
28582858 slug: "https://urbit.org/docs/reference/library/2f/#gor",
@@ -3124,13 +3124,6 @@ export const glossary = [
31243124 slug: "https://urbit.org/docs/reference/library/2b/#homo",
31253125 desc: "Used in the Hoon standard library.",
31263126 },
3127− {
3128− name: "Horizontal hash order",
3129− symbol: "hor",
3130− usage: "stdlib",
3131− slug: "https://urbit.org/docs/reference/library/2f/#hor",
3132− desc: "Used in the Hoon standard library.",
3133− },
31343127 {
31353128 name: "Seconds in hour",
31363129 symbol: "hor:yo",
@@ -3243,6 +3236,13 @@ export const glossary = [
32433236 slug: "https://urbit.org/docs/reference/library/2j/#ja",
32443237 desc: "Used in the Hoon standard library.",
32453238 },
3239+ {
3240+ name: "Transform value (map)",
3241+ symbol: "jab:by",
3242+ usage: "stdlib",
3243+ slug: "https://urbit.org/docs/reference/library/2i/#jabby",
3244+ desc: "Used in the Hoon standard library.",
3245+ },
32463246 {
32473247 name: "Pack noun to atom",
32483248 symbol: "jam",
@@ -3320,6 +3320,13 @@ export const glossary = [
33203320 slug: "https://urbit.org/docs/reference/library/4h/#ket",
33213321 desc: "Used in the Hoon standard library.",
33223322 },
3323+ {
3324+ name: "Set of keys (map)",
3325+ symbol: "key:by",
3326+ usage: "stdlib",
3327+ slug: "https://urbit.org/docs/reference/library/2i/#keyby",
3328+ desc: "Used in the Hoon standard library.",
3329+ },
33233330 {
33243331 name: "Recursive parsers",
33253332 symbol: "knee",
@@ -3439,13 +3446,6 @@ export const glossary = [
34393446 slug: "https://urbit.org/docs/reference/library/1c/#lone",
34403447 desc: "Used in the Hoon standard library.",
34413448 },
3442− {
3443− name: "Leg order",
3444− symbol: "lor",
3445− usage: "stdlib",
3446− slug: "https://urbit.org/docs/reference/library/2f/#lor",
3447− desc: "Used in the Hoon standard library.",
3448− },
34493449 {
34503450 name: "Parse lowercase letter",
34513451 symbol: "low",
@@ -3643,7 +3643,7 @@ export const glossary = [
36433643 desc: "Used in the Hoon standard library.",
36443644 },
36453645 {
3646− name: "Assert and add (map)",
3646+ name: "Add with validation (map)",
36473647 symbol: "mar:by",
36483648 usage: "stdlib",
36493649 slug: "https://urbit.org/docs/reference/library/2i/#mar-by",
@@ -3796,6 +3796,13 @@ export const glossary = [
37963796 slug: "https://urbit.org/docs/reference/library/4n/#mook",
37973797 desc: "Used in the Hoon standard library.",
37983798 },
3799+ {
3800+ name: "(more) mug order",
3801+ symbol: "mor",
3802+ usage: "stdlib",
3803+ slug: "https://urbit.org/docs/reference/library/2f/#mor",
3804+ desc: "Used in the Hoon standard library.",
3805+ },
37993806 {
38003807 name: "Parse list with delimiter",
38013808 symbol: "more",
@@ -3901,13 +3908,6 @@ export const glossary = [
39013908 slug: "https://urbit.org/docs/reference/library/4n/#mute",
39023909 desc: "Used in the Hoon standard library.",
39033910 },
3904− {
3905− name: "31-bit MurmurHash3 scrambler",
3906− symbol: "mum",
3907− usage: "stdlib",
3908− slug: "https://urbit.org/docs/reference/library/2e/#mum",
3909− desc: "Used in the Hoon standard library.",
3910− },
39113911 {
39123912 name: "Maybe transform",
39133913 symbol: "murn",
@@ -4497,7 +4497,7 @@ export const glossary = [
44974497 desc: "Used in the Hoon standard library.",
44984498 },
44994499 {
4500− name: "Replace by product (map)",
4500+ name: "Reduce to product (map)",
45014501 symbol: "rep:by",
45024502 usage: "stdlib",
45034503 slug: "https://urbit.org/docs/reference/library/2i/#rep-by",
@@ -4518,7 +4518,7 @@ export const glossary = [
45184518 desc: "Used in the Hoon standard library.",
45194519 },
45204520 {
4521− name: "Replace values with accumulator (map)",
4521+ name: "Transform + product (map)",
45224522 symbol: "rib:by",
45234523 usage: "stdlib",
45244524 slug: "https://urbit.org/docs/reference/library/2i/#rib-by",
@@ -6044,7 +6044,7 @@ export const glossary = [
60446044 desc: "Used in the Hoon standard library.",
60456045 },
60466046 {
6047− name: "Union (map between keys of two lists)",
6047+ name: "Union, merge (map)",
60486048 symbol: "uni:by",
60496049 usage: "stdlib",
60506050 slug: "https://urbit.org/docs/reference/library/2i/#uni-by",
@@ -6071,6 +6071,13 @@ export const glossary = [
60716071 slug: "https://urbit.org/docs/reference/library/1c/#unit",
60726072 desc: "Used in the Hoon standard library.",
60736073 },
6074+ {
6075+ name: "General union (map)",
6076+ symbol: "uno:by",
6077+ usage: "stdlib",
6078+ slug: "https://urbit.org/docs/reference/library/2i/#unoby",
6079+ desc: "Used in the Hoon standard library.",
6080+ },
60746081 {
60756082 name: "Turn (with key) (map)",
60766083 symbol: "urn:by",
@@ -6134,13 +6141,6 @@ export const glossary = [
61346141 slug: "https://urbit.org/docs/reference/library/4j/#viz-ag",
61356142 desc: "Used in the Hoon standard library.",
61366143 },
6137− {
6138− name: "Vertical order",
6139− symbol: "vor",
6140− usage: "stdlib",
6141− slug: "https://urbit.org/docs/reference/library/2f/#vor",
6142− desc: "Used in the Hoon standard library.",
6143− },
61446144 {
61456145 name: "Parse bas, soq, or bix",
61466146 symbol: "voy:ab",