on master help sign in
2f, 2h
8568648Henry Ault
docs/system/hoon/library/src/2f/gate/aor.md+4−3
@@ -8,7 +8,7 @@ boolean.
8Accepts
8Accepts
9-------
9-------
10
10
11−`a` is a [noun]().
11+`a` is a noun.
12
12
13`b` is a noun.
13`b` is a noun.
14
14
@@ -21,9 +21,9 @@ A boolean atom.
21Source
21Source
22------
22------
23
23
24− ++ aor :: alphabetic-order
24+ ++ aor :: a-order
25 ~/ %aor
25 ~/ %aor
26− |= [a=* b=*]
26+ |= {a/* b/*}
27 ^- ?
27 ^- ?
28 ?: =(a b) &
28 ?: =(a b) &
29 ?. ?=(@ a)
29 ?. ?=(@ a)
@@ -38,6 +38,7 @@ Source
38 $(a (rsh 3 1 a), b (rsh 3 1 b))
38 $(a (rsh 3 1 a), b (rsh 3 1 b))
39 (lth c d)
39 (lth c d)
40
40
41+
41Examples
42Examples
42--------
43--------
43
44
docs/system/hoon/library/src/2f/gate/dor.md+3−2
@@ -8,7 +8,7 @@ boolean.
8Accepts
8Accepts
9-------
9-------
10
10
11−`a` is a [noun]().
11+`a` is a noun.
12
12
13`b` is a noun.
13`b` is a noun.
14
14
@@ -22,7 +22,7 @@ Source
22
22
23 ++ dor :: d-order
23 ++ dor :: d-order
24 ~/ %dor
24 ~/ %dor
25− |= [a=* b=*]
25+ |= {a/* b/*}
26 ^- ?
26 ^- ?
27 ?: =(a b) &
27 ?: =(a b) &
28 ?. ?=(@ a)
28 ?. ?=(@ a)
@@ -33,6 +33,7 @@ Source
33 ?. ?=(@ b) &
33 ?. ?=(@ b) &
34 (lth a b)
34 (lth a b)
35
35
36+
36Examples
37Examples
37--------
38--------
38
39
docs/system/hoon/library/src/2f/gate/gor.md+4−3
@@ -7,27 +7,28 @@ XX revisit
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [noun]().
10+`a` is a noun.
11
11
12`b` is a noun.
12`b` is a noun.
13
13
14Produces
14Produces
15--------
15--------
16
16
17−A boolean [atom]().
17+A boolean atom.
18
18
19Source
19Source
20------
20------
21
21
22 ++ gor :: g-order
22 ++ gor :: g-order
23 ~/ %gor
23 ~/ %gor
24− |= [a=* b=*]
24+ |= {a/* b/*}
25 ^- ?
25 ^- ?
26 =+ [c=(mug a) d=(mug b)]
26 =+ [c=(mug a) d=(mug b)]
27 ?: =(c d)
27 ?: =(c d)
28 (dor a b)
28 (dor a b)
29 (lth c d)
29 (lth c d)
30
30
31+
31Examples
32Examples
32--------
33--------
33
34
docs/system/hoon/library/src/2f/gate/hor.md+5−3
@@ -9,14 +9,14 @@ Recursive hash comparator gate.
9Accepts
9Accepts
10-------
10-------
11
11
12−`a` is a [noun]().
12+`a` is a noun.
13
13
14`b` is a noun.
14`b` is a noun.
15
15
16Produces
16Produces
17--------
17--------
18
18
19−A boolean [atom]().
19+A boolean atom.
20
20
21
21
22Source
22Source
@@ -24,7 +24,7 @@ Source
24
24
25 ++ hor :: h-order
25 ++ hor :: h-order
26 ~/ %hor
26 ~/ %hor
27− |= [a=* b=*]
27+ |= {a/* b/*}
28 ^- ?
28 ^- ?
29 ?: ?=(@ a)
29 ?: ?=(@ a)
30 ?. ?=(@ b) &
30 ?. ?=(@ b) &
@@ -33,6 +33,8 @@ Source
33 ?: =(-.a -.b)
33 ?: =(-.a -.b)
34 (gor +.a +.b)
34 (gor +.a +.b)
35 (gor -.a -.b)
35 (gor -.a -.b)
36+ ::
37+
36
38
37Examples
39Examples
38--------
40--------
docs/system/hoon/library/src/2f/gate/vor.md+3−2
@@ -7,7 +7,7 @@ XX revisit
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is a [noun]()
10+`a` is a noun
11
11
12`b` is a noun
12`b` is a noun
13
13
@@ -19,13 +19,14 @@ Source
19
19
20 ++ vor :: v-order
20 ++ vor :: v-order
21 ~/ %vor
21 ~/ %vor
22− |= [a=* b=*]
22+ |= {a/* b/*}
23 ^- ?
23 ^- ?
24 =+ [c=(mug (mug a)) d=(mug (mug b))]
24 =+ [c=(mug (mug a)) d=(mug (mug b))]
25 ?: =(c d)
25 ?: =(c d)
26 (dor a b)
26 (dor a b)
27 (lth c d)
27 (lth c d)
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
docs/system/hoon/library/src/2h/core/in.md+75−66
@@ -3,7 +3,7 @@
3
3
4Set operations
4Set operations
5
5
6−Core whose [arm]()s contain a variety of functions that operate on [`++set`]()s. Its [sample]() accepts the input [`++set`]() to be manipulated.
6+Core whose arms contain a variety of functions that operate on `++set`s. Its sample accepts the input `++set` to be manipulated.
7
7
8Accepts
8Accepts
9-------
9-------
@@ -15,7 +15,7 @@ Source
15
15
16 ++ in :: set engine
16 ++ in :: set engine
17 ~/ %in
17 ~/ %in
18− |/ a=(set)
18+ |_ a/(set)
19
19
20Examples
20Examples
21--------
21--------
@@ -33,9 +33,9 @@ producing a boolean.
33Accepts
33Accepts
34-------
34-------
35
35
36−`a` is a [`++set`]().
36+`a` is a `++set`.
37
37
38−`b` is a [wet]() [gate]() that accepts a [noun]() and produces a boolean.
38+`b` is a wet gate that accepts a noun and produces a boolean.
39
39
40Produces
40Produces
41--------
41--------
@@ -47,21 +47,21 @@ Source
47
47
48 +- all :: logical AND
48 +- all :: logical AND
49 ~/ %all
49 ~/ %all
50− |* b=$+(* ?)
50+ |* b/$-(* ?)
51 |- ^- ?
51 |- ^- ?
52 ?~ a
52 ?~ a
53 &
53 &
54 ?&((b n.a) $(a l.a) $(a r.a))
54 ?&((b n.a) $(a l.a) $(a r.a))
55− ::
55+
56
56
57Examples
57Examples
58--------
58--------
59
59
60− ~zod/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
60+ ~zod/try=> =b (sa `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
61− ~zod/try=> (~(all in b) |=(a=* ?@(+.a & |)))
61+ ~zod/try=> (~(all in b) |=(a/* ?@(+.a & |)))
62 %.n
62 %.n
63− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
63+ ~zod/try=> =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
64− ~zod/try=> (~(all in b) |=(a=@t (gte a 100)))
64+ ~zod/try=> (~(all in b) |=(a/@t (gte a 100)))
65 %.y
65 %.y
66
66
67------------------------------------------------------------------------
67------------------------------------------------------------------------
@@ -75,9 +75,9 @@ Computes the logical OR on every element of `a` slammed with `b`.
75Accepts
75Accepts
76-------
76-------
77
77
78−`a` is a [`++set`]().
78+`a` is a `++set`.
79
79
80−`b` is a [gate]() that accepts a noun and produces a boolean.
80+`b` is a gate that accepts a noun and produces a boolean.
81
81
82Produces
82Produces
83--------
83--------
@@ -89,21 +89,22 @@ Source
89
89
90 +- any :: logical OR
90 +- any :: logical OR
91 ~/ %any
91 ~/ %any
92− |* b=$+(* ?)
92+ |* b/$-(* ?)
93 |- ^- ?
93 |- ^- ?
94 ?~ a
94 ?~ a
95 |
95 |
96 ?|((b n.a) $(a l.a) $(a r.a))
96 ?|((b n.a) $(a l.a) $(a r.a))
97 ::
97 ::
98
98
99+
99Examples
100Examples
100--------
101--------
101
102
102− ~zod/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
103+ ~zod/try=> =b (sa `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
103− ~zod/try=> (~(any in b) |=(a=* ?@(+.a & |)))
104+ ~zod/try=> (~(any in b) |=(a/* ?@(+.a & |)))
104 %.y
105 %.y
105− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
106+ ~zod/try=> =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
106− ~zod/try=> (~(any in b) |=(a=@t (lte a 100)))
107+ ~zod/try=> (~(any in b) |=(a/@t (lte a 100)))
107 %.n
108 %.n
108
109
109------------------------------------------------------------------------
110------------------------------------------------------------------------
@@ -112,14 +113,14 @@ Examples
112
113
113Remove noun
114Remove noun
114
115
115−Removes `b` from the [`++set`]() `a`.
116+Removes `b` from the `++set` `a`.
116
117
117Accepts
118Accepts
118-------
119-------
119
120
120`a` is a set.
121`a` is a set.
121
122
122−`b` is a [noun]().
123+`b` is a noun.
123
124
124Produces
125Produces
125--------
126--------
@@ -131,7 +132,7 @@ Source
131
132
132 +- del :: b without any a
133 +- del :: b without any a
133 ~/ %del
134 ~/ %del
134− |* b=*
135+ |* b/*
135 |- ^+ a
136 |- ^+ a
136 ?~ a
137 ?~ a
137 ~
138 ~
@@ -139,7 +140,7 @@ Source
139 ?: (hor b n.a)
140 ?: (hor b n.a)
140 [n.a $(a l.a) r.a]
141 [n.a $(a l.a) r.a]
141 [n.a l.a $(a r.a)]
142 [n.a l.a $(a r.a)]
142− |- ^- ?(~ _a)
143+ |- ^- {$?($~ _a)}
143 ?~ l.a r.a
144 ?~ l.a r.a
144 ?~ r.a l.a
145 ?~ r.a l.a
145 ?: (vor n.l.a n.r.a)
146 ?: (vor n.l.a n.r.a)
@@ -151,10 +152,10 @@ Source
151Examples
152Examples
152--------
153--------
153
154
154− ~zod/try=> =b (sa `(list ,@t)`['a' 'b' 'c' ~])
155+ ~zod/try=> =b (sa `(list @t)`['a' 'b' 'c' ~])
155 ~zod/try=> (~(del in b) 'a')
156 ~zod/try=> (~(del in b) 'a')
156 {'c' 'b'}
157 {'c' 'b'}
157− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
158+ ~zod/try=> =b (sa `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
158 ~zod/try=> (~(del in b) 'john')
159 ~zod/try=> (~(del in b) 'john')
159 {'bonita' 'madeleine' 'daniel'}
160 {'bonita' 'madeleine' 'daniel'}
160 ~zod/try=> (~(del in b) 'susan')
161 ~zod/try=> (~(del in b) 'susan')
@@ -171,34 +172,35 @@ Produce the axis of `b` within `a`.
171Accepts
172Accepts
172-------
173-------
173
174
174−`a` is a [`++set`]().
175+`a` is a `++set`.
175
176
176−`b` is a [noun]().
177+`b` is a noun.
177
178
178Produces
179Produces
179--------
180--------
180
181
181−The [`++unit`]() of an atom.
182+The `++unit` of an atom.
182
183
183Source
184Source
184------
185------
185
186
186 +- dig :: axis of a in b
187 +- dig :: axis of a in b
187− |= b=*
188+ |= b/*
188 =+ c=1
189 =+ c=1
189− |- ^- (unit ,@)
190+ |- ^- (unit @)
190 ?~ a ~
191 ?~ a ~
191 ?: =(b n.a) [~ u=(peg c 2)]
192 ?: =(b n.a) [~ u=(peg c 2)]
192− ?: (gor b n.a)
193+ ?: (hor b n.a)
193 $(a l.a, c (peg c 6))
194 $(a l.a, c (peg c 6))
194 $(a r.a, c (peg c 7))
195 $(a r.a, c (peg c 7))
195 ::
196 ::
196
197
197
198
199+
198Examples
200Examples
199--------
201--------
200
202
201− ~zod/try=> =a (sa `(list ,@)`[1 2 3 4 5 6 7 ~])
203+ ~zod/try=> =a (sa `(list @)`[1 2 3 4 5 6 7 ~])
202 ~zod/try=> a
204 ~zod/try=> a
203 {5 4 7 6 1 3 2}
205 {5 4 7 6 1 3 2}
204 ~zod/try=> -.a
206 ~zod/try=> -.a
@@ -216,7 +218,7 @@ Examples
216
218
217Concatenate
219Concatenate
218
220
219−Insert the elements of a [`++list`]() `b` into a [`++set`]() `a`.
221+Insert the elements of a `++list` `b` into a `++set` `a`.
220
222
221Accepts
223Accepts
222-------
224-------
@@ -235,11 +237,11 @@ Source
235
237
236 +- gas :: concatenate
238 +- gas :: concatenate
237 ~/ %gas
239 ~/ %gas
238− |= b=(list ,_?>(?=(^ a) n.a))
240+ |= b/(list _?>(?=(^ a) n.a))
239 |- ^+ a
241 |- ^+ a
240 ?~ b
242 ?~ b
241 a
243 a
242− $(b t.b, a (put(+< a) i.b))
244+ $(b t.b, a (put i.b))
243 ::
245 ::
244
246
245
247
@@ -248,7 +250,7 @@ Examples
248
250
249 ~zod/try=> b
251 ~zod/try=> b
250 {'bonita' 'madeleine' 'rudolf' 'john'}
252 {'bonita' 'madeleine' 'rudolf' 'john'}
251− ~zod/try=> (~(gas in b) `(list ,@t)`['14' 'things' 'number' '1.337' ~])
253+ ~zod/try=> (~(gas in b) `(list @t)`['14' 'things' 'number' '1.337' ~])
252 {'1.337' '14' 'number' 'things' 'bonita' 'madeleine' 'rudolf' 'john'}
254 {'1.337' '14' 'number' 'things' 'bonita' 'madeleine' 'rudolf' 'john'}
253 ~zod/try=> (~(gas in s) `(list ,@t)`['1' '2' '3' ~])
255 ~zod/try=> (~(gas in s) `(list ,@t)`['1' '2' '3' ~])
254 {'1' '3' '2' 'e' 'd' 'a' 'c' 'b'}
256 {'1' '3' '2' 'e' 'd' 'a' 'c' 'b'}
@@ -278,7 +280,7 @@ Source
278
280
279 +- has :: b exists in a check
281 +- has :: b exists in a check
280 ~/ %has
282 ~/ %has
281− |* b=*
283+ |* b/*
282 |- ^- ?
284 |- ^- ?
283 ?~ a
285 ?~ a
284 |
286 |
@@ -293,7 +295,7 @@ Source
293Examples
295Examples
294--------
296--------
295
297
296− ~zod/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~])
298+ ~zod/try=> =a (~(gas in `(set @t)`~) `(list @t)`[`a` `b` `c` ~])
297 ~zod/try=> (~(has in a) `a`)
299 ~zod/try=> (~(has in a) `a`)
298 %.y
300 %.y
299 ~zod/try=> (~(has in a) 'z')
301 ~zod/try=> (~(has in a) 'z')
@@ -305,7 +307,7 @@ Examples
305
307
306Intersection
308Intersection
307
309
308−Produces a set of the intersection between two [`++set`]()s of the same type,
310+Produces a set of the intersection between two `++set`s of the same type,
309`a` and `b`.
311`a` and `b`.
310
312
311Accepts
313Accepts
@@ -318,14 +320,14 @@ Accepts
318Produces
320Produces
319--------
321--------
320
322
321−A [`++set`]().
323+A `++set`.
322
324
323Source
325Source
324------
326------
325
327
326− +- int :: intersection
328+ +- int :: intersection
327 ~/ %int
329 ~/ %int
328− |* b=_a
330+ |* b/_a
329 |- ^+ a
331 |- ^+ a
330 ?~ b
332 ?~ b
331 ~
333 ~
@@ -336,8 +338,10 @@ Source
336 ?: =(n.b n.a)
338 ?: =(n.b n.a)
337 [n.a $(a l.a, b l.b) $(a r.a, b r.b)]
339 [n.a $(a l.a, b l.b) $(a r.a, b r.b)]
338 ?: (hor n.b n.a)
340 ?: (hor n.b n.a)
339− %- uni(+< $(a l.a, b [n.b l.b ~])) $(b r.b)
341+ %- uni(a $(a l.a, b [n.b l.b ~])) $(b r.b)
340− %- uni(+< $(a r.a, b [n.b ~ r.b])) $(b l.b)
342+ %- uni(a $(a r.a, b [n.b ~ r.b])) $(b l.b)
343+ ::
344+
341
345
342
346
343Examples
347Examples
@@ -358,26 +362,26 @@ Examples
358
362
359Put b in a
363Put b in a
360
364
361−Add an element `b` to the [`++set`]() `a`.
365+Add an element `b` to the `++set` `a`.
362
366
363Accepts
367Accepts
364-------
368-------
365
369
366`a` is a set.
370`a` is a set.
367
371
368−`b` is a [noun]().
372+`b` is a noun.
369
373
370Produces
374Produces
371--------
375--------
372
376
373−A [`++set`]().
377+A `++set`.
374
378
375Source
379Source
376------
380------
377
381
378− +- put :: puts b in a
382+ +- put :: puts b in a, sorted
379 ~/ %put
383 ~/ %put
380− |* b=*
384+ |* b/*
381 |- ^+ a
385 |- ^+ a
382 ?~ a
386 ?~ a
383 [b ~ ~]
387 [b ~ ~]
@@ -400,7 +404,7 @@ Source
400Examples
404Examples
401--------
405--------
402
406
403− ~zod/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~])
407+ ~zod/try=> =a (~(gas in `(set @t)`~) `(list @t)`[`a` `b` `c` ~])
404 ~zod/try=> =b (~(put in a) `d`)
408 ~zod/try=> =b (~(put in a) `d`)
405 ~zod/try=> b
409 ~zod/try=> b
406 {`d` `a` `c` `b`}
410 {`d` `a` `c` `b`}
@@ -413,14 +417,14 @@ Examples
413
417
414Accumulate
418Accumulate
415
419
416−Accumulate the elements of `a` using a [gate]() `c` and an accumulator `b`.
420+Accumulate the elements of `a` using a gate `c` and an accumulator `b`.
417
421
418Accepts
422Accepts
419--------
423--------
420
424
421−`a` is a [`++set`]().
425+`a` is a `++set`.
422
426
423−`b` is a [noun]().
427+`b` is a noun.
424
428
425`c` is a gate.
429`c` is a gate.
426
430
@@ -432,21 +436,21 @@ A noun.
432Source
436Source
433------
437------
434
438
435− +- rep :: replace by tile
439+ +- rep :: replace by product
436− |* [b=* c=_,*]
440+ |* b/_|=({* *} +<+)
437− |-
441+ |-
438− ?~ a b
442+ ?~ a +<+.b
439− $(a r.a, b $(a l.a, b (c n.a b)))
443+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
440− ::
444+
441
445
442
446
443Examples
447Examples
444--------
448--------
445
449
446− ~zod/try=> =a (~(gas in *(set ,@)) [1 2 3 ~])
450+ ~zod/try=> =a (~(gas in *(set @)) [1 2 3 ~])
447 ~zod/try=> a
451 ~zod/try=> a
448 {1 3 2}
452 {1 3 2}
449− ~zod/try=> (~(rep in a) 0 |=([a=@ b=@] (add a b)))
453+ ~zod/try=> (~(rep in a) 0 |=([a/@ b/@] (add a b)))
450 6
454 6
451
455
452------------------------------------------------------------------------
456------------------------------------------------------------------------
@@ -455,7 +459,7 @@ Examples
455
459
456Set to list
460Set to list
457
461
458−Flattens the [`++set`]() `a` into a [`++list`]().
462+Flattens the `++set` `a` into a `++list`.
459
463
460Accepts
464Accepts
461-------
465-------
@@ -470,23 +474,24 @@ A list.
470Source
474Source
471------
475------
472
476
473− +- tap :: list tiles a set
477+ +- tap :: convert to list
474 ~/ %tap
478 ~/ %tap
475− |= b=(list ,_?>(?=(^ a) n.a))
479+ |= b/(list _?>(?=(^ a) n.a))
476 ^+ b
480 ^+ b
477 ?~ a
481 ?~ a
478 b
482 b
479− $(a r.a, b [n.a $(a l.a)])
483+ $(a r.a b [n.a $(a l.a)])
480 ::
484 ::
481
485
482
486
487+
483Examples
488Examples
484--------
489--------
485
490
486− ~zod/try=> =s (sa `(list ,@t)`['a' 'b' 'c' 'd' 'e' ~])
491+ ~zod/try=> =s (sa `(list @t)`['a' 'b' 'c' 'd' 'e' ~])
487 ~zod/try=> s
492 ~zod/try=> s
488 {'e' 'd' 'a' 'c' 'b'}
493 {'e' 'd' 'a' 'c' 'b'}
489− ~zod/try=> (~(tap in s) `(list ,@t)`['1' '2' '3' ~])
494+ ~zod/try=> (~(tap in s) `(list @t)`['1' '2' '3' ~])
490 ~['b' 'c' 'a' 'd' 'e' '1' '2' '3']
495 ~['b' 'c' 'a' 'd' 'e' '1' '2' '3']
491 ~zod/try=> b
496 ~zod/try=> b
492 {'bonita' 'madeleine' 'daniel' 'john'}
497 {'bonita' 'madeleine' 'daniel' 'john'}
@@ -519,7 +524,8 @@ Source
519
524
520 +- uni :: union
525 +- uni :: union
521 ~/ %uni
526 ~/ %uni
522− |* b=_a
527+ |* b/_a
528+ ?: =(a b) a
523 |- ^+ a
529 |- ^+ a
524 ?~ b
530 ?~ b
525 a
531 a
@@ -536,6 +542,7 @@ Source
536 ?: (hor n.a n.b)
542 ?: (hor n.a n.b)
537 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
543 $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
538 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
544 $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
545+ ::
539
546
540
547
541Examples
548Examples
@@ -574,6 +581,8 @@ Source
574 +- wyt :: size of set
581 +- wyt :: size of set
575 |- ^- @
582 |- ^- @
576 ?~(a 0 +((add $(a l.a) $(a r.a))))
583 ?~(a 0 +((add $(a l.a) $(a r.a))))
584+ --
585+
577
586
578
587
579Examples
588Examples