on master help sign in
update stdlib 2d 2e 2f 2g 2h 2i
38a3961tinnus-napbus
content/docs/hoon/reference/stdlib/2d.md+51−50
@@ -23,22 +23,22 @@ An atom.
23#### Source
23#### Source
24
24
25```hoon
25```hoon
26− ++ con
26+++ con
27− ~/ %con
27+ ~/ %con
28− |= [a=@ b=@]
28+ |= [a=@ b=@]
29− =+ [c=0 d=0]
29+ =+ [c=0 d=0]
30− |- ^- @
30+ |- ^- @
31− ?: ?&(=(0 a) =(0 b)) d
31+ ?: ?&(=(0 a) =(0 b)) d
32− %= $
32+ %= $
33− a (rsh 0 1 a)
33+ a (rsh 0 a)
34− b (rsh 0 1 b)
34+ b (rsh 0 b)
35− c +(c)
35+ c +(c)
36− d %+ add d
36+ d %+ add d
37− %^ lsh 0 c
37+ %+ lsh [0 c]
38− ?& =(0 (end 0 1 a))
38+ ?& =(0 (end 0 a))
39− =(0 (end 0 1 b))
39+ =(0 (end 0 b))
40− ==
40+ ==
41− ==
41+ ==
42```
42```
43
43
44#### Examples
44#### Examples
@@ -97,8 +97,8 @@ contexts. That's because `0` is true in Hoon and `1` is false. Outside of Hoon,
97where `0` is false and `1` is true, bitwise OR is the logical disjunction and
97where `0` is false and `1` is true, bitwise OR is the logical disjunction and
98bitwise AND is the logical conjunction.
98bitwise AND is the logical conjunction.
99
99
100−
101---
100---
101+
102### `++dis`
102### `++dis`
103
103
104Binary AND
104Binary AND
@@ -118,22 +118,22 @@ An atom.
118#### Source
118#### Source
119
119
120```hoon
120```hoon
121− ++ dis
121+++ dis
122− ~/ %dis
122+ ~/ %dis
123− |= [a=@ b=@]
123+ |= [a=@ b=@]
124− =| [c=@ d=@]
124+ =| [c=@ d=@]
125− |- ^- @
125+ |- ^- @
126− ?: ?|(=(0 a) =(0 b)) d
126+ ?: ?|(=(0 a) =(0 b)) d
127− %= $
127+ %= $
128− a (rsh 0 1 a)
128+ a (rsh 0 a)
129− b (rsh 0 1 b)
129+ b (rsh 0 b)
130− c +(c)
130+ c +(c)
131− d %+ add d
131+ d %+ add d
132− %^ lsh 0 c
132+ %+ lsh [0 c]
133− ?| =(0 (end 0 1 a))
133+ ?| =(0 (end 0 a))
134− =(0 (end 0 1 b))
134+ =(0 (end 0 b))
135− ==
135+ ==
136− ==
136+ ==
137```
137```
138
138
139#### Examples
139#### Examples
@@ -187,6 +187,7 @@ where `0` is false and `1` is true, bitwise OR is the logical disjunction and
187bitwise AND is the logical conjunction.
187bitwise AND is the logical conjunction.
188
188
189---
189---
190+
190### `++mix`
191### `++mix`
191
192
192Binary XOR
193Binary XOR
@@ -206,19 +207,19 @@ An atom.
206#### Source
207#### Source
207
208
208```hoon
209```hoon
209− ++ mix
210+++ mix
210− ~/ %mix
211+ ~/ %mix
211− |= [a=@ b=@]
212+ |= [a=@ b=@]
212− ^- @
213+ ^- @
213− =+ [c=0 d=0]
214+ =+ [c=0 d=0]
214− |-
215+ |-
215− ?: ?&(=(0 a) =(0 b)) d
216+ ?: ?&(=(0 a) =(0 b)) d
216− %= $
217+ %= $
217− a (rsh 0 1 a)
218+ a (rsh 0 a)
218− b (rsh 0 1 b)
219+ b (rsh 0 b)
219− c +(c)
220+ c +(c)
220− d (add d (lsh 0 c =((end 0 1 a) (end 0 1 b))))
221+ d (add d (lsh [0 c] =((end 0 a) (end 0 b))))
221− ==
222+ ==
222```
223```
223
224
224#### Examples
225#### Examples
@@ -272,6 +273,7 @@ its samples and its product are stacked.
272```
273```
273
274
274---
275---
276+
275### `++not`
277### `++not`
276
278
277Binary NOT
279Binary NOT
@@ -294,8 +296,8 @@ An atom.
294#### Source
296#### Source
295
297
296```hoon
298```hoon
297− ++ not |= [a=bloq b=@ c=@]
299+++ not |= [a=bloq b=@ c=@]
298− (mix c (dec (bex (mul b (bex a)))))
300+ (mix c (dec (bex (mul b (bex a)))))
299```
301```
300
302
301#### Examples
303#### Examples
@@ -369,5 +371,4 @@ What's happening here may not be readily apparent. But we're only flipping the
369last block of size `1` (bitwidth 2) of the binary `0b111`. That is, we leave
371last block of size `1` (bitwidth 2) of the binary `0b111`. That is, we leave
370the "0b1" piece just the same and manipulate the "11" that the number ends with.
372the "0b1" piece just the same and manipulate the "11" that the number ends with.
371
373
372−
373−---
374+---
content/docs/hoon/reference/stdlib/2e.md+96−176
@@ -4,43 +4,6 @@ weight = 8
4template = "doc.html"
4template = "doc.html"
5+++
5+++
6
6
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−---
44### `++mug` {#mug}
7### `++mug` {#mug}
45
8
46murmur3 scrambler
9murmur3 scrambler
@@ -59,57 +22,70 @@ An atom.
59#### Source
22#### Source
60
23
61```hoon
24```hoon
62−++ mug :: mug with murmur3
25+++ mug
63 ~/ %mug
26 ~/ %mug
64− |= a/*
27+ |= a=*
65− |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
28+ |^ ?@ a (mum 0xcafe.babe 0x7fff a)
66− ++ trim :: 31-bit nonzero
29+ =/ b (cat 5 $(a -.a) $(a +.a))
30+ (mum 0xdead.beef 0xfffe b)
31+ ::
32+ ++ mum
33+ |= [syd=@uxF fal=@F key=@]
67− |= key/@
34+ =/ wyd (met 3 key)
68− =+ syd=0xcafe.babe
35+ =| i=@ud
69− |- ^- @
36+ |- ^- @F
37+ ?: =(8 i) fal
70− =+ haz=(muk syd (met 3 key) key)
38+ =/ haz=@F (muk syd wyd key)
71− =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
39+ =/ ham=@F (mix (rsh [0 31] haz) (end [0 31] haz))
72− ?.(=(0 ham) ham $(syd +(syd)))
40+ ?.(=(0 ham) ham $(i +(i), syd +(syd)))
73 --
41 --
74```
42```
75
43
76#### Examples
44#### Examples
77
45
78```
46```
79− > (mug 10.000)
47+> (mug 10.000)
80− 795.713.195
48+795.713.195
81−
49+```
82− > (mug 10.001)
83− 420.521.697
84
50
51+```
85− > (mug 1)
52+> (mug 10.001)
86− 1.901.865.568
53+420.521.697
54+```
87
55
56+```
88− > (mug (some 10))
57+> (mug 1)
89− 2.099.076.946
58+1.901.865.568
59+```
90
60
91− > (mug [1 2 3 4 5 ~])
61+```
92− 1.719.833.228
62+> (mug (some 10))
63+750.200.080
93```
64```
94
65
66+```
67+> (mug [1 2 3 4 5 ~])
68+1.565.443.491
69+```
95
70
96---
71---
72+
97### `++muk`
73### `++muk`
98
74
99Standard MurmurHash3
75Standard MurmurHash3
100
76
101Implementation of the 32-bit
77Implementation of the 32-bit
102[MurmurHash3](https://en.wikipedia.org/wiki/MurmurHash#Algorithm)
78[MurmurHash3](https://en.wikipedia.org/wiki/MurmurHash#Algorithm)
103−non-cryptographic hash algorithm. Takes `a` as the seed, `b` as the key length
79+non-cryptographic hash algorithm. Takes `syd` as the seed, `len` as the key length
104−in [blocks](/docs/hoon/reference/stdlib/2c) of size 3, and `c` as the key, producing an atom.
80+in [blocks](/docs/hoon/reference/stdlib/2c) of size 3, and `key` as the key, producing an atom.
105
81
106#### Accepts
82#### Accepts
107
83
108−`a` is an atom.
84+`syd` is an atom.
109
85
110−`b` is an atom.
86+`len` is an atom.
111
87
112−`c` is an atom.
88+`key` is an atom.
113
89
114#### Produces
90#### Produces
115
91
@@ -118,63 +94,63 @@ An atom.
118#### Source
94#### Source
119
95
120```hoon
96```hoon
121− ++ muk
97+++ muk :: standard murmur3
122− ~% %muk ..muk ~
98+ ~% %muk ..muk ~
123− =+ ~(. fe 5)
99+ =+ ~(. fe 5)
124− |= [syd=@ len=@ key=@]
100+ |= [syd=@ len=@ key=@]
125− ?> &((lte (met 5 syd) 1) (lte (met 0 len) 31))
101+ =. syd (end 5 syd)
126− =/ pad (sub len (met 3 key))
102+ =/ pad (sub len (met 3 key))
127− =/ data (weld (rip 3 key) (reap pad 0))
103+ =/ data (weld (rip 3 key) (reap pad 0))
128− =/ nblocks (div len 4) :: intentionally off-by-one
104+ =/ nblocks (div len 4) :: intentionally off-by-one
129− =/ h1 syd
105+ =/ h1 syd
130− =+ [c1=0xcc9e.2d51 c2=0x1b87.3593]
106+ =+ [c1=0xcc9e.2d51 c2=0x1b87.3593]
131− =/ blocks (rip 5 key)
107+ =/ blocks (rip 5 key)
132− =/ i nblocks
108+ =/ i nblocks
133− =. h1 =/ hi h1 |-
109+ =. h1 =/ hi h1 |-
110+ ?: =(0 i) hi
134− ?: =(0 i) hi :: negative array index
111+ =/ k1 (snag (sub nblocks i) blocks) :: negative array index
135− =/ k1 (snag (sub nblocks i) blocks)
136− =. k1 (sit (mul k1 c1))
112+ =. k1 (sit (mul k1 c1))
137− =. k1 (rol 0 15 k1)
113+ =. k1 (rol 0 15 k1)
138− =. k1 (sit (mul k1 c2))
114+ =. k1 (sit (mul k1 c2))
139− =. hi (mix hi k1)
115+ =. hi (mix hi k1)
140− =. hi (rol 0 13 hi)
116+ =. hi (rol 0 13 hi)
141− =. hi (sum (sit (mul hi 5)) 0xe654.6b64)
117+ =. hi (sum (sit (mul hi 5)) 0xe654.6b64)
142− $(i (dec i))
118+ $(i (dec i))
143− =/ tail (slag (mul 4 nblocks) data)
119+ =/ tail (slag (mul 4 nblocks) data)
144− =/ k1 0
120+ =/ k1 0
145− =/ tlen (dis len 3)
121+ =/ tlen (dis len 3)
146− =. h1
122+ =. h1
147− ?+ tlen h1 :: fallthrough switch
123+ ?+ tlen h1 :: fallthrough switch
148− $3 =. k1 (mix k1 (lsh 0 16 (snag 2 tail)))
124+ %3 =. k1 (mix k1 (lsh [0 16] (snag 2 tail)))
149− =. k1 (mix k1 (lsh 0 8 (snag 1 tail)))
125+ =. k1 (mix k1 (lsh [0 8] (snag 1 tail)))
150− =. k1 (mix k1 (snag 0 tail))
126+ =. k1 (mix k1 (snag 0 tail))
151− =. k1 (sit (mul k1 c1))
127+ =. k1 (sit (mul k1 c1))
152− =. k1 (rol 0 15 k1)
128+ =. k1 (rol 0 15 k1)
153− =. k1 (sit (mul k1 c2))
129+ =. k1 (sit (mul k1 c2))
154− (mix h1 k1)
130+ (mix h1 k1)
155− $2 =. k1 (mix k1 (lsh 0 8 (snag 1 tail)))
131+ %2 =. k1 (mix k1 (lsh [0 8] (snag 1 tail)))
156− =. k1 (mix k1 (snag 0 tail))
132+ =. k1 (mix k1 (snag 0 tail))
157− =. k1 (sit (mul k1 c1))
133+ =. k1 (sit (mul k1 c1))
158− =. k1 (rol 0 15 k1)
134+ =. k1 (rol 0 15 k1)
159− =. k1 (sit (mul k1 c2))
135+ =. k1 (sit (mul k1 c2))
160− (mix h1 k1)
136+ (mix h1 k1)
161− $1 =. k1 (mix k1 (snag 0 tail))
137+ %1 =. k1 (mix k1 (snag 0 tail))
162− =. k1 (sit (mul k1 c1))
138+ =. k1 (sit (mul k1 c1))
163− =. k1 (rol 0 15 k1)
139+ =. k1 (rol 0 15 k1)
164− =. k1 (sit (mul k1 c2))
140+ =. k1 (sit (mul k1 c2))
165− (mix h1 k1)
141+ (mix h1 k1)
166− ==
142+ ==
167− =. h1 (mix h1 len)
143+ =. h1 (mix h1 len)
168− |^ (fmix32 h1)
144+ |^ (fmix32 h1)
169− ++ fmix32
145+ ++ fmix32
170− |= h=@
146+ |= h=@
171− =. h (mix h (rsh 0 16 h))
147+ =. h (mix h (rsh [0 16] h))
172− =. h (sit (mul h 0x85eb.ca6b))
148+ =. h (sit (mul h 0x85eb.ca6b))
173− =. h (mix h (rsh 0 13 h))
149+ =. h (mix h (rsh [0 13] h))
174− =. h (sit (mul h 0xc2b2.ae35))
150+ =. h (sit (mul h 0xc2b2.ae35))
175− =. h (mix h (rsh 0 16 h))
151+ =. h (mix h (rsh [0 16] h))
176− h
152+ h
177− --
153+ --
178```
154```
179
155
180#### Examples
156#### Examples
@@ -209,60 +185,4 @@ An atom.
209 246.077.549
185 246.077.549
210```
186```
211
187
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−
268---
188---
content/docs/hoon/reference/stdlib/2f.md+160−282
@@ -8,7 +8,7 @@ template = "doc.html"
8
8
9Alphabetical order
9Alphabetical order
10
10
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.
12
12
13#### Accepts
13#### Accepts
14
14
@@ -23,62 +23,85 @@ A flag.
23#### Source
23#### Source
24
24
25```hoon
25```hoon
26− ++ aor
26+++ aor
27− ~/ %aor
27+ ~/ %aor
28− |= [a=* b=*]
28+ |= [a=* b=*]
29− ^- ?
29+ ^- ?
30− ?: =(a b) &
30+ ?: =(a b) &
31− ?. ?=(@ a)
31+ ?. ?=(@ a)
32− ?: ?=(@ b) |
32+ ?: ?=(@ b) |
33− ?: =(-.a -.b)
33+ ?: =(-.a -.b)
34− $(a +.a, b +.b)
34+ $(a +.a, b +.b)
35− $(a -.a, b -.b)
35+ $(a -.a, b -.b)
36− ?. ?=(@ b) &
36+ ?. ?=(@ b) &
37− |-
37+ |-
38− =+ [c=(end 3 1 a) d=(end 3 1 b)]
38+ =+ [c=(end 3 a) d=(end 3 b)]
39− ?: =(c d)
39+ ?: =(c d)
40− $(a (rsh 3 1 a), b (rsh 3 1 b))
40+ $(a (rsh 3 a), b (rsh 3 b))
41− (lth c d)
41+ (lth c d)
42```
42```
43
43
44#### Examples
44#### Examples
45
45
46```
46```
47− > (aor 'a' 'b')
47+> (aor 'a' 'b')
48− %.y
48+%.y
49−
50− > (aor 'b' 'a')
49+> (aor 'b' 'a')
51− %.n
50+%.n
52−
51+> (aor 'a' 'a')
52+%.y
53+
53− > (aor 'a' 'a')
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' ~])
54− %.y
65+%.y
55−
66+> (aor ['b' ~] ['a' ~])
56− > (aor "foo" "bar")
67+%.n
57− %.n
68+
58−
69+> (aor "abca" "abcz")
59− > (aor "bar" "foo")
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])
60− %.y
80+%.y
81+> (aor [2 1] [1 2])
82+%.n
83+```
61
84
62− > (aor "abcdefz" "abcdefa")
85+Note the possible differences with `+dor` due to comparing one byte at a time:
63− %.n
64
86
65− > (aor "abcdefa" "abcdefz")
66− %.y
67−
68− > (aor 10.000 17.000)
69− %.y
70−
71− > (aor 10 9)
72− %.n
73```
87```
88+> (aor 0b1001.0000.0000 0b1000.1000.0000)
89+%.y
90+> (dor 0b1001.0000.0000 0b1000.1000.0000)
91+%.n
92+```
93+
94+#### Discussion
74
95
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.
75
97
76---
98---
99+
77### `++dor`
100### `++dor`
78
101
79−Numeric order
102+Depth order
80
103
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.
82
105
83#### Accepts
106#### Accepts
84
107
@@ -93,62 +116,71 @@ A flag.
93#### Source
116#### Source
94
117
95```hoon
118```hoon
96− ++ dor
119+++ dor
97− ~/ %dor
120+ ~/ %dor
98− |= [a=* b=*]
121+ |= [a=* b=*]
99− ^- ?
122+ ^- ?
100− ?: =(a b) &
123+ ?: =(a b) &
101− ?. ?=(@ a)
124+ ?. ?=(@ a)
102− ?: ?=(@ b) |
125+ ?: ?=(@ b) |
103− ?: =(-.a -.b)
126+ ?: =(-.a -.b)
104− $(a +.a, b +.b)
127+ $(a +.a, b +.b)
105− $(a -.a, b -.b)
128+ $(a -.a, b -.b)
106− ?. ?=(@ b) &
129+ ?. ?=(@ b) &
107− (lth a b)
130+ (lth a b)
108```
131```
109
132
110#### Examples
133#### Examples
111
134
112```
135```
113− > (dor 1 2)
136+> (dor 1 2)
114− %.y
137+%.y
115
138
116− > (dor 2 1)
139+> (dor 2 1)
117− %.n
140+%.n
118
141
119− > (dor ~[1 2 3] ~[1 2 4])
142+> (dor ~[1 2 3] ~[1 2 4])
120− %.y
143+%.y
121
144
122− > (dor ~[1 2 4] ~[1 2 3])
145+> (dor ~[1 2 4] ~[1 2 3])
123− %.n
146+%.n
124
147
125− > (dor `(list @)`~[99 100 10.000] ~[99 101 10.000])
148+> (dor `(list @)`~[99 100 10.000] ~[99 101 10.000])
126− %.y
149+%.y
127
150
128− > (dor ~[99 101 10.999] `(list @)`~[99 100 10.000])
151+> (dor ~[99 101 10.999] `(list @)`~[99 100 10.000])
129− %.n
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
130```
162```
131
163
132#### Discussion
164#### Discussion
133
165
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
135cells, `dor` recurses on the heads, and then if the heads are the same it checks
167cells, `dor` recurses on the heads, and then if the heads are the same it checks
136the tails.
168the tails.
137
169
138If one sample is a cell and the other is an atom, the cell sample is treated as
170If one sample is a cell and the other is an atom, the cell sample is treated as
139"greater."
171"greater."
140
172
141−
142---
173---
174+
143### `++gor`
175### `++gor`
144
176
145−Hash order
177+Mug order
146
178
147Computes whether of `(mug a)` and `(mug b)` are in ascending numeric order,
179Computes whether of `(mug a)` and `(mug b)` are in ascending numeric order,
148producing a flag. If the `mug` hashes are equal, `a` and `b` are compared by
180producing a flag. If the `mug` hashes are equal, `a` and `b` are compared by
149`dor` instead.
181`dor` instead.
150
182
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.
152
184
153#### Accepts
185#### Accepts
154
186
@@ -163,223 +195,70 @@ A flag.
163#### Source
195#### Source
164
196
165```hoon
197```hoon
166− ++ gor
198+++ gor
167− ~/ %gor
199+ ~/ %gor
168− |= [a=* b=*]
200+ |= [a=* b=*]
169− ^- ?
201+ ^- ?
170− =+ [c=(mug a) d=(mug b)]
202+ =+ [c=(mug a) d=(mug b)]
171− ?: =(c d)
203+ ?: =(c d)
172− (dor a b)
204+ (dor a b)
173− (lth c d)
205+ (lth c d)
174```
206```
175
207
176#### Examples
208#### Examples
177
209
178```
210```
179− > (gor 'd' 'c')
211+> (gor 'd' 'c')
180− %.y
212+%.y
181−
213+
182− > 'd'
214+> 'd'
183− 'd'
215+'d'
184−
185− > 'c'
216+> 'c'
186− 'c'
217+'c'
187−
218+
188− > `@ud`'d'
219+> `@ud`'d'
189− 100
220+100
190−
191− > `@ud`'c'
221+> `@ud`'c'
192− 99
222+99
193−
223+
194− > (mug 'd')
224+> (mug 'd')
195− 1.628.185.714
225+1.628.185.714
196−
197− > (mug 'c')
226+> (mug 'c')
198− 1.712.073.811
227+1.712.073.811
199−
228+
200− > (gor 'd' 'c')
229+> (gor 'd' 'c')
201− %.y
230+%.y
202−
203− > (gor 'c' 'd')
231+> (gor 'c' 'd')
204− %.n
232+%.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−
262```
233```
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
289
234
290− > (gor `(list @)`[0 ~] 1)
291− %.n
292−
293− > (hor `(list @)`[50 500 5.000 ~] 1)
294− %.n
295```
235```
296−
236+> (gor "foo" "bar")
297−#### Discussion
237+%.n
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)
335```
238```
336
239
337−#### Examples
338−
339```
240```
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 ~])
241+> (gor (some 10) `(list @)`[1 2 3 ~])
356− %.y
357−
358− > (lor [2 2 5] [1 5 9 8])
359− %.n
242+%.n
360−
361− > (lor [1 5 8] [1 5 9 8])
362− %.y
363−
364− > (lor [1 2 3] [1 2])
365− !! exit
366```
243```
367
244
368#### Discussion
245#### Discussion
369
246
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.
371
250
372---
251---
373−### `++vor`
374
252
253+### `++mor`
254+
375−Vertical order
255+(more) mug order
376
256
377Computes whether the double-hashes `(mug (mug a))` and `(mug (mug b))` are in
257Computes whether the double-hashes `(mug (mug a))` and `(mug (mug b))` are in
378ascending numeric order, producing a flag. If the double-`mug` hashes are
258ascending numeric order, producing a flag. If the double-`mug` hashes are
379equal, `a` and `b` are compared by `dor` instead.
259equal, `a` and `b` are compared by `dor` instead.
380
260
381−[`mug`](/docs/hoon/reference/stdlib/2e) is the the 31-bit nonzero FNV-1a hash algorithm.
261+[`mug`](/docs/hoon/reference/stdlib/2e#mug) is the the 31-bit nonzero FNV-1a hash algorithm.
382−
383
262
384#### Accepts
263#### Accepts
385
264
@@ -394,20 +273,20 @@ A flag.
394#### Source
273#### Source
395
274
396```hoon
275```hoon
397− ++ vor
276+++ mor
398− ~/ %vor
277+ ~/ %mor
399− |= [a=* b=*]
278+ |= [a=* b=*]
400− ^- ?
279+ ^- ?
401− =+ [c=(mug (mug a)) d=(mug (mug b))]
280+ =+ [c=(mug (mug a)) d=(mug (mug b))]
402− ?: =(c d)
281+ ?: =(c d)
403− (dor a b)
282+ (dor a b)
404− (lth c d)
283+ (lth c d)
405```
284```
406
285
407#### Examples
286#### Examples
408
287
409```
288```
410− > (vor 'f' 'g')
289+ > (mor 'f' 'g')
411 %.y
290 %.y
412
291
413 > [(mug 'f') (mug 'g')]
292 > [(mug 'f') (mug 'g')]
@@ -416,22 +295,21 @@ A flag.
416 > [(mug (mug 'f')) (mug (mug 'g'))]
295 > [(mug (mug 'f')) (mug (mug 'g'))]
417 [261.421.509 1.861.258.547]
296 [261.421.509 1.861.258.547]
418
297
419− > (vor 'a' 'z')
298+ > (mor 'a' 'z')
420 %.n
299 %.n
421
300
422− > (vor 43.326 41.106)
301+ > (mor 43.326 41.106)
423 %.n
302 %.n
424```
303```
425
304
426#### Discussion
305#### Discussion
427
306
428−Maps, sets, and queues all use `vor` to check for vertical ordering. Maps and
307+Maps, sets, and queues all use `mor` to check for vertical ordering. Maps and
429−sets also use `gor` and `hor` for horizontal order, respectively, but queues use
308+sets also use `gor` for horizontal order, but queues use
430vertical ordering alone.
309vertical ordering alone.
431
310
432−Since hashing removes correlation, double-`mug`ging with `vor` removes
311+Since hashing removes correlation, double-`mug`ging with `mor` removes
433−correlation with single-`mug`ged `hor`. Vertical order becomes uncorrelated
312+correlation with single-`mug`ged `gor`. Vertical order becomes uncorrelated
434with horizontal order.
313with horizontal order.
435
314
436−
437−---
315+---
content/docs/hoon/reference/stdlib/2g.md+24−24
@@ -21,14 +21,14 @@ An atom.
21#### Source
21#### Source
22
22
23```hoon
23```hoon
24− ++ pow
24+++ pow
25− ~/ %pow
25+ ~/ %pow
26− |= [a=@ b=@]
26+ |= [a=@ b=@]
27− ?: =(b 0) 1
27+ ?: =(b 0) 1
28− |- ?: =(b 1) a
28+ |- ?: =(b 1) a
29− =+ c=$(b (div b 2))
29+ =+ c=$(b (div b 2))
30− =+ d=(mul c c)
30+ =+ d=(mul c c)
31− ?~ (dis b 1) d (mul d a)
31+ ?~ (dis b 1) d (mul d a)
32```
32```
33
33
34#### Examples
34#### Examples
@@ -51,6 +51,7 @@ An atom.
51```
51```
52
52
53---
53---
54+
54### `++sqt`
55### `++sqt`
55
56
56Computes the square root of `a` and its remainder.
57Computes the square root of `a` and its remainder.
@@ -66,20 +67,20 @@ A cell of atoms.
66#### Source
67#### Source
67
68
68```hoon
69```hoon
69− ++ sqt
70+++ sqt
70− ~/ %sqt
71+ ~/ %sqt
71− |= a=@ ^- [p=@ q=@]
72+ |= a=@ ^- [p=@ q=@]
72− ?~ a [0 0]
73+ ?~ a [0 0]
73− =+ [q=(div (dec (xeb a)) 2) r=0]
74+ =+ [q=(div (dec (xeb a)) 2) r=0]
74− =- [-.b (sub a +.b)]
75+ =- [-.b (sub a +.b)]
75− ^= b |-
76+ ^= b |-
76− =+ s=(add r (bex q))
77+ =+ s=(add r (bex q))
77− =+ t=(mul s s)
78+ =+ t=(mul s s)
78− ?: =(q 0)
79+ ?: =(q 0)
79− ?:((lte t a) [s t] [r (mul r r)])
80+ ?:((lte t a) [s t] [r (mul r r)])
80− ?: (lte t a)
81+ ?: (lte t a)
81− $(r s, q (dec q))
82+ $(r s, q (dec q))
82− $(q (dec q))
83+ $(q (dec q))
83```
84```
84
85
85#### Examples
86#### Examples
@@ -101,5 +102,4 @@ A cell of atoms.
101 ! exit
102 ! exit
102```
103```
103
104
104−
105−---
105+---
content/docs/hoon/reference/stdlib/2h.md+345−345
@@ -4,7 +4,7 @@ weight = 11
4template = "doc.html"
4template = "doc.html"
5+++
5+++
6
6
7−### `++in`
7+## `++in`
8
8
9Set operations
9Set operations
10
10
@@ -18,16 +18,16 @@ A `set`.
18#### Source
18#### Source
19
19
20```hoon
20```hoon
21− ++ in
22− ~/ %in
21+ ~/ %in
23− |_ a=(set)
22+ =| a=(tree)
23+ |@
24```
24```
25
25
26#### Examples
26#### Examples
27
27
28```
28```
29− > ~(. in (sy "asd"))
29+> ~(. in (sy "asd"))
30− <13.evb [nlr(^$1{@tD $1}) <414.fvk 101.jzo 1.ypj %164>]>
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>]>
31```
31```
32
32
33### `++all:in`
33### `++all:in`
@@ -39,9 +39,9 @@ flag.
39
39
40#### Accepts
40#### Accepts
41
41
42−`a` is a `set`.
42+`a` is a `set`, and is the sample of `+in`.
43
43
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.
45
45
46#### Produces
46#### Produces
47
47
@@ -50,28 +50,27 @@ A flag.
50#### Source
50#### Source
51
51
52```hoon
52```hoon
53− ++ all :: logical AND
53+++ all
54− ~/ %all
54+ ~/ %all
55− |* b=$-(* ?)
55+ |* b=$-(* ?)
56− |- ^- ?
56+ |- ^- ?
57− ?~ a
57+ ?~ a
58− &
58+ &
59− ?&((b n.a) $(a l.a) $(a r.a))
59+ ?&((b n.a) $(a l.a) $(a r.a))
60```
60```
61
61
62#### Examples
62#### Examples
63
63
64```
64```
65− > =b (sy `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
65+> (~(all in (silt ~[1 2 3 4])) |=(a=@ (lth a 5)))
66− > (~(all in b) |=(a=* ?@(+.a & |)))
66+%.y
67− %.n
68
67
69− > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
70− > (~(all in b) |=(a=@t (gte a 100)))
68+> (~(all in (silt ~[1 2 3 4 5])) |=(a=@ (lth a 5)))
71− %.y
69+%.n
72```
70```
73
71
74---
72---
73+
75### `++any:in`
74### `++any:in`
76
75
77Logical OR
76Logical OR
@@ -81,7 +80,7 @@ flag.
81
80
82#### Accepts
81#### Accepts
83
82
84−`a` is a `set`.
83+`a` is a `set`, and is the sample of `+in`.
85
84
86`b` is a gate that accepts a noun and produces a flag.
85`b` is a gate that accepts a noun and produces a flag.
87
86
@@ -92,28 +91,27 @@ A flag.
92#### Source
91#### Source
93
92
94```hoon
93```hoon
95− ++ any :: logical OR
94+++ any
96− ~/ %any
95+ ~/ %any
97− |* b=$-(* ?)
96+ |* b=$-(* ?)
98− |- ^- ?
97+ |- ^- ?
99− ?~ a
98+ ?~ a
100− |
99+ |
101− ?|((b n.a) $(a l.a) $(a r.a))
100+ ?|((b n.a) $(a l.a) $(a r.a))
102```
101```
103
102
104#### Examples
103#### Examples
105
104
106```
105```
107− > =b (sy `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
108− > (~(any in b) |=(a/* ?@(+.a & |)))
106+> (~(any in (silt ~[2 3 4 5])) |=(a=@ (lth a 3)))
109− %.y
107+%.y
110
108
111− > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
112− > (~(any in b) |=(a=@t (lte a 100)))
109+> (~(any in (silt ~[3 4 5])) |=(a=@ (lth a 3)))
113− %.n
110+%.n
114```
111```
115
112
116---
113---
114+
117### `++apt:in`
115### `++apt:in`
118
116
119Check correctness
117Check correctness
@@ -132,36 +130,38 @@ A flag.
132#### Source
130#### Source
133
131
134```hoon
132```hoon
135− ++ apt :: check correctness
133+++ apt
136− =< $
134+ =< $
137− ~/ %apt
135+ ~/ %apt
138− =| [l=(unit) r=(unit)]
136+ =| [l=(unit) r=(unit)]
139− |. ^- ?
137+ |. ^- ?
140− ?~ a &
138+ ?~ a &
141− ?& ?~(l & (gor n.a u.l))
139+ ?& ?~(l & (gor n.a u.l))
142− ?~(r & (gor u.r n.a))
140+ ?~(r & (gor u.r n.a))
143− ?~(l.a & ?&((mor n.a n.l.a) $(a l.a, l `n.a)))
141+ ?~(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)))
142+ ?~(r.a & ?&((mor n.a n.r.a) $(a r.a, r `n.a)))
145− ==
143+ ==
146```
144```
147
145
148#### Examples
146#### Examples
149
147
150```
148```
151− > ~(apt in ~)
149+> ~(apt in ~)
152− %.y
150+%.y
151+```
153
152
153+```
154− > =a (sy [1 2 3 4 5 6 ~])
154+> =a (silt ~[1 2 3])
155− > a
155+> a
156− [n=6 l={5 4} r={1 3 2}]
156+[n=2 l={1} r={3}]
157− > ~(apt in a)
157+> ~(apt in a)
158− %.y
158+%.y
159
159
160− > =z ?~ a ~ a(n 7)
160+> =z ?~(a ~ a(n 10))
161− > z
161+> z
162− [n=7 l={5 4} r={1 3 2}]
162+[n=10 l={1} r={3}]
163− > ~(apt in z)
163+> ~(apt in z)
164− %.n
164+%.n
165```
165```
166
166
167#### Discussion
167#### Discussion
@@ -169,15 +169,16 @@ A flag.
169See section [`2f`](/docs/hoon/reference/stdlib/2f) for more information on noun ordering.
169See section [`2f`](/docs/hoon/reference/stdlib/2f) for more information on noun ordering.
170
170
171---
171---
172+
172### `++bif:in`
173### `++bif:in`
173
174
174Bifurcate
175Bifurcate
175
176
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`.
177
178
178#### Accepts
179#### Accepts
179
180
180−`a` is a set.
181+`a` is a set, and is the sample of `+in`.
181
182
182`b` is a noun.
183`b` is a noun.
183
184
@@ -188,40 +189,45 @@ A cell of two sets.
188#### Source
189#### Source
189
190
190```hoon
191```hoon
191− ++ bif :: splits a by b
192+++ bif
192− ~/ %bif
193+ ~/ %bif
193− |* b=*
194+ |* b=*
194− ^+ [l=a r=a]
195+ ^+ [l=a r=a]
195− =< +
196+ =< +
196− |- ^+ a
197+ |- ^+ a
197− ?~ a
198+ ?~ a
198− [b ~ ~]
199+ [b ~ ~]
199− ?: =(b n.a)
200+ ?: =(b n.a)
200− a
201+ a
201− ?: (gor b n.a)
202+ ?: (gor b n.a)
202− =+ c=$(a l.a)
203− ?> ?=(^ c)
204− c(r a(l r.c))
205− =+ c=$(a r.a)
203+ =+ c=$(a l.a)
206 ?> ?=(^ c)
204 ?> ?=(^ c)
205+ c(r a(l r.c))
206+ =+ c=$(a r.a)
207+ ?> ?=(^ c)
207− c(l a(r l.c))
208+ c(l a(r l.c))
208```
209```
209
210
210#### Examples
211#### Examples
211
212
212```
213```
213− > =a (sy `(list @)`[1 2 3 4 5 6 ~])
214+> =a `(set @)`(silt (gulf 1 20))
214− > a
215+> a
215− [n=6 l={5 4} r={1 3 2}]
216+{17 8 20 13 11 5 19 7 15 10 18 14 6 12 9 1 2 3 16 4}
216
217
217− > (~(bif in a) 6)
218+> (~(bif in a) 10)
218− [l=[n=4 l=[n=5 l={} r={}] r=~] r=[n=2 l=[n=1 l={} r={3}] r=~]]
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}]]
219
220
220− > (~(bif in a) 100)
221+> `[(set @) (set @)]`(~(bif in a) 10)
221− [l=[n=6 l=[n=4 l={5} r={}] r=[n=2 l={1 3} r={}]] r=~]
222+[{17 8 20 13 11 5 19 7 15} {18 14 6 12 9 1 2 3 16 4}]
222```
223```
223
224
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+
224---
229---
230+
225### `++del:in`
231### `++del:in`
226
232
227Remove noun
233Remove noun
@@ -230,7 +236,7 @@ Removes `b` from the `set` `a`.
230
236
231#### Accepts
237#### Accepts
232
238
233−`a` is a set.
239+`a` is a set, and is the sample of `+in`.
234
240
235`b` is a noun.
241`b` is a noun.
236
242
@@ -241,41 +247,48 @@ A set.
241#### Source
247#### Source
242
248
243```hoon
249```hoon
244− ++ del :: b without any a
250+++ del
245− ~/ %del
251+ ~/ %del
246− |* b=*
252+ |* b=*
247− |- ^+ a
253+ |- ^+ a
248− ?~ a
254+ ?~ a
249− ~
255+ ~
250− ?. =(b n.a)
256+ ?. =(b n.a)
251− ?: (gor b n.a)
257+ ?: (gor b n.a)
252− a(l $(a l.a))
258+ a(l $(a l.a))
253− a(r $(a r.a))
259+ a(r $(a r.a))
254− |- ^- [$?(~ _a)]
260+ |- ^- [$?(~ _a)]
255− ?~ l.a r.a
261+ ?~ l.a r.a
256− ?~ r.a l.a
262+ ?~ r.a l.a
257− ?: (mor n.l.a n.r.a)
263+ ?: (mor n.l.a n.r.a)
258− l.a(r $(l.a r.l.a))
264+ l.a(r $(l.a r.l.a))
259− r.a(l $(r.a l.r.a))
265+ r.a(l $(r.a l.r.a))
260```
266```
261
267
262−
263#### Examples
268#### Examples
264
269
265```
270```
266− > =b (sy `(list @t)`['a' 'b' 'c' ~])
267− > (~(del in b) 'a')
271+> `(set @)`(~(del in (silt ~[1 2 3 4 5])) 3)
268− [n='b' l=[n='c' l={} r={}] r=~]
272+{5 1 2 4}
273+```
269
274
270− > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
275+```
271− > (~(del in b) 'john')
276+> `(set @t)`(~(del in (silt ~['foo' 'bar' 'baz'])) 'bar')
272− [n='madeleine' l=[n='daniel' l={} r={'bonita'}] r=~]
277+{'baz' 'foo'}
278+```
273
279
274− > (~(del in b) 'susan')
280+```
275− [n='madeleine' l=[n='daniel' l={} r={'bonita'}] r=[n='john' l={} r={}]]
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+{}
276```
288```
277
289
278---
290---
291+
279### `++dif:in`
292### `++dif:in`
280
293
281Difference
294Difference
@@ -285,7 +298,7 @@ that are not in `b`.
285
298
286#### Accepts
299#### Accepts
287
300
288−`a` is a set.
301+`a` is a set, and is the sample of `+in`.
289
302
290`b` is a set.
303`b` is a set.
291
304
@@ -296,46 +309,39 @@ A set.
296#### Source
309#### Source
297
310
298```hoon
311```hoon
299− ++ dif :: difference
312+++ dif
300− ~/ %dif
313+ ~/ %dif
301− =+ b=a
314+ =+ b=a
302− |@
315+ |@
303− ++ $
316+ ++ $
304− |- ^+ a
317+ |- ^+ a
305− ?~ b
318+ ?~ b
306− a
319+ a
307− =+ c=(bif n.b)
320+ =+ c=(bif n.b)
308− ?> ?=(^ c)
321+ ?> ?=(^ c)
309− =+ d=$(a l.c, b l.b)
322+ =+ d=$(a l.c, b l.b)
310− =+ e=$(a r.c, b r.b)
323+ =+ e=$(a r.c, b r.b)
311− |- ^- [$?(~ _a)]
324+ |- ^- [$?(~ _a)]
312− ?~ d e
325+ ?~ d e
313− ?~ e d
326+ ?~ e d
314− ?: (mor n.d n.e)
327+ ?: (mor n.d n.e)
315− d(r $(d r.d))
328+ d(r $(d r.d))
316− e(l $(e l.e))
329+ e(l $(e l.e))
317− --
330+ --
318```
331```
319
332
320#### Examples
333#### Examples
321
334
322```
335```
323− > =c (sy 1 2 3 ~)
336+> =a (silt ~[1 2 3 4 5])
324− > =d (sy 2 3 4 ~)
337+> =b (silt ~[3 4])
325− > (~(dif in c) d)
326− [n=1 l=~ r=~]
327
338
328− > (~(dif in d) c)
329− [n=4 l=~ r=~]
330−
331− > `(set @ud)`(~(dif in c) d)
339+> `(set @)`(~(dif in a) b)
332− {1}
340+{5 1 2}
333−
334− > `(set @ud)`(~(dif in d) c)
335− {4}
336```
341```
337
342
338---
343---
344+
339### `++dig:in`
345### `++dig:in`
340
346
341Address b in a
347Address b in a
@@ -344,7 +350,7 @@ Produce the tree address of `b` within `a`.
344
350
345#### Accepts
351#### Accepts
346
352
347−`a` is a set.
353+`a` is a set, and is the sample of `+in`.
348
354
349`b` is a noun.
355`b` is a noun.
350
356
@@ -355,36 +361,36 @@ The `unit` of an atom.
355#### Source
361#### Source
356
362
357```hoon
363```hoon
358− ++ dig :: axis of a in b
364+++ dig
359− |= b=*
365+ |= b=*
360− =+ c=1
366+ =+ c=1
361− |- ^- (unit @)
367+ |- ^- (unit @)
362− ?~ a ~
368+ ?~ a ~
363− ?: =(b n.a) [~ u=(peg c 2)]
369+ ?: =(b n.a) [~ u=(peg c 2)]
364− ?: (gor b n.a)
370+ ?: (gor b n.a)
365− $(a l.a, c (peg c 6))
371+ $(a l.a, c (peg c 6))
366− $(a r.a, c (peg c 7))
372+ $(a r.a, c (peg c 7))
367```
373```
368
374
369−
370#### Examples
375#### Examples
371
376
372```
377```
373− > =a (sy `(list @)`[1 2 3 4 5 6 7 ~])
378+> =a (silt ~[1 2 3 4 5 6 7])
374− > `(set @)`a
375− {5 4 7 6 1 3 2}
376
379
377− > -.a
380+> -.a
378− n=6
381+n=6
379
382
380− > (~(dig in a) 7)
383+> (~(dig in a) 7)
381− [~ u=12]
384+[~ 12]
382
385
383− > (~(dig in a) 2)
386+> (~(dig in a) 2)
384− [~ u=14]
387+[~ 60]
385
388
386− > (~(dig in a) 6)
389+> (~(dig in a) 6)
387− [~ u=2]
390+[~ 2]
391+
392+> (~(dig in a) 10)
393+~
388```
394```
389
395
390#### Discussion
396#### Discussion
@@ -392,6 +398,7 @@ The `unit` of an atom.
392For more on the tree addressing system, see section [1b](/docs/hoon/reference/stdlib/1b).
398For more on the tree addressing system, see section [1b](/docs/hoon/reference/stdlib/1b).
393
399
394---
400---
401+
395### `++gas:in`
402### `++gas:in`
396
403
397Concatenate
404Concatenate
@@ -400,7 +407,7 @@ Insert the elements of a `list` `b` into a `set` `a`.
400
407
401#### Accepts
408#### Accepts
402
409
403−`a` is a set.
410+`a` is a set, and is the sample of `+in`.
404
411
405`b` is a list.
412`b` is a list.
406
413
@@ -411,31 +418,31 @@ A `set`.
411#### Source
418#### Source
412
419
413```hoon
420```hoon
414− ++ gas :: concatenate
421+++ gas
415− ~/ %gas
422+ ~/ %gas
416− |= b=(list _?>(?=(^ a) n.a))
423+ |= b=(list _?>(?=(^ a) n.a))
417− |- ^+ a
424+ |- ^+ a
418− ?~ b
425+ ?~ b
419− a
426+ a
420− $(b t.b, a (put i.b))
427+ $(b t.b, a (put i.b))
421```
428```
422
429
423#### Examples
430#### Examples
424
431
425```
432```
426− > =b `(set @t)`(sy `(list @t)`['bonita' 'madeleine' 'rudolf' 'john' ~])
433+> =a (silt ~['foo' 'bar' 'baz'])
427− > b
434+> `(set @t)`a
428− {'bonita' 'madeleine' 'rudolf' 'john'}
435+{'bar' 'baz' 'foo'}
429
436
430− > (~(gas in b) `(list @t)`['14' 'things' 'number' '1.337' ~])
437+> `(set @t)`(~(gas in a) ~['foo' 'foo' 'foo' 'foo'])
431− [n='number' l={'1.337' '14'} r={'things' 'bonita' 'madeleine' 'rudolf' 'john'}]
438+{'bar' 'baz' 'foo'}
432
439
433− > =s (sy `(list @t)`['a' 'b' 'c' 'd' 'e' ~])
440+> `(set @t)`(~(gas in a) ~['abc' 'xyz' '123'])
434− > (~(gas in s) `(list @t)`['1' '2' '3' ~])
441+{'xyz' 'bar' 'baz' 'foo' 'abc' '123'}
435− [n='e' l=[n='1' l={} r={'3' '2'}] r=[n='b' l={'d' 'a' 'c'} r={}]]
436```
442```
437
443
438---
444---
445+
439### `++has:in`
446### `++has:in`
440
447
441b in a?
448b in a?
@@ -444,7 +451,7 @@ Checks if `b` is an element of `a`, producing a flag.
444
451
445#### Accepts
452#### Accepts
446
453
447−`a` is a set.
454+`a` is a set, and is the sample of `+in`.
448
455
449`b` is a noun.
456`b` is a noun.
450
457
@@ -455,46 +462,37 @@ A flag.
455#### Source
462#### Source
456
463
457```hoon
464```hoon
458− ++ has
465+++ has
459− ~/ %has
466+ ~/ %has
460− |* b=*
467+ |* b=*
461− ^- ?
468+ ^- ?
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]
469+ %. [~ b]
474− |= b=(unit _?>(?=(^ a) n.a))
470+ |= b=(unit _?>(?=(^ a) n.a))
475− => .(b ?>(?=(^ b) u.b))
471+ => .(b ?>(?=(^ b) u.b))
476− |- ^- ?
472+ |- ^- ?
477− ?~ a
473+ ?~ a
478− |
474+ |
479− ?: =(b n.a)
475+ ?: =(b n.a)
480− &
476+ &
481− ?: (gor b n.a)
477+ ?: (gor b n.a)
482− $(a l.a)
478+ $(a l.a)
483− $(a r.a)
479+ $(a r.a)
484```
480```
485
481
486#### Examples
482#### Examples
487
483
488```
484```
489− > =a (~(gas in `(set @t)`~) `(list @t)`['a' 'b' 'c' ~])
485+> =a (silt ~[1 2 3 4 5])
490− > (~(has in a) 'a')
491− %.y
492
486
493− > (~(has in a) 'z')
487+> (~(has in a) 2)
488+%.y
489+
490+> (~(has in a) 6)
494− %.n
491+%.n
495```
492```
496
493
497---
494---
495+
498### `++int:in`
496### `++int:in`
499
497
500Intersection
498Intersection
@@ -504,7 +502,7 @@ Produces a set of the intersection between two sets of the same type,
504
502
505#### Accepts
503#### Accepts
506
504
507−`a` is a set.
505+`a` is a set, and is the sample of `+in`.
508
506
509`b` is a set.
507`b` is a set.
510
508
@@ -515,41 +513,41 @@ A `set`.
515#### Source
513#### Source
516
514
517```hoon
515```hoon
518− ++ int :: intersection
516+++ int
519− ~/ %int
517+ ~/ %int
520− =+ b=a
518+ =+ b=a
521− |@
519+ |@
522− ++ $
520+ ++ $
523− |- ^+ a
521+ |- ^+ a
524− ?~ b
522+ ?~ b
525− ~
523+ ~
526− ?~ a
524+ ?~ a
527− ~
525+ ~
528− ?. (mor n.a n.b)
526+ ?. (mor n.a n.b)
529− $(a b, b a)
527+ $(a b, b a)
530− ?: =(n.b n.a)
528+ ?: =(n.b n.a)
531− a(l $(a l.a, b l.b), r $(a r.a, b r.b))
529+ a(l $(a l.a, b l.b), r $(a r.a, b r.b))
532− ?: (gor n.b n.a)
530+ ?: (gor n.b n.a)
533− %- uni(a $(a l.a, r.b ~)) $(b r.b)
531+ %- uni(a $(a l.a, r.b ~)) $(b r.b)
534− %- uni(a $(a r.a, l.b ~)) $(b l.b)
532+ %- uni(a $(a r.a, l.b ~)) $(b l.b)
535− --
533+ --
536```
534```
537
535
538−
539#### Examples
536#### Examples
540
537
541```
538```
542− > (~(int in `(set @t)`(sy "acmo")) `(set @t)`(sy "ham"))
539+> `(set @tD)`(~(int in (silt "foobar")) (silt "bar"))
543− [n='m' l={'a'} r={}]
540+{'r' 'b' 'a'}
544
541
545− > (~(int in (sy "acmo")) ~)
542+> `(set @tD)`(~(int in (silt "foobar")) ~)
546− ~
543+{}
547
544
548− > (~(int in `(set @t)`(sy "ac")) `(set @t)`(sy "ha"))
545+> `(set @tD)`(~(int in (silt "foobar")) (silt "baz"))
549− [n='a' l={} r={}]
546+{'b' 'a'}
550```
547```
551
548
552---
549---
550+
553### `++put:in`
551### `++put:in`
554
552
555Put b in a
553Put b in a
@@ -558,7 +556,7 @@ Add an element `b` to the set `a`, producing a set.
558
556
559#### Accepts
557#### Accepts
560
558
561−`a` is a set.
559+`a` is a set, and is the sample of `+in`.
562
560
563`b` is a noun.
561`b` is a noun.
564
562
@@ -569,49 +567,48 @@ A `set`.
569#### Source
567#### Source
570
568
571```hoon
569```hoon
572− ++ put :: puts b in a, sorted
570+++ put
573− ~/ %put
571+ ~/ %put
574− |* b=*
572+ |* b=*
575− |- ^+ a
573+ |- ^+ a
576− ?~ a
574+ ?~ a
577− [b ~ ~]
575+ [b ~ ~]
578− ?: =(b n.a)
576+ ?: =(b n.a)
579− a
577+ a
580− ?: (gor b n.a)
578+ ?: (gor b n.a)
581− =+ c=$(a l.a)
579+ =+ 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)
587 ?> ?=(^ c)
580 ?> ?=(^ c)
588 ?: (mor n.a n.c)
581 ?: (mor n.a n.c)
582+ a(l c)
583+ c(r a(l r.c))
584+ =+ c=$(a r.a)
589− a(r c)
585+ ?> ?=(^ c)
586+ ?: (mor n.a n.c)
587+ a(r c)
590− c(l a(r l.c))
588+ c(l a(r l.c))
591```
589```
592
590
593#### Examples
591#### Examples
594
592
595```
593```
596− > =a (~(gas in `(set @t)`~) `(list @t)`['a' 'b' 'c' ~])
594+> `(set @)`(~(put in (silt ~[1 2 3])) 4)
597− > =b (~(put in a) 'd')
595+{1 2 3 4}
598− > `(set @t)`b
599− {'d' 'a' 'c' 'b'}
600
596
601− > -.l.+.b
597+> `(set @)`(~(put in `(set @)`~) 42)
602− n='d'
598+{42}
603```
599```
604
600
605---
601---
602+
606### `++rep:in`
603### `++rep:in`
607
604
608Accumulate
605Accumulate
609
606
610−Accumulate the elements of `a` using a gate `b`.
607+Accumulate the elements of `a` using binary gate `b`.
611
608
612#### Accepts
609#### Accepts
613
610
614−`a` is a `set`.
611+`a` is a `set`, and is the sample of `+in`.
615
612
616`b` is a gate.
613`b` is a gate.
617
614
@@ -622,26 +619,28 @@ A noun.
622#### Source
619#### Source
623
620
624```hoon
621```hoon
625− ++ rep :: reduce to product
622+++ rep
626− ~/ %rep
623+ ~/ %rep
627− |* b=_=>(~ |=([* *] +<+))
624+ |* b=_=>(~ |=([* *] +<+))
628− |-
625+ |-
629− ?~ a +<+.b
626+ ?~ a +<+.b
630− $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
627+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
631```
628```
632
629
633#### Examples
630#### Examples
634
631
635```
632```
636− > =a (~(gas in *(set @)) [1 2 3 ~])
633+> (~(rep in (silt ~[1 2 3 4 5])) add)
637− > `(set @)`a
634+b=15
638− {1 3 2}
635+```
639
636
640− > (~(rep in a) |=([a=@ b=@] (add a b)))
637+```
641− b=6
638+> `@t`(~(rep in (silt ~['foo' 'bar' 'baz'])) |=(a=[@ @] (cat 3 a)))
639+'foobarbaz'
642```
640```
643
641
644---
642---
643+
645### `++run:in`
644### `++run:in`
646
645
647Apply gate to set
646Apply gate to set
@@ -662,28 +661,29 @@ A set.
662#### Source
661#### Source
663
662
664```hoon
663```hoon
665− ++ run :: apply gate to values
664+++ run
666− ~/ %run
665+ ~/ %run
667− |* b=gate
666+ |* b=gate
668− =+ c=`(set _?>(?=(^ a) (b n.a)))`~
667+ =+ c=`(set _?>(?=(^ a) (b n.a)))`~
669− |- ?~ a c
668+ |- ?~ a c
670− =. c (~(put in c) (b n.a))
669+ =. c (~(put in c) (b n.a))
671− =. c $(a l.a, c c)
670+ =. c $(a l.a, c c)
672− $(a r.a, c c)
671+ $(a r.a, c c)
673```
672```
674
673
675#### Examples
674#### Examples
676
675
677```
676```
678− > =s (sy ~["a" "A" "b" "c"])
677+> =s (silt ~["a" "A" "b" "c"])
679− > `(set tape)`s
678+> `(set tape)`s
680− {"A" "a" "c" "b"}
679+{"A" "a" "c" "b"}
681
680
682− > (~(run in s) cuss)
681+> (~(run in s) cuss)
683− {"A" "C" "B"}
682+{"A" "C" "B"}
684```
683```
685
684
686---
685---
686+
687### `++tap:in`
687### `++tap:in`
688
688
689Set to list
689Set to list
@@ -701,29 +701,30 @@ A list.
701#### Source
701#### Source
702
702
703```hoon
703```hoon
704− ++ tap :: convert to list
704+++ tap
705− =< $
705+ =< $
706− ~/ %tap
706+ ~/ %tap
707− =+ b=`(list _?>(?=(^ a) n.a))`~
707+ =+ b=`(list _?>(?=(^ a) n.a))`~
708− |. ^+ b
708+ |. ^+ b
709− ?~ a
709+ ?~ a
710− b
710+ b
711− $(a r.a, b [n.a $(a l.a)])
711+ $(a r.a, b [n.a $(a l.a)])
712```
712```
713
713
714−
715#### Examples
714#### Examples
716
715
717```
716```
718− > =s (sy `(list @t)`['a' 'b' 'c' 'd' 'e' ~])
717+> ~(tap in (silt "foobar"))
719− > s
718+"oafbr"
720− [n='e' l={} r={'d' 'a' 'c' 'b'}]
719+```
721
720
721+```
722− > ~(tap in s)
722+> ~(tap in (silt ~[1 2 3 4 5]))
723− ~['b' 'c' 'a' 'd' 'e']
723+~[4 3 2 1 5]
724```
724```
725
725
726---
726---
727+
727### `++uni:in`
728### `++uni:in`
728
729
729Union
730Union
@@ -733,7 +734,7 @@ Produces a set of the union between two sets of the same type, `a` and
733
734
734#### Accepts
735#### Accepts
735
736
736−`a` is a set.
737+`a` is a set, and is the sample of `+in`.
737
738
738`b` is a set.
739`b` is a set.
739
740
@@ -744,47 +745,47 @@ A set.
744#### Source
745#### Source
745
746
746```hoon
747```hoon
747− ++ uni :: union
748+++ uni
748− ~/ %uni
749+ ~/ %uni
749− =+ b=a
750+ =+ b=a
750− |@
751+ |@
751− ++ $
752+ ++ $
752− ?: =(a b) a
753+ ?: =(a b) a
753− |- ^+ a
754+ |- ^+ a
754− ?~ b
755+ ?~ b
755− a
756+ a
756− ?~ a
757+ ?~ a
757− b
758+ b
758− ?: =(n.b n.a)
759+ ?: =(n.b n.a)
759− b(l $(a l.a, b l.b), r $(a r.a, b r.b))
760+ b(l $(a l.a, b l.b), r $(a r.a, b r.b))
760− ?: (mor n.a n.b)
761+ ?: (mor n.a n.b)
761− ?: (gor n.b n.a)
762+ ?: (gor n.b n.a)
762− $(l.a $(a l.a, r.b ~), b r.b)
763+ $(l.a $(a l.a, r.b ~), b r.b)
763− $(r.a $(a r.a, l.b ~), b l.b)
764+ $(r.a $(a r.a, l.b ~), b l.b)
764− ?: (gor n.a n.b)
765+ ?: (gor n.a n.b)
765− $(l.b $(b l.b, r.a ~), a r.a)
766+ $(l.b $(b l.b, r.a ~), a r.a)
766− $(r.b $(b r.b, l.a ~), a l.a)
767+ $(r.b $(b r.b, l.a ~), a l.a)
767− --
768+ --
768```
769```
769
770
770−
771#### Examples
771#### Examples
772
772
773```
773```
774− > (~(uni in `(set @t)`(sy "ac")) `(set @)`(sy "ha"))
774+> =a (silt ~[1 2 3 4 5])
775− [n='c' l={'a'} r={'h'}]
775+> =b (silt ~[4 5 6 7 8])
776
776
777− > (~(uni in `(set @t)`(sy "acmo")) ~)
777+> `(set @)`(~(uni in a) b)
778− [n='c' l={'a'} r={'m' 'o'}]
778+{8 5 7 6 1 2 3 4}
779
779
780− > (~(uni in `(set @t)`(sy "acmo")) `(set @t)`(sy "ham"))
780+> `(set @)`(~(uni in a) ~)
781− [n='c' l={'a'} r={'m' 'o' 'h'}]
781+{5 1 2 3 4}
782
782
783− > (~(uni in `(set @t)`(sy "acmo")) `(set @t)`(sy "lep"))
783+> `(set @)`(~(uni in `(set @)`~) b)
784− [n='e' l={} r={'a' 'c' 'm' 'l' 'o' 'p'}]
784+{8 5 7 6 4}
785```
785```
786
786
787---
787---
788+
788### `++wyt:in`
789### `++wyt:in`
789
790
790Set size
791Set size
@@ -802,25 +803,24 @@ An atom.
802#### Source
803#### Source
803
804
804```hoon
805```hoon
805− ++ wyt :: size of set
806+++ wyt
806− =< $
807+ =< $
807− ~% %wyt + ~
808+ ~% %wyt + ~
808− |. ^- @
809+ |. ^- @
809− ?~(a 0 +((add $(a l.a) $(a r.a))))
810+ ?~(a 0 +((add $(a l.a) $(a r.a))))
810− --
811+--
811```
812```
812
813
813−
814#### Examples
814#### Examples
815
815
816```
816```
817− > =a (~(put in (~(put in (sy)) 'a')) 'b')
818− > ~(wyt in a)
817+> ~(wyt in (silt ~[1 2 3 4]))
819− 2
818+4
819+```
820
820
821− > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
821+```
822− > ~(wyt in b)
822+> ~(wyt in `(set @)`~)
823− 4
823+0
824```
824```
825
825
826---
826---
content/docs/hoon/reference/stdlib/2i.md+720−436
@@ -4,44 +4,47 @@ weight = 12
4template = "doc.html"
4template = "doc.html"
5+++
5+++
6
6
7−### `++by`
7+## `++by`
8
8
9Map operations
9Map operations
10
10
11Container arm for map operation arms. A map is a set of key-value pairs. The
11Container arm for map operation arms. A map is a set of key-value pairs. The
12contained arms inherit its sample map, `a`.
12contained arms inherit its sample map, `a`.
13
13
14−### Accepts
14+#### Accepts
15
15
16`a` is a map.
16`a` is a map.
17
17
18#### Source
18#### Source
19
19
20```hoon
20```hoon
21− ++ by
21+++ by
22− ~/ %by
22+ ~/ %by
23− =| a=(tree (pair))
23+ =| a=(tree (pair)) :: (map)
24− =* node ?>(?=(^ a) n.a)
24+ =* node ?>(?=(^ a) n.a)
25+ |@
25```
26```
26
27
27#### Examples
28#### Examples
28
29
29```
30```
30− > ~(. by (my [%a 1] [%b 2] ~))
31+> ~(. by (malt (limo ~[a+1 b+2 c+3])))
31− < 27.zjr
32+< 27.jus
32− { a
33+ [ a
33− ?(
34+ ?(
35+ %~
34− { n/{?(p/$a p/$b) q/@ud}
36+ [ n=[?(p=%a p=%b p=%c) q=@ud]
35− l/nlr({p/?($b $a) q/@ud})
37+ l=nlr([p=?(%a %b %c) q=@ud])
36− r/nlr({p/?($b $a) q/@ud})
38+ r=nlr([p=?(%a %b %c) q=@ud])
37− }
39+ ]
38− $~
39− )
40+ )
40− <119.wim 31.ohr 1.jmk $143>
41+ <123.zao 46.hgz 1.pnw %140>
41− }
42+ ]
43+>
42```
44```
43
45
44---
46---
47+
45### `++all:by`
48### `++all:by`
46
49
47Logical AND
50Logical AND
@@ -51,9 +54,9 @@ with gate `b`.
51
54
52#### Accepts
55#### Accepts
53
56
54−`a` is a map.
57+`a` is a map, and is the sample of `+by`.
55
58
56−`b` is a wet gate.
59+`b` is a gate.
57
60
58#### Produces
61#### Produces
59
62
@@ -62,31 +65,36 @@ A flag.
62#### Source
65#### Source
63
66
64```hoon
67```hoon
65− ++ all :: logical AND
68+++ all
66− ~/ %all
69+ ~/ %all
67− |* b=$-(* ?)
70+ |* b=$-(* ?)
68− |- ^- ?
71+ |- ^- ?
69− ?~ a
72+ ?~ a
70− &
73+ &
71− ?&((b n.a) $(a l.a) $(a r.a))
74+ ?&((b q.n.a) $(a l.a) $(a r.a))
72```
75```
73
76
74#### Examples
77#### Examples
75
78
76```
79```
77− > =b (my [['a' 1] ['b' [2 3]] ~])
80+> =a (malt (limo ~[a+1 b+[2 3]]))
78− > (~(all by b) |=(a=* ?@(a & |)))
79− %.n
80
81
81− > =a (my [['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
82− > (~(all by a) |=(a=@ (lte a 6)))
82+> (~(all by a) |=(a=* ?@(a & |)))
83− %.y
83+%.n
84+```
84
85
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+
85− > (~(all by a) |=(a=@ (lte a 4)))
92+> (~(all by a) |=(a=@ (lte a 4)))
86− %.n
93+%.n
87```
94```
88
95
89---
96---
97+
90### `++any:by`
98### `++any:by`
91
99
92Logical OR
100Logical OR
@@ -96,7 +104,7 @@ gate `b`.
96
104
97#### Accepts
105#### Accepts
98
106
99−`a` is a map.
107+`a` is a map, and is the sample of `+by`.
100
108
101`b` is a wet gate.
109`b` is a wet gate.
102
110
@@ -107,28 +115,33 @@ A flag.
107#### Source
115#### Source
108
116
109```hoon
117```hoon
110− ++ any :: logical OR
118+++ any
111− ~/ %any
119+ ~/ %any
112− |* b=$-(* ?)
120+ |* b=$-(* ?)
113− |- ^- ?
121+ |- ^- ?
114− ?~ a
122+ ?~ a
115− |
123+ |
116− ?|((b q.n.a) $(a l.a) $(a r.a))
124+ ?|((b q.n.a) $(a l.a) $(a r.a))
117```
125```
118
126
119#### Examples
127#### Examples
120
128
121```
129```
122− > =b (my [['a' 1] ['b' [2 3]] ~])
130+> =a (malt (limo ~[a+1 b+[2 3]]))
123− > (~(any by b) |=(a=* ?@(a & |)))
124− %.y
125
131
132+> (~(any by a) |=(a=* ?@(a & |)))
133+%.y
134+```
135+
136+```
126− > =a (my [['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
137+> =a (malt (limo ~[a+1 b+2 c+3 d+4 e+5]))
138+
127− > (~(any by a) |=(a=@ (lte a 4)))
139+> (~(any by a) |=(a=@ (lte a 4)))
128− %.y
140+%.y
129```
141```
130
142
131---
143---
144+
132### `++apt:by`
145### `++apt:by`
133
146
134Check correctness
147Check correctness
@@ -147,35 +160,36 @@ A flag.
147#### Source
160#### Source
148
161
149```hoon
162```hoon
150− ++ apt :: check correctness
163+++ apt
151− =< $
164+ =< $
152− ~/ %apt
165+ ~/ %apt
153− =| [l=(unit) r=(unit)]
166+ =| [l=(unit) r=(unit)]
154− |. ^- ?
167+ |. ^- ?
155− ?~ a &
168+ ?~ a &
156− ?& ?~(l & &((gor p.n.a u.l) !=(p.n.a u.l)))
169+ ?& ?~(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)))
170+ ?~(r & &((gor u.r p.n.a) !=(u.r p.n.a)))
158− ?~ l.a &
171+ ?~ 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))
172+ &((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 &
173+ ?~ 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))
174+ &((mor p.n.a p.n.r.a) !=(p.n.a p.n.r.a) $(a r.a, r `p.n.a))
162− ==
175+ ==
163```
176```
164
177
165#### Examples
178#### Examples
166
179
167```
180```
168− > =a (my [['a' 1] ['b' [2 3]] ~])
181+> =a (malt `(list [@tas @])`~[a+1 b+2 c+3 d+4 e+5])
182+
169− > ~(apt by a)
183+> ~(apt by a)
170− %.y
184+%.y
185+
186+> =z ?~(a ~ a(p.n `@tas`%z))
171
187
172− > =s (my [[1 2] [3 4] ~])
173− > =z ?~ s ~ s(p.n 10)
174− > z
188+> z
175− [n=[p=10 q=2] l={} r={[p=3 q=4]}]
189+[n=[p=%z q=2] l={[p=%e q=5]} r={[p=%d q=4] [p=%a q=1] [p=%c q=3]}]
176
190
177− > ~(apt by z)
191+> ~(apt by z)
178− %.n
192+%.n
179```
193```
180
194
181#### Discussion
195#### Discussion
@@ -186,11 +200,11 @@ See section [`2f`](/docs/hoon/reference/stdlib/2f) for more information on noun
186
200
187Bifurcate
201Bifurcate
188
202
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`.
190
204
191#### Accepts
205#### Accepts
192
206
193−`a` is a map.
207+`a` is a map, and is the sample of `+by`.
194
208
195`b` is a noun.
209`b` is a noun.
196
210
@@ -203,38 +217,45 @@ A cell of two maps.
203#### Source
217#### Source
204
218
205```hoon
219```hoon
206− ++ bif :: splits a by b
220+++ bif
207− ~/ %bif
221+ ~/ %bif
208− |* [b=* c=*]
222+ |* [b=* c=*]
209− ^+ [l=a r=a]
223+ ^+ [l=a r=a]
210− =< +
224+ =< +
211− |- ^+ a
225+ |- ^+ a
212− ?~ a
226+ ?~ a
213− [[b c] ~ ~]
227+ [[b c] ~ ~]
214− ?: =(b p.n.a)
228+ ?: =(b p.n.a)
215− ?: =(c q.n.a)
229+ ?: =(c q.n.a)
216− a
230+ a
217− a(n [b c])
231+ a(n [b c])
218− ?: (gor b p.n.a)
232+ ?: (gor b p.n.a)
219− =+ d=$(a l.a)
220− ?> ?=(^ d)
221− d(r a(l r.d))
222− =+ d=$(a r.a)
233+ =+ d=$(a l.a)
223 ?> ?=(^ d)
234 ?> ?=(^ d)
235+ d(r a(l r.d))
236+ =+ d=$(a r.a)
237+ ?> ?=(^ d)
224− d(l a(r l.d))
238+ d(l a(r l.d))
225```
239```
226
240
227#### Examples
241#### Examples
228
242
229```
243```
230− > =a (my [['a' 1] ['b' 2] ['c' 3] ~])
244+> =a (malt `(list [@tas @])`~[a+1 b+2 c+3 d+4 e+5])
231
245
232− > (~(bif by a) ['b' 2])
246+> (~(bif by a) b+2)
233− [l=[n=[p='c' q=3] l=[n=[p='a' q=1] l={} r={}] r=~] r=~]
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]}]
234```
251```
235
252
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.
236
256
237---
257---
258+
238### `++del:by`
259### `++del:by`
239
260
240Delete
261Delete
@@ -243,7 +264,7 @@ Produces map `a` with the element located at key `b` removed.
243
264
244#### Accepts
265#### Accepts
245
266
246−`a` is a map.
267+`a` is a map, and is the sample of `+by`.
247
268
248`b` is a key as a noun.
269`b` is a key as a noun.
249
270
@@ -254,33 +275,112 @@ A map.
254#### Source
275#### Source
255
276
256```hoon
277```hoon
257− ++ del :: delete at key b
278+++ del
258− ~/ %del
279+ ~/ %del
259− |* b=*
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+ ++ $
260 |- ^+ a
336 |- ^+ a
261− ?~ a
337+ ?~ b
262− ~
338+ a
263− ?. =(b p.n.a)
339+ =+ c=(bif p.n.b q.n.b)
264− ?: (gor b p.n.a)
340+ ?> ?=(^ c)
265− a(l $(a l.a))
341+ =+ d=$(a l.c, b l.b)
266− a(r $(a r.a))
342+ =+ e=$(a r.c, b r.b)
267 |- ^- [$?(~ _a)]
343 |- ^- [$?(~ _a)]
268− ?~ l.a r.a
344+ ?~ d e
269− ?~ r.a l.a
345+ ?~ e d
270− ?: (mor p.n.l.a p.n.r.a)
346+ ?: (mor p.n.d p.n.e)
271− l.a(r $(l.a r.l.a))
347+ d(r $(d r.d))
272− r.a(l $(r.a l.r.a))
348+ e(l $(e l.e))
349+ --
273```
350```
274
351
275#### Examples
352#### Examples
276
353
277```
354```
278− > =b (my [['a' 1] ['b' [2 3]] ~])
355+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
279− > (~(del by b) 'a')
356+> =b `(map @tas @)`(malt (limo ~[c+3 d+4 e+5 f+6]))
280− [n=[p='b' q=[2 3]] l=~ r=~]
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]}
281```
376```
282
377
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+
283---
382---
383+
284### `++dig:by`
384### `++dig:by`
285
385
286Address of key
386Address of key
@@ -289,7 +389,7 @@ Produce the address of key `b` within map `a`.
289
389
290#### Accepts
390#### Accepts
291
391
292−`a` is a map.
392+`a` is a map, and is the sample of `+by`.
293
393
294`b` is a key as a noun.
394`b` is a key as a noun.
295
395
@@ -300,35 +400,43 @@ A unit.
300#### Source
400#### Source
301
401
302```hoon
402```hoon
303− ++ dig :: axis of b key
403+++ dig
304− |= b=*
404+ |= b=*
305− =+ c=1
405+ =+ c=1
306− |- ^- (unit @)
406+ |- ^- (unit @)
307− ?~ a ~
407+ ?~ a ~
308− ?: =(b p.n.a) [~ u=(peg c 2)]
408+ ?: =(b p.n.a) [~ u=(peg c 2)]
309− ?: (gor b p.n.a)
409+ ?: (gor b p.n.a)
310− $(a l.a, c (peg c 6))
410+ $(a l.a, c (peg c 6))
311− $(a r.a, c (peg c 7))
411+ $(a r.a, c (peg c 7))
312```
412```
313
413
314#### Examples
414#### Examples
315
415
316```
416```
317− > =b (my [['a' 1] ['b' [2 3]] ~])
417+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
418+
419+> (~(dig by a) %a)
420+[~ 252]
421+
318− > (~(dig by b) 'b')
422+> (~(dig by a) %b)
319− [~ u=2]
423+[~ 2]
424+
425+> (~(dig by a) %e)
426+~
320```
427```
321
428
322---
429---
430+
323### `++gas:by`
431### `++gas:by`
324
432
325Concatenate
433Concatenate
326
434
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`.
328
436
329#### Accepts
437#### Accepts
330
438
331−`a` is a map.
439+`a` is a map, and is the sample of `+by`.
332
440
333`b` is a list of cells of key-value nouns `p` and `q`.
441`b` is a list of cells of key-value nouns `p` and `q`.
334
442
@@ -339,27 +447,43 @@ A map.
339#### Source
447#### Source
340
448
341```hoon
449```hoon
342− ++ gas :: concatenate
450+++ gas
343− ~/ %gas
451+ ~/ %gas
344− |* b=(list [p=* q=*])
452+ |* b=(list [p=* q=*])
345− => .(b `(list _?>(?=(^ a) n.a))`b)
453+ => .(b `(list _?>(?=(^ a) n.a))`b)
346− |- ^+ a
454+ |- ^+ a
347− ?~ b
455+ ?~ b
348− a
456+ a
349− $(b t.b, a (put p.i.b q.i.b))
457+ $(b t.b, a (put p.i.b q.i.b))
350```
458```
351
459
352#### Examples
460#### Examples
353
461
354```
462```
355− > =a (my [['a' 1] ['b' 2] ~])
463+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
356− > =b [['c' 3] ['d' 4] ~]
464+> a
465+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
357
466
358− > (~(gas by a) b)
467+> `(map @tas @)`(~(gas by a) ~[e+5 f+6 g+7])
359− [n=[p='b' q=2] l=[n=[p='d' q=4] l={} r={[p='a' q=1] [p='c' q=3]}] r=~]
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]}
360```
483```
361
484
362---
485---
486+
363### `++get:by`
487### `++get:by`
364
488
365Grab unit value
489Grab unit value
@@ -368,7 +492,7 @@ Produce the unit value of the value located at key `b` within map `a`.
368
492
369#### Accepts
493#### Accepts
370
494
371−`a` is a map.
495+`a` is a map, and is the sample of `+by`.
372
496
373`b` is a key as a noun.
497`b` is a key as a noun.
374
498
@@ -379,34 +503,38 @@ A unit.
379#### Source
503#### Source
380
504
381```hoon
505```hoon
382− ++ get :: grab value by key
506+++ get
383− ~/ %get
507+ ~/ %get
384− |* b=*
508+ |* b=*
385− => .(b `_?>(?=(^ a) p.n.a)`b)
509+ => .(b `_?>(?=(^ a) p.n.a)`b)
386− |- ^- (unit _?>(?=(^ a) q.n.a))
510+ |- ^- (unit _?>(?=(^ a) q.n.a))
387− ?~ a
511+ ?~ a
388− ~
512+ ~
389− ?: =(b p.n.a)
513+ ?: =(b p.n.a)
390− (some q.n.a)
514+ (some q.n.a)
391− ?: (gor b p.n.a)
515+ ?: (gor b p.n.a)
392− $(a l.a)
516+ $(a l.a)
393− $(a r.a)
517+ $(a r.a)
394```
518```
395
519
396#### Examples
520#### Examples
397
521
398```
522```
399− > =b (my [['a' 1] ['b' [2 3]] ~])
523+> a
524+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
525+
400− > (~(get by b) 'b')
526+> (~(get by a) %a)
401− [~ u=[2 3]]
527+[~ 1]
402
528
529+> (~(get by a) %b)
530+[~ 2]
403
531
404− > =m (my [['a' 1] ['b' 2] ~])
405− > (~(get by m) 'a')
532+> (~(get by a) %z)
406− [~ u=1]
533+~
407```
534```
408
535
409---
536---
537+
410### `++got:by`
538### `++got:by`
411
539
412Assert
540Assert
@@ -416,7 +544,7 @@ exist.
416
544
417#### Accepts
545#### Accepts
418
546
419−`a` is a map.
547+`a` is a map, and is the sample of `+by`.
420
548
421`b` is a key as a noun.
549`b` is a key as a noun.
422
550
@@ -424,29 +552,33 @@ exist.
424
552
425A noun.
553A noun.
426
554
427−#### Source
555+#### Source
428
556
429```hoon
557```hoon
430− ++ got :: need value by key
558+++ got
431− |* b=*
559+ |* b=*
432− (need (get b))
560+ (need (get b))
433```
561```
434
562
435#### Examples
563#### Examples
436
564
437```
565```
438− > =m (my [['a' 1] ['b' 2] ~])
566+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
439− > m
567+> a
440− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
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
441
572
442− > (~(got by m) 'a')
573+> (~(got by a) %b)
443− 1
574+2
444
575
445− > (~(got by m) 'c')
576+> (~(got by a) %z)
446− ! exit
577+dojo: hoon expression failed
447```
578```
448
579
449---
580---
581+
450### `++gut:by`
582### `++gut:by`
451
583
452Grab value with default
584Grab value with default
@@ -456,7 +588,7 @@ key does not exist.
456
588
457#### Accepts
589#### Accepts
458
590
459−`a` is a map.
591+`a` is a map, and is the sample of `+by`.
460
592
461`b` is a key as a noun.
593`b` is a key as a noun.
462
594
@@ -469,27 +601,30 @@ A noun.
469#### Source
601#### Source
470
602
471```hoon
603```hoon
472− ++ gut :: fall value by key
604+++ gut
473− |* [b=* c=*]
605+ |* [b=* c=*]
474− (fall (get b) c)
606+ (fall (get b) c)
475−
476```
607```
477
608
478#### Examples
609#### Examples
479
610
480```
611```
481− > =m (my [['a' 1] ['b' 2] ~])
612+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
482− > m
613+> a
483− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
614+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
484
615
485− > (~(gut by m) 'a' 0)
616+> (~(gut by a) %a 9.999)
486− 1
617+1
487
618
488− > (~(gut by m) 'c' 0)
619+> (~(gut by a) %b 9.999)
489− 0
620+2
621+
622+> (~(gut by a) %z 9.999)
623+9.999
490```
624```
491
625
492---
626---
627+
493### `++has:by`
628### `++has:by`
494
629
495Key existence check
630Key existence check
@@ -498,7 +633,7 @@ Checks whether map `a` contains an element with key `b`, producing a flag.
498
633
499#### Accepts
634#### Accepts
500
635
501−`a` is a map.
636+`a` is a map, and is the sample of `+by`.
502
637
503`b` is a key as a noun.
638`b` is a key as a noun.
504
639
@@ -509,24 +644,27 @@ A flag.
509#### Source
644#### Source
510
645
511```hoon
646```hoon
512− ++ has :: key existence check
647+++ has
513− ~/ %has
648+ ~/ %has
514− |* b=*
649+ |* b=*
515− !=(~ (get b))
650+ !=(~ (get b))
516```
651```
517
652
518#### Examples
653#### Examples
519
654
520```
655```
521− > =b (my [['a' 1] ['b' [2 3]] ~])
656+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
522− > (~(has by b) 'b')
657+> a
523− %.y
658+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
524
659
525− > (~(has by b) 'c')
660+> (~(has by a) %a)
661+%.y
662+> (~(has by a) %z)
526− %.n
663+%.n
527```
664```
528
665
529---
666---
667+
530### `++int:by`
668### `++int:by`
531
669
532Intersection
670Intersection
@@ -537,7 +675,7 @@ element from map `b` is used.
537
675
538#### Accepts
676#### Accepts
539
677
540−`a` is a map.
678+`a` is a map, and is the sample of `+by`.
541
679
542`b` is a map.
680`b` is a map.
543
681
@@ -548,54 +686,113 @@ A map.
548#### Source
686#### Source
549
687
550```hoon
688```hoon
551− ++ int :: intersection
689+++ int
552− ~/ %int
690+ ~/ %int
553− =+ b=a
691+ =+ b=a
554− |@
692+ |@
555− ++ $
693+ ++ $
556− |- ^+ a
694+ |- ^+ a
557− ?~ b
695+ ?~ b
558− ~
696+ ~
559− ?~ a
697+ ?~ a
560− ~
698+ ~
561− ?: (mor p.n.a p.n.b)
699+ ?: (mor p.n.a p.n.b)
562− ?: =(p.n.b p.n.a)
700+ ?: =(p.n.b p.n.a)
563− b(l $(a l.a, b l.b), r $(a r.a, b r.b))
701+ b(l $(a l.a, b l.b), r $(a r.a, b r.b))
564− ?: (gor p.n.b p.n.a)
702+ ?: (gor p.n.b p.n.a)
565− %- uni(a $(a l.a, r.b ~)) $(b r.b)
703+ %- uni(a $(a l.a, r.b ~)) $(b r.b)
566− %- uni(a $(a r.a, l.b ~)) $(b l.b)
704+ %- uni(a $(a r.a, l.b ~)) $(b l.b)
567− ?: =(p.n.a p.n.b)
705+ ?: =(p.n.a p.n.b)
568− b(l $(b l.b, a l.a), r $(b r.b, a r.a))
706+ b(l $(b l.b, a l.a), r $(b r.b, a r.a))
569− ?: (gor p.n.a p.n.b)
707+ ?: (gor p.n.a p.n.b)
570− %- uni(a $(b l.b, r.a ~)) $(a r.a)
708+ %- uni(a $(b l.b, r.a ~)) $(a r.a)
571− %- uni(a $(b r.b, l.a ~)) $(a l.a)
709+ %- uni(a $(b r.b, l.a ~)) $(a l.a)
572− --
710+ --
573```
711```
574
712
575#### Examples
713#### Examples
576
714
577```
715```
578− > =n (my [['a' 1] ['c' 3] ~])
716+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
579− > =m (my [['a' 1] ['b' 2] ~])
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+```
580
726
581− > (~(int by m) n)
727+```
728+> =a `(map @tas @)`(malt (limo ~[a+1 b+2]))
729+> =b `(map @tas @)`(malt (limo ~[a+100 b+200]))
730+> a
582− [n=[p='a' q=1] l=~ r=~]
731+{[p=%b q=2] [p=%a q=1]}
732+> b
733+{[p=%b q=200] [p=%a q=100]}
583
734
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)
735+> `(map @tas @)`(~(int by a) b)
588− [n=[p='a' q=1] l=~ r=~]
736+{[p=%b q=200] [p=%a q=100]}
737+```
589
738
590− > =q (my [['a' 2] ['c' 2] ~])
739+---
591− > q
740+
592− [n=[p='c' q=2] l={[p='a' q=2]} r={}]
741+### `++jab:by`
593− > (~(int by p) q)
742+
594− [n=[p='a' q=2] l=~ r=~]
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
595
779
596− > =o (my [['c' 3] ['d' 4] ~])
780+```
597− > (~(int by m) o)
781+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
598− ~
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
599```
796```
600
797
601---
798---
@@ -604,14 +801,11 @@ A map.
604
801
605Set of keys
802Set of keys
606
803
607−Produces a set of all keys in map `a` that is prepended to set `b`,
804+Produces a set of all keys in map `a`.
608−which is empty by default.
609
805
610#### Accepts
806#### Accepts
611
807
612−`a` is a map.
808+`a` is a map, and is the sample of `+by`.
613−
614−`b` is a set.
615
809
616#### Produces
810#### Produces
617
811
@@ -621,8 +815,10 @@ A set.
621
815
622```hoon
816```hoon
623++ key
817++ key
818+ =< $
819+ ~/ %key
624 =+ b=`(set _?>(?=(^ a) p.n.a))`~
820 =+ b=`(set _?>(?=(^ a) p.n.a))`~
625− |- ^+ b
821+ |. ^+ b
626 ?~ a b
822 ?~ a b
627 $(a r.a, b $(a l.a, b (~(put in b) p.n.a)))
823 $(a r.a, b $(a l.a, b (~(put in b) p.n.a)))
628```
824```
@@ -630,20 +826,19 @@ A set.
630#### Examples
826#### Examples
631
827
632```
828```
633− > =m (my [['a' 1] ['b' 2] ~])
829+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
634− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
635
830
636− > ~(key by m)
831+> ~(key by a)
637− {'b' 'a'}
832+{%b %d %a %c}
638```
833```
639
834
640---
835---
641
836
642### `++mar:by`
837### `++mar:by`
643
838
644−Assert and add
839+Add with validation
645
840
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
647nonempty unit.
842nonempty unit.
648
843
649Accept a noun and a unit of a noun of the type of the map's keys and values,
844Accept 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.
652
847
653#### Accepts
848#### Accepts
654
849
655−`a` is a map.
850+`a` is a `map`, and is the sample of `+by`.
851+
852+`b` is a noun.
656
853
657−`b` is a unit.
854+`c` is a `unit`.
658
855
659#### Produces
856#### Produces
660
857
661A map.
858A map.
662
859
663−#### Assert and Add
860+#### Source
664
861
665```hoon
862```hoon
666− ++ mar :: add with validation
863+++ mar
667− |* [b=* c=(unit *)]
864+ |* [b=* c=(unit *)]
668− ?~ c
865+ ?~ c
669− (del b)
866+ (del b)
670− (put b u.c)
867+ (put b u.c)
671```
868```
672
869
673#### Examples
870#### Examples
674
871
675```
872```
676− > =m (my [['a' 1] ['b' 2] ~])
873+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
677− > (~(mar by m) 'c' (some 3))
874+> a
678− [n=[p='b' q=2] l=[n=[p='c' q=3] l=[n=[p='a' q=1] l={} r={}] r=~] r=~]
875+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
679
876
680− > (~(mar by m) 'c' ~)
877+> `(map @tas @)`(~(mar by a) %e (some 5))
681− [n=[p='b' q=2] l=[n=[p='a' q=1] l=~ r=~] r=~]
878+{[p=%e q=5] [p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
682
879
683− > (~(mar by m) 'b' ~)
880+> `(map @tas @)`(~(mar by a) %a (some 10))
684− [n=[p='a' q=1] l=~ r=~]
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]}
685```
885```
686
886
687---
887---
888+
688### `++put:by`
889### `++put:by`
689
890
690Add key-value pair
891Add key-value pair
@@ -693,7 +894,7 @@ Produces `a` with the addition of the key-value pair of `b` and `c`.
693
894
694#### Accepts
895#### Accepts
695
896
696−`a` is a map.
897+`a` is a map, and is the sample of `+by`.
697
898
698`b` is a key of the same type as the keys in `a`.
899`b` is a key of the same type as the keys in `a`.
699
900
@@ -706,51 +907,56 @@ A map.
706#### Source
907#### Source
707
908
708```hoon
909```hoon
709− ++ put :: adds key-value pair
910+++ put
710− ~/ %put
911+ ~/ %put
711− |* [b=* c=*]
912+ |* [b=* c=*]
712− |- ^+ a
913+ |- ^+ a
713− ?~ a
914+ ?~ a
714− [[b c] ~ ~]
915+ [[b c] ~ ~]
715− ?: =(b p.n.a)
916+ ?: =(b p.n.a)
716− ?: =(c q.n.a)
917+ ?: =(c q.n.a)
717− a
918+ a
718− a(n [b c])
919+ a(n [b c])
719− ?: (gor b p.n.a)
920+ ?: (gor b p.n.a)
720− =+ d=$(a l.a)
921+ =+ 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)
726 ?> ?=(^ d)
922 ?> ?=(^ d)
727 ?: (mor p.n.a p.n.d)
923 ?: (mor p.n.a p.n.d)
924+ a(l d)
925+ d(r a(l r.d))
926+ =+ d=$(a r.a)
728− a(r d)
927+ ?> ?=(^ d)
928+ ?: (mor p.n.a p.n.d)
929+ a(r d)
729− d(l a(r l.d))
930+ d(l a(r l.d))
730```
931```
731
932
732#### Examples
933#### Examples
733
934
734```
935```
735− > =m (my [['a' 1] ['b' 2] ~])
936+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3]))
736− > (~(put by ~) 'c' 3)
937+> a
737− [n=[p='b' q=2] l=[n=[p='c' q=3] l={[p='a' q=1]} r={}] r=~]
938+{[p=%b q=2] [p=%a q=1] [p=%c q=3]}
738
939
739− > (~(put by m) "zod" 26)
940+> `(map @tas @)`(~(put by a) %d 4)
740− ! nest-fail
941+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
741− ! exit
742
942
743− > (~(put by m) 'a' 2)
943+> `(map @tas @)`(~(put by a) %a 10)
744− [n=[p='b' q=2] l=[n=[p='a' q=2] l={} r={}] r=~]
944+{[p=%b q=2] [p=%a q=10] [p=%c q=3]}
745
945
746− > (put:by m 'a' 2)
946+> (~(put by a) 42 'foo')
747− {[p=[[98 2] [[97 1] 0 0] 0] q=[97 2]]}
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
748```
953```
749
954
750---
955---
956+
751### `++rep:by`
957### `++rep:by`
752
958
753−Replace by product
959+Reduce to product
754
960
755Accumulate elements of map `a` using gate `b`, producing a noun.
961Accumulate elements of map `a` using gate `b`, producing a noun.
756
962
@@ -758,7 +964,7 @@ Accumulate elements of map `a` using gate `b`, producing a noun.
758
964
759`a` is a map.
965`a` is a map.
760
966
761−`b` is a wet gate.
967+`b` is a gate.
762
968
763#### Produces
969#### Produces
764
970
@@ -767,63 +973,91 @@ A noun.
767#### Source
973#### Source
768
974
769```hoon
975```hoon
770− ++ rep :: reduce to product
976+++ rep
771− ~/ %rep
977+ ~/ %rep
772− |* b=_=>(~ |=([* *] +<+))
978+ |* b=_=>(~ |=([* *] +<+))
773− |-
979+ |-
774− ?~ a +<+.b
980+ ?~ a +<+.b
775− $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
981+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
776```
982```
777
983
778#### Examples
984#### Examples
779
985
780```
986```
781− > =m (my [['a' 1] ['b' 2] ~])
987+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
782− > (~(rep by m) |=(a=(pair * *) p.a))
988+> a
783− q=[97 1]
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
784```
997```
785
998
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+
786---
1003---
1004+
787### `++rib:by`
1005### `++rib:by`
788
1006
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.
790
1010
791#### Accepts
1011#### Accepts
792
1012
793−`a` is a map.
1013+`a` is a map, and is the sample of `+by`.
794
1014
795−`b` is a noun.
1015+`b` is a noun, and is the initial value of the accumulator.
796
1016
797−`c` is a wet gate.
1017+`c` is a gate.
798
1018
799−####
1019+#### Produces
800
1020
801−A cell of nouns.
1021+A cell of a noun and a map.
802
1022
803#### Source
1023#### Source
804
1024
805```hoon
1025```hoon
806− ++ rib :: transform + product
1026+++ rib
807− |* [b=* c=gate]
1027+ |* [b=* c=gate]
808− |- ^+ [b a]
1028+ |- ^+ [b a]
809− ?~ a [b ~]
1029+ ?~ a [b ~]
810− =+ d=(c n.a b)
1030+ =+ d=(c n.a b)
811− =. n.a +.d
1031+ =. n.a +.d
812− =+ e=$(a l.a, b -.d)
1032+ =+ e=$(a l.a, b -.d)
813− =+ f=$(a r.a, b -.e)
1033+ =+ f=$(a r.a, b -.e)
814− [-.f a(l +.e, r +.f)]
1034+ [-.f a(l +.e, r +.f)]
815```
1035```
816
1036
817#### Examples
1037#### Examples
818
1038
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+
819```
1041```
820− > =m (my [['a' 1] ['b' 2] ~])
1042+> =a `(map @t @)`(malt ~[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5]])
821− > (~(rib by m) [1 2] (con by m))
1043+> a
1044+{[p='e' q=5] [p='b' q=2] [p='d' q=4] [p='a' q=1] [p='c' q=3]}
822
1045
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]}]
824```
1053```
825
1054
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+
826---
1059---
1060+
827### `++run:by`
1061### `++run:by`
828
1062
829Transform values
1063Transform values
@@ -832,9 +1066,9 @@ Iterates over every value in map `a` using gate `b`, producing a map.
832
1066
833#### Accepts
1067#### Accepts
834
1068
835−`a` is a map.
1069+`a` is a map, and is the sample of `+by`.
836
1070
837−`b` is a wet gate.
1071+`b` is a gate.
838
1072
839#### Produces
1073#### Produces
840
1074
@@ -843,38 +1077,36 @@ A map.
843#### Source
1077#### Source
844
1078
845```hoon
1079```hoon
846− ++ run :: apply gate to values
1080+++ run
847− ~/ %run
1081+ ~/ %run
848− |* b=gate
1082+ |* b=gate
849− |-
1083+ |-
850− ?~ a a
1084+ ?~ a a
851− [n=[p=p.n.a q=(b q.n.a)] l=$(a l.a) r=$(a r.a)]
1085+ [n=[p=p.n.a q=(b q.n.a)] l=$(a l.a) r=$(a r.a)]
852```
1086```
853
1087
854#### Examples
1088#### Examples
855
1089
856```
1090```
857− > =m (my [['a' 1] ['b' 2] ~])
1091+> =a `(map @t @)`(malt ~[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5]])
858
1092
859− > ^+(m (~(run by m) dec))
1093+> `(map @t @)`(~(run by a) dec)
860− [n=[p='b' q=1] l={[p='a' q=0]} r={}]
1094+{[p='e' q=4] [p='b' q=1] [p='d' q=3] [p='a' q=0] [p='c' q=2]}
861−
862− > `(map @tas @t)`(~(run by m) (cury scot %ux))
863− {[p=%a q='0x1'] [p=%b q='0x2']}
864```
1095```
865
1096
866---
1097---
1098+
867### `++rut:by`
1099### `++rut:by`
868
1100
869Transform nodes
1101Transform nodes
870
1102
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.
872
1104
873#### Accepts
1105#### Accepts
874
1106
875−`a` is a map.
1107+`a` is a map, and is the sample of `+by`.
876
1108
877−`b` is a wet gate.
1109+`b` is a gate.
878
1110
879#### Produces
1111#### Produces
880
1112
@@ -883,32 +1115,38 @@ A map.
883#### Source
1115#### Source
884
1116
885```hoon
1117```hoon
886− ++ rut :: apply gate to nodes
1118+++ rut
887− |* b=gate
1119+ |* b=gate
888− |-
1120+ |-
889− ?~ a a
1121+ ?~ a a
890− [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
1122+ [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
891```
1123```
892
1124
893#### Examples
1125#### Examples
894
1126
895```
1127```
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]}
897```
1137```
898
1138
899---
1139---
1140+
900### `++tap:by`
1141### `++tap:by`
901
1142
902Listify pairs
1143Listify pairs
903
1144
904−Produces the list of all elements in map `a` that is prepended to list `b`,
1145+Produces the list of all elements in map `a`.
905−which is empty by default.
906
1146
907#### Accepts
1147#### Accepts
908
1148
909−`a` is a map.
1149+`a` is a map, and is the sample of `+by`.
910−
911−`b` is a list.
912
1150
913#### Produces
1151#### Produces
914
1152
@@ -917,41 +1155,37 @@ A list.
917#### Source
1155#### Source
918
1156
919```hoon
1157```hoon
920− ++ tap :: listify pairs
1158+++ tap
921− =< $
1159+ =< $
922− ~/ %tap
1160+ ~/ %tap
923− =+ b=`(list _?>(?=(^ a) n.a))`~
1161+ =+ b=`(list _?>(?=(^ a) n.a))`~
924− |. ^+ b
1162+ |. ^+ b
925− ?~ a
1163+ ?~ a
926− b
1164+ b
927− $(a r.a, b [n.a $(a l.a)])
1165+ $(a r.a, b [n.a $(a l.a)])
928```
1166```
929
1167
930#### Examples
1168#### Examples
931
1169
932```
1170```
933− > =m (my [['a' 1] ['b' 2] ~])
1171+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3] [4 4] [5 5]])
934− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
935− > `*`m
936− [[98 2] [[97 1] 0 0] 0]
937
1172
938− > ~(tap by m)
1173+> ~(tap by a)
939− ~[[p='b' q=2] [p='a' q=1]]
1174+~[[p=4 q=4] [p=3 q=3] [p=2 q=2] [p=1 q=1] [p=5 q=5]]
940− > `*`~(tap by m)
941− [[98 2] [97 1] 0]
942```
1175```
943
1176
944---
1177---
1178+
945### `++uni:by`
1179### `++uni:by`
946
1180
947−Union
1181+Union, merge
948
1182
949Produces a map of the union between the keys of `a` and `b`. If `b` shares a
1183Produces a map of the union between the keys of `a` and `b`. If `b` shares a
950key with `a`, the tuple from `b` is preserved.
1184key with `a`, the tuple from `b` is preserved.
951
1185
952#### Accepts
1186#### Accepts
953
1187
954−`a` is a map.
1188+`a` is a map, and is the sample `+by`.
955
1189
956`b` is a map.
1190`b` is a map.
957
1191
@@ -962,48 +1196,105 @@ A map.
962#### Source
1196#### Source
963
1197
964```hoon
1198```hoon
965− ++ uni :: union, merge
1199+++ uni
966− ~/ %uni
1200+ ~/ %uni
967− =+ b=a
1201+ =+ b=a
968− |@
1202+ |@
969− ++ $
1203+ ++ $
970− |- ^+ a
1204+ |- ^+ a
971− ?~ b
1205+ ?~ b
972− a
1206+ a
973− ?~ a
1207+ ?~ a
974− b
1208+ b
975− ?: =(p.n.b p.n.a)
1209+ ?: =(p.n.b p.n.a)
976− b(l $(a l.a, b l.b), r $(a r.a, b r.b))
1210+ b(l $(a l.a, b l.b), r $(a r.a, b r.b))
977− ?: (mor p.n.a p.n.b)
1211+ ?: (mor p.n.a p.n.b)
978− ?: (gor p.n.b p.n.a)
1212+ ?: (gor p.n.b p.n.a)
979− $(l.a $(a l.a, r.b ~), b r.b)
1213+ $(l.a $(a l.a, r.b ~), b r.b)
980− $(r.a $(a r.a, l.b ~), b l.b)
1214+ $(r.a $(a r.a, l.b ~), b l.b)
981− ?: (gor p.n.a p.n.b)
1215+ ?: (gor p.n.a p.n.b)
982− $(l.b $(b l.b, r.a ~), a r.a)
1216+ $(l.b $(b l.b, r.a ~), a r.a)
983− $(r.b $(b r.b, l.a ~), a l.a)
1217+ $(r.b $(b r.b, l.a ~), a l.a)
984− --
1218+ --
985```
1219```
986
1220
987#### Examples
1221#### Examples
988
1222
989```
1223```
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
991
1240
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.
993
1242
994− > (~(uni by m) o)
1243+#### Accepts
995− [n=[p='b' q=2] l=[n=[p='d' q=4] l={} r={[p='a' q=1] [p='c' q=3]}] r=~]
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+```
996
1281
997− > (~(uni by m) ~)
1282+#### Examples
998− {[p='a' q=1] [p='b' q=2]}
999
1283
1000− > n
1284+```
1285+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3]])
1286+> =b `(map @ @)`(malt ~[[3 3] [4 4] [5 5]])
1287+> a
1001− {[p='a' q=1] [p='c' q=3]}
1288+{[p=1 q=1] [p=2 q=2] [p=3 q=3]}
1002− > (~(uni by o) n)
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)))
1003− {[p='d' q=4] [p='a' q=1] [p='c' q=3]}
1293+{[p=5 q=5] [p=1 q=1] [p=2 q=2] [p=3 q=6] [p=4 q=4]}
1004```
1294```
1005
1295
1006---
1296---
1297+
1007### `++urn:by`
1298### `++urn:by`
1008
1299
1009Turn (with key)
1300Turn (with key)
@@ -1015,37 +1306,32 @@ the key and the value of each element as its sample.
1015
1306
1016`a` is a map.
1307`a` is a map.
1017
1308
1018−`b` is a wet gate that accepts two nouns.
1309+`b` is a gate that accepts two nouns.
1019
1310
1020#### Produces
1311#### Produces
1021
1312
1022−A noun.
1313+A `map`.
1023
1314
1024#### Source
1315#### Source
1025
1316
1026```hoon
1317```hoon
1027− ++ urn :: apply gate to nodes
1318+++ urn
1028− ~/ %urn
1319+ ~/ %urn
1029− |* b=$-([* *] *)
1320+ |* b=$-([* *] *)
1030− |-
1321+ |-
1031− ?~ a ~
1322+ ?~ a ~
1032− a(n n.a(q (b p.n.a q.n.a)), l $(a l.a), r $(a r.a))
1323+ a(n n.a(q (b p.n.a q.n.a)), l $(a l.a), r $(a r.a))
1033```
1324```
1034
1325
1035#### Examples
1326#### Examples
1036
1327
1037```
1328```
1038− > m
1329+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3]])
1039− {[p='a' q=1] [p='b' q=2]}
1330+> a
1040−
1041− > (~(urn by m) |=(a=(pair * *) q.a))
1042− {[p='a' q=1] [p='b' q=2]}
1331+{[p=1 q=1] [p=2 q=2] [p=3 q=3]}
1043
1332
1044− > (~(urn by m) |=(a=(pair * *) 7))
1333+> (~(urn by a) |=([k=@ v=@] (pow v 2)))
1045− {[p='a' q=7] [p='b' q=7]}
1334+{[p=1 q=1] [p=2 q=4] [p=3 q=9]}
1046−
1047− > (~(urn by m) |=(a=(pair * *) p.a))
1048− {[p='a' q=97] [p='b' q=98]}
1049```
1335```
1050
1336
1051---
1337---
@@ -1058,7 +1344,7 @@ Produce the depth of the tree map `a`.
1058
1344
1059#### Accepts
1345#### Accepts
1060
1346
1061−`a` is a map.
1347+`a` is a map, and is the sample of `+by`.
1062
1348
1063#### Produces
1349#### Produces
1064
1350
@@ -1067,28 +1353,28 @@ An atom.
1067#### Source
1353#### Source
1068
1354
1069```hoon
1355```hoon
1070− ++ wyt :: depth of map
1356+++ wyt
1071− =< $
1357+ =< $
1072− ~% %wyt + ~
1358+ ~% %wyt + ~
1073− |. ^- @
1359+ |. ^- @
1074− ?~(a 0 +((add $(a l.a) $(a r.a))))
1360+ ?~(a 0 +((add $(a l.a) $(a r.a))))
1075```
1361```
1076
1362
1077#### Examples
1363#### Examples
1078
1364
1079```
1365```
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]}
1081
1372
1082− > =o (my [['c' 3] ['d' 4] ~])
1373+> ~(wyt by a)
1374+3
1083
1375
1084− > ~(wyt by m)
1376+> ~(wyt by b)
1085− 2
1377+5
1086−
1087− > ~(wyt by o)
1088− 2
1089−
1090− > ~(wyt by (~(uni by m) o))
1091− 4
1092```
1378```
1093
1379
1094---
1380---
@@ -1097,15 +1383,12 @@ An atom.
1097
1383
1098List of values
1384List of values
1099
1385
1100−Produces a list of all values in map `a` that is prepended to list `b`,
1386+Produces a list of all values in map `a`.
1101−which is empty by default.
1102
1387
1103#### Accepts
1388#### Accepts
1104
1389
1105`a` is a map.
1390`a` is a map.
1106
1391
1107−`b` is a list.
1108−
1109#### Produces
1392#### Produces
1110
1393
1111A list.
1394A list.
@@ -1123,11 +1406,12 @@ A list.
1123#### Examples
1406#### Examples
1124
1407
1125```
1408```
1126− > =m (my [['a' 1] ['b' 2] ~])
1409+> =a `(map @t @)`(malt ~[['a' 1] ['b' 2] ['c' 3]])
1410+> a
1127− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
1411+{[p='b' q=2] [p='a' q=1] [p='c' q=3]}
1128
1412
1129− > ~(val by m)
1413+> ~(val by a)
1130− ~[1 2]
1414+~[3 1 2]
1131```
1415```
1132
1416
1133---
1417---
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).
127<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#demag' title="Parse decmal with dots"><code>++dem:ag</code></a>
127<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#demag' title="Parse decmal with dots"><code>++dem:ag</code></a>
128<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#denfl' title="Denormalizes (floating point)"><code>++den:fl</code></a>
128<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#denfl' title="Denormalizes (floating point)"><code>++den:fl</code></a>
129<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#depto' title="Maximum depth (queue)"><code>++dep:to</code></a>
129<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>
130<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#diffe' title="Difference between atoms (modular basis)"><code>++dif:fe</code></a>
131<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#diffe' title="Difference between atoms (modular basis)"><code>++dif:fe</code></a>
131<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#diffo' title='Subtraction (modular base)'><code>++dif:fo</code></a>
132<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#diffo' title='Subtraction (modular base)'><code>++dif:fo</code></a>
132<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#difin' title='Difference (set)'><code>++dif:in</code></a>
133<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).
148<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#dog' title="Optional gap"><code>++dog</code></a>
149<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#dog' title="Optional gap"><code>++dog</code></a>
149<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#doh' title="@p separator"><code>++doh</code></a>
150<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#doh' title="@p separator"><code>++doh</code></a>
150<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/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>
152<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#dot' title="Parse period"><code>++dot</code></a>
153<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#dot' title="Parse period"><code>++dot</code></a>
153<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#drgff' title="@r to decimal float"><code>++drg:ff</code></a>
154<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#drgff' title="@r to decimal float"><code>++drg:ff</code></a>
154<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#drgfl' title="Get printable decimal (signed and unsigned integer cell)"><code>++drg:fl</code></a>
155<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).
211<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fmarh' title="Fused multiplyadd (halfprecision float)"><code>++fma:rh</code></a>
212<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fmarh' title="Fused multiplyadd (halfprecision float)"><code>++fma:rh</code></a>
212<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fmars' title="Fused multiplyadd (singleprecision float)"><code>++fma:rs</code></a>
213<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fmars' title="Fused multiplyadd (singleprecision float)"><code>++fma:rs</code></a>
213<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/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>
215<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#fo' title="Modulo prime"><code>++fo</code></a>
215<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#fo' title="Modulo prime"><code>++fo</code></a>
216<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#foot' title="Cases of arms by variance model"><code>++foot</code></a>
216<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#foot' title="Cases of arms by variance model"><code>++foot</code></a>
217<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fosrh' title="@rs to @rh"><code>++fos:rh</code></a>
217<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).
239<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#getto' title="Headtail pair"><code>++get:to</code></a>
239<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#getto' title="Headtail pair"><code>++get:to</code></a>
240<a class="tooltip" href='/docs/hoon/reference/stdlib/4e/#glue' title="Skip delimiter"><code>++glue</code></a>
240<a class="tooltip" href='/docs/hoon/reference/stdlib/4e/#glue' title="Skip delimiter"><code>++glue</code></a>
241<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#gon' title="Parse long numbers"><code>++gon</code></a>
241<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>
243<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gotby' title="Assert for value (map)"><code>++got:by</code></a>
243<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gotby' title="Assert for value (map)"><code>++got:by</code></a>
244<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#grdff' title="Decimal float to @r"><code>++grd:ff</code></a>
244<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#grdff' title="Decimal float to @r"><code>++grd:ff</code></a>
245<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#grdfl' title="Decimal to float"><code>++grd:fl</code></a>
245<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).
281<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#hig' title="Parse single uppercase letter"><code>++hig</code></a>
281<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#hig' title="Parse single uppercase letter"><code>++hig</code></a>
282<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#hit' title="Parse single hexadecimal digit"><code>++hit</code></a>
282<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#hit' title="Parse single hexadecimal digit"><code>++hit</code></a>
283<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#homo' title="Homogenize list"><code>++homo</code></a>
283<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>
285<a class="tooltip" href='/docs/hoon/reference/stdlib/3c/#horyo' title="Seconds in hour"><code>++hor:yo</code></a>
284<a class="tooltip" href='/docs/hoon/reference/stdlib/3c/#horyo' title="Seconds in hour"><code>++hor:yo</code></a>
286<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#hufab' title="Parse two phonetic pairs"><code>++huf:ab</code></a>
285<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#hufab' title="Parse two phonetic pairs"><code>++huf:ab</code></a>
287<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#hunt' title="Select between two units by a rule"><code>++hunt</code></a>
286<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).
303### j
302### j
304
303
305<a class="tooltip" href='/docs/hoon/reference/stdlib/2j/#ja' title="Jar engine"><code>++ja</code></a>
304<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>
306<a class="tooltip" href='/docs/hoon/reference/stdlib/2p/#jam' title="Pack noun to atom"><code>++jam</code></a>
306<a class="tooltip" href='/docs/hoon/reference/stdlib/2p/#jam' title="Pack noun to atom"><code>++jam</code></a>
307<a class="tooltip" href='/docs/hoon/reference/stdlib/2o/#jar' title="Mold generator (jar)"><code>++jar</code></a>
307<a class="tooltip" href='/docs/hoon/reference/stdlib/2o/#jar' title="Mold generator (jar)"><code>++jar</code></a>
308<a class="tooltip" href='/docs/hoon/reference/stdlib/3c/#jesyo' title="Maximum 64bit timestamp"><code>++jes:yo</code></a>
308<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).
338<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#lipag' title="Parse IPv4 address"><code>++lip:ag</code></a>
338<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#lipag' title="Parse IPv4 address"><code>++lip:ag</code></a>
339<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#list' title="Mold constructor (list)"><code>++list</code></a>
339<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#list' title="Mold constructor (list)"><code>++list</code></a>
340<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#lone' title="Mold generator (face on mold)"><code>++lone</code></a>
340<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>
342<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#low' title="Parse lowercase letter"><code>++low</code></a>
341<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#low' title="Parse lowercase letter"><code>++low</code></a>
343<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#lsh' title="Leftshift"><code>++lsh</code></a>
342<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#lsh' title="Leftshift"><code>++lsh</code></a>
344<a class="tooltip" href='/docs/hoon/reference/stdlib/1a/#lte' title="Less than / equal (atom)"><code>++lte</code></a>
343<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).
370<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mack' title="Nock subject to unit"><code>++mack</code></a>
369<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mack' title="Nock subject to unit"><code>++mack</code></a>
371<a class="tooltip" href='/docs/hoon/reference/stdlib/2l/#malt' title="Map from list"><code>++malt</code></a>
370<a class="tooltip" href='/docs/hoon/reference/stdlib/2l/#malt' title="Map from list"><code>++malt</code></a>
372<a class="tooltip" href='/docs/hoon/reference/stdlib/2o/#map' title="Mold generator (map)"><code>++map</code></a>
371<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>
374<a class="tooltip" href='/docs/hoon/reference/stdlib/1b/#mas' title="Address within head/tail"><code>++mas</code></a>
373<a class="tooltip" href='/docs/hoon/reference/stdlib/1b/#mas' title="Address within head/tail"><code>++mas</code></a>
375<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#mask' title="Match character"><code>++mask</code></a>
374<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#mask' title="Match character"><code>++mask</code></a>
376<a class="tooltip" href='/docs/hoon/reference/stdlib/2p/#mat' title="Lengthencode"><code>++mat</code></a>
375<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).
392<a class="tooltip" href='/docs/hoon/reference/stdlib/2l/#molt' title="Map from pair list"><code>++molt</code></a>
391<a class="tooltip" href='/docs/hoon/reference/stdlib/2l/#molt' title="Map from pair list"><code>++molt</code></a>
393<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mong' title="Slam gate with sample"><code>++mong</code></a>
392<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mong' title="Slam gate with sample"><code>++mong</code></a>
394<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mook' title="Intelligently render crash annotation"><code>++mook</code></a>
393<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>
395<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#more' title="Parse list with delimiter"><code>++more</code></a>
395<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#more' title="Parse list with delimiter"><code>++more</code></a>
396<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#most' title="Parse list of at least one match"><code>++most</code></a>
396<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#most' title="Parse list of at least one match"><code>++most</code></a>
397<a class="tooltip" href='/docs/hoon/reference/stdlib/3c/#moyyo' title="Days in months of leapyear"><code>++moy:yo</code></a>
397<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).
407<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#mulrq' title="Multiply (quadprecision float)"><code>++mul:rq</code></a>
407<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#mulrq' title="Multiply (quadprecision float)"><code>++mul:rq</code></a>
408<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mule' title="Typed virtual"><code>++mule</code></a>
408<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mule' title="Typed virtual"><code>++mule</code></a>
409<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mute' title="Untyped virtual"><code>++mute</code></a>
409<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>
411<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#murn' title="Maybe transform"><code>++murn</code></a>
410<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#murn' title="Maybe transform"><code>++murn</code></a>
412<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#my' title="Map from raw noun"><code>++my</code></a>
411<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#my' title="Map from raw noun"><code>++my</code></a>
413<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#mynl' title="Construct map from nullterminated noun"><code>++my:nl</code></a>
412<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).
507<a class="tooltip" href='/docs/hoon/reference/stdlib/4k/#rendco' title="Render coin lot as tape"><code>++rend:co</code></a>
506<a class="tooltip" href='/docs/hoon/reference/stdlib/4k/#rendco' title="Render coin lot as tape"><code>++rend:co</code></a>
508<a class="tooltip" href='/docs/hoon/reference/stdlib/4k/#rentco' title="Render coin lot as span"><code>++rent:co</code></a>
507<a class="tooltip" href='/docs/hoon/reference/stdlib/4k/#rentco' title="Render coin lot as span"><code>++rent:co</code></a>
509<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rep' title="Assemble single"><code>++rep</code></a>
508<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>
511<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#repin' title="Accumulate elements (set)"><code>++rep:in</code></a>
510<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#repin' title="Accumulate elements (set)"><code>++rep:in</code></a>
512<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rev' title="Reverse"><code>++rev</code></a>
511<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rev' title="Reverse"><code>++rev</code></a>
513<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#rfat' title="(Undocumented)"><code>++rf:at</code></a>
512<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>
515<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#rigre' title="Wrap tape in / (tank)"><code>++rig:re</code></a>
514<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#rigre' title="Wrap tape in / (tank)"><code>++rig:re</code></a>
516<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rip' title="Disassemble"><code>++rip</code></a>
515<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rip' title="Disassemble"><code>++rip</code></a>
517<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#rnat' title="(Undocumented)"><code>++rn:at</code></a>
516<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).
739### u
738### u
740
739
741<a class="tooltip" href='/docs/hoon/reference/stdlib/3f/#un' title="Reversible scrambling"><code>++un</code></a>
740<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>
743<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#unifl' title="Change representation to odd"><code>++uni:fl</code></a>
742<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#unifl' title="Change representation to odd"><code>++uni:fl</code></a>
744<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#uniin' title="Union (sets)"><code>++uni:in</code></a>
743<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#uniin' title="Union (sets)"><code>++uni:in</code></a>
745<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#unit' title="Mold generator (maybe)"><code>++unit</code></a>
744<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>
746<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#urnby' title="Turn (with key) (map)"><code>++urn:by</code></a>
746<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#urnby' title="Turn (with key) (map)"><code>++urn:by</code></a>
747<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#ursab' title="Parse span characters"><code>++urs:ab</code></a>
747<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#ursab' title="Parse span characters"><code>++urs:ab</code></a>
748<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#urtab' title="Parse non_ span"><code>++urt:ab</code></a>
748<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).
757<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#vise' title="Convert during reboot"><code>++vise</code></a>
757<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#vise' title="Convert during reboot"><code>++vise</code></a>
758<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#vit' title="Parse base 64 digit"><code>++vit</code></a>
758<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#vit' title="Parse base 64 digit"><code>++vit</code></a>
759<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#vizag' title="Parse base 32 digit with dot separators"><code>++viz:ag</code></a>
759<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>
761<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#voyab' title="Parse bas, soq, or bix"><code>++voy:ab</code></a>
760<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#voyab' title="Parse bas, soq, or bix"><code>++voy:ab</code></a>
762<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#vul' title="Comments to null"><code>++vul</code></a>
761<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#vul' title="Comments to null"><code>++vul</code></a>
763<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#vumag' title="Parse base 32 string"><code>++vum:ag</code></a>
762<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).
948
947
949### 2e: insecure hashing
948### 2e: insecure hashing
950
949
951−<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#fnv' title="FNV scrambler"><code>++fnv</code></a>
952<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#mug' title="FNV1a scrambler"><code>++mug</code></a>
950<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#mug' title="FNV1a scrambler"><code>++mug</code></a>
953<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#muk' title="Standard MurmurHash3"><code>++muk</code></a>
951<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>
955
952
956### 2f: noun ordering
953### 2f: noun ordering
957
954
958<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#aor' title="Alphabetical order"><code>++aor</code></a>
955<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>
956+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#dor' title="Depth order"><code>++dor</code></a>
960−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#gor' title="Hash order"><code>++gor</code></a>
957+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#gor' title="Mug order"><code>++gor</code></a>
961−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#hor' title="Horizontal hash order"><code>++hor</code></a>
958+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#mor' title="(more) mug order"><code>++mor</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>
964
959
965### 2g: unsigned powers
960### 2g: unsigned powers
966
961
@@ -995,20 +990,24 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
995<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#aptby' title="Check correctness (map)"><code>++apt:by</code></a>
990<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#aptby' title="Check correctness (map)"><code>++apt:by</code></a>
996<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#bifby' title="Bifurcate map"><code>++bif:by</code></a>
991<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#bifby' title="Bifurcate map"><code>++bif:by</code></a>
997<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#delby' title="Delete (map)"><code>++del:by</code></a>
992<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>
998<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#digby' title="Address of key (map)"><code>++dig:by</code></a>
994<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#digby' title="Address of key (map)"><code>++dig:by</code></a>
999<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gasby' title="Concatenate (map)"><code>++gas:by</code></a>
995<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gasby' title="Concatenate (map)"><code>++gas:by</code></a>
1000<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#getby' title="Grab unit value"><code>++get:by</code></a>
996<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#getby' title="Grab unit value"><code>++get:by</code></a>
1001<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gotby' title="Assert for value (map)"><code>++got:by</code></a>
997<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gotby' title="Assert for value (map)"><code>++got:by</code></a>
1002<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#hasby' title="Key existence check (map)"><code>++has:by</code></a>
998<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#hasby' title="Key existence check (map)"><code>++has:by</code></a>
1003<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#intby' title="Intersection (map)"><code>++int:by</code></a>
999<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>
1005<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#putby' title="Add keyvalue pair (map)"><code>++put:by</code></a>
1003<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>
1004+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#repby' title="Reduce to 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>
1005+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#ribby' title="Transform + product (map)"><code>++rib:by</code></a>
1008<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#runby' title="Transform values (map)"><code>++run:by</code></a>
1006<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#runby' title="Transform values (map)"><code>++run:by</code></a>
1009<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#rutby' title="Transform nodes (map)"><code>++rut:by</code></a>
1007<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#rutby' title="Transform nodes (map)"><code>++rut:by</code></a>
1010<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#tapby' title="Listify pairs"><code>++tap:by</code></a>
1008<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>
1012<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#urnby' title="Turn (with key) (map)"><code>++urn:by</code></a>
1011<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#urnby' title="Turn (with key) (map)"><code>++urn:by</code></a>
1013<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#wytby' title="Produce depth of tree map"><code>++wyt:by</code></a>
1012<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#wytby' title="Produce depth of tree map"><code>++wyt:by</code></a>
1014
1013
lib/glossary.js+41−41
@@ -2130,6 +2130,13 @@ export const glossary = [
2130 slug: "https://urbit.org/docs/reference/library/2k/#dep-to",
2130 slug: "https://urbit.org/docs/reference/library/2k/#dep-to",
2131 desc: "Used in the Hoon standard library.",
2131 desc: "Used in the Hoon standard library.",
2132 },
2132 },
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+ },
2133 {
2140 {
2134 name: "Difference between atoms (modular basis)",
2141 name: "Difference between atoms (modular basis)",
2135 symbol: "dif:fe",
2142 symbol: "dif:fe",
@@ -2278,7 +2285,7 @@ export const glossary = [
2278 desc: "Used in the Hoon standard library.",
2285 desc: "Used in the Hoon standard library.",
2279 },
2286 },
2280 {
2287 {
2281− name: "Numeric order",
2288+ name: "Depth order",
2282 symbol: "dor",
2289 symbol: "dor",
2283 usage: "stdlib",
2290 usage: "stdlib",
2284 slug: "https://urbit.org/docs/reference/library/2f/#dor",
2291 slug: "https://urbit.org/docs/reference/library/2f/#dor",
@@ -2676,13 +2683,6 @@ export const glossary = [
2676 slug: "https://urbit.org/docs/reference/library/3b/#fma-rq",
2683 slug: "https://urbit.org/docs/reference/library/3b/#fma-rq",
2677 desc: "Used in the Hoon standard library.",
2684 desc: "Used in the Hoon standard library.",
2678 },
2685 },
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− },
2686 {
2686 {
2687 name: "Modulo prime",
2687 name: "Modulo prime",
2688 symbol: "fo",
2688 symbol: "fo",
@@ -2852,7 +2852,7 @@ export const glossary = [
2852 desc: "Used in the Hoon standard library.",
2852 desc: "Used in the Hoon standard library.",
2853 },
2853 },
2854 {
2854 {
2855− name: "Hash order",
2855+ name: "Mug order",
2856 symbol: "gor",
2856 symbol: "gor",
2857 usage: "stdlib",
2857 usage: "stdlib",
2858 slug: "https://urbit.org/docs/reference/library/2f/#gor",
2858 slug: "https://urbit.org/docs/reference/library/2f/#gor",
@@ -3124,13 +3124,6 @@ export const glossary = [
3124 slug: "https://urbit.org/docs/reference/library/2b/#homo",
3124 slug: "https://urbit.org/docs/reference/library/2b/#homo",
3125 desc: "Used in the Hoon standard library.",
3125 desc: "Used in the Hoon standard library.",
3126 },
3126 },
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− },
3134 {
3127 {
3135 name: "Seconds in hour",
3128 name: "Seconds in hour",
3136 symbol: "hor:yo",
3129 symbol: "hor:yo",
@@ -3243,6 +3236,13 @@ export const glossary = [
3243 slug: "https://urbit.org/docs/reference/library/2j/#ja",
3236 slug: "https://urbit.org/docs/reference/library/2j/#ja",
3244 desc: "Used in the Hoon standard library.",
3237 desc: "Used in the Hoon standard library.",
3245 },
3238 },
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+ },
3246 {
3246 {
3247 name: "Pack noun to atom",
3247 name: "Pack noun to atom",
3248 symbol: "jam",
3248 symbol: "jam",
@@ -3320,6 +3320,13 @@ export const glossary = [
3320 slug: "https://urbit.org/docs/reference/library/4h/#ket",
3320 slug: "https://urbit.org/docs/reference/library/4h/#ket",
3321 desc: "Used in the Hoon standard library.",
3321 desc: "Used in the Hoon standard library.",
3322 },
3322 },
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+ },
3323 {
3330 {
3324 name: "Recursive parsers",
3331 name: "Recursive parsers",
3325 symbol: "knee",
3332 symbol: "knee",
@@ -3439,13 +3446,6 @@ export const glossary = [
3439 slug: "https://urbit.org/docs/reference/library/1c/#lone",
3446 slug: "https://urbit.org/docs/reference/library/1c/#lone",
3440 desc: "Used in the Hoon standard library.",
3447 desc: "Used in the Hoon standard library.",
3441 },
3448 },
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− },
3449 {
3449 {
3450 name: "Parse lowercase letter",
3450 name: "Parse lowercase letter",
3451 symbol: "low",
3451 symbol: "low",
@@ -3643,7 +3643,7 @@ export const glossary = [
3643 desc: "Used in the Hoon standard library.",
3643 desc: "Used in the Hoon standard library.",
3644 },
3644 },
3645 {
3645 {
3646− name: "Assert and add (map)",
3646+ name: "Add with validation (map)",
3647 symbol: "mar:by",
3647 symbol: "mar:by",
3648 usage: "stdlib",
3648 usage: "stdlib",
3649 slug: "https://urbit.org/docs/reference/library/2i/#mar-by",
3649 slug: "https://urbit.org/docs/reference/library/2i/#mar-by",
@@ -3796,6 +3796,13 @@ export const glossary = [
3796 slug: "https://urbit.org/docs/reference/library/4n/#mook",
3796 slug: "https://urbit.org/docs/reference/library/4n/#mook",
3797 desc: "Used in the Hoon standard library.",
3797 desc: "Used in the Hoon standard library.",
3798 },
3798 },
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+ },
3799 {
3806 {
3800 name: "Parse list with delimiter",
3807 name: "Parse list with delimiter",
3801 symbol: "more",
3808 symbol: "more",
@@ -3901,13 +3908,6 @@ export const glossary = [
3901 slug: "https://urbit.org/docs/reference/library/4n/#mute",
3908 slug: "https://urbit.org/docs/reference/library/4n/#mute",
3902 desc: "Used in the Hoon standard library.",
3909 desc: "Used in the Hoon standard library.",
3903 },
3910 },
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− },
3911 {
3911 {
3912 name: "Maybe transform",
3912 name: "Maybe transform",
3913 symbol: "murn",
3913 symbol: "murn",
@@ -4497,7 +4497,7 @@ export const glossary = [
4497 desc: "Used in the Hoon standard library.",
4497 desc: "Used in the Hoon standard library.",
4498 },
4498 },
4499 {
4499 {
4500− name: "Replace by product (map)",
4500+ name: "Reduce to product (map)",
4501 symbol: "rep:by",
4501 symbol: "rep:by",
4502 usage: "stdlib",
4502 usage: "stdlib",
4503 slug: "https://urbit.org/docs/reference/library/2i/#rep-by",
4503 slug: "https://urbit.org/docs/reference/library/2i/#rep-by",
@@ -4518,7 +4518,7 @@ export const glossary = [
4518 desc: "Used in the Hoon standard library.",
4518 desc: "Used in the Hoon standard library.",
4519 },
4519 },
4520 {
4520 {
4521− name: "Replace values with accumulator (map)",
4521+ name: "Transform + product (map)",
4522 symbol: "rib:by",
4522 symbol: "rib:by",
4523 usage: "stdlib",
4523 usage: "stdlib",
4524 slug: "https://urbit.org/docs/reference/library/2i/#rib-by",
4524 slug: "https://urbit.org/docs/reference/library/2i/#rib-by",
@@ -6044,7 +6044,7 @@ export const glossary = [
6044 desc: "Used in the Hoon standard library.",
6044 desc: "Used in the Hoon standard library.",
6045 },
6045 },
6046 {
6046 {
6047− name: "Union (map between keys of two lists)",
6047+ name: "Union, merge (map)",
6048 symbol: "uni:by",
6048 symbol: "uni:by",
6049 usage: "stdlib",
6049 usage: "stdlib",
6050 slug: "https://urbit.org/docs/reference/library/2i/#uni-by",
6050 slug: "https://urbit.org/docs/reference/library/2i/#uni-by",
@@ -6071,6 +6071,13 @@ export const glossary = [
6071 slug: "https://urbit.org/docs/reference/library/1c/#unit",
6071 slug: "https://urbit.org/docs/reference/library/1c/#unit",
6072 desc: "Used in the Hoon standard library.",
6072 desc: "Used in the Hoon standard library.",
6073 },
6073 },
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+ },
6074 {
6081 {
6075 name: "Turn (with key) (map)",
6082 name: "Turn (with key) (map)",
6076 symbol: "urn:by",
6083 symbol: "urn:by",
@@ -6134,13 +6141,6 @@ export const glossary = [
6134 slug: "https://urbit.org/docs/reference/library/4j/#viz-ag",
6141 slug: "https://urbit.org/docs/reference/library/4j/#viz-ag",
6135 desc: "Used in the Hoon standard library.",
6142 desc: "Used in the Hoon standard library.",
6136 },
6143 },
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− },
6144 {
6144 {
6145 name: "Parse bas, soq, or bix",
6145 name: "Parse bas, soq, or bix",
6146 symbol: "voy:ab",
6146 symbol: "voy:ab",