1a-2c
commit42a18339cc6f016dc1a52fd1605031de05f13622
authorHenry Ault <henry@tlon.io>
dateMon 14 Mar 2016, 18:06 (11 years ago)
parente0e10ec
docs/system/hoon/library/src/1a/gate/add.md+1−1
@@ -7,7 +7,7 @@ Produces the sum of `a` and `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
docs/system/hoon/library/src/1a/gate/dec.md+2−3
@@ -7,7 +7,7 @@ Decrements `a` by `1`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212Produces
1313--------
@@ -19,14 +19,13 @@ Source
1919
2020 ++ dec :: decrement
2121 ~/ %dec
22− |= a=@
22+ |= a/@
2323 ~| %decrement-underflow
2424 ?< =(0 a)
2525 =+ b=0
2626 |- ^- @
2727 ?: =(a +(b)) b
2828 $(b +(b))
29− ::
3029
3130Examples
3231--------
docs/system/hoon/library/src/1a/gate/div.md+2−2
@@ -7,9 +7,9 @@ Computes `a` divided by `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
12−`b` is an [atom]().
12+`b` is an atom.
1313
1414Produces
1515--------
docs/system/hoon/library/src/1a/gate/gte.md+3−3
@@ -7,7 +7,7 @@ Tests whether `a` is greater than a number `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,10 +21,10 @@ Source
2121
2222 ++ gte :: greater-equal
2323 ~/ %gte
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- ?
2626 !(lth a b)
27− ::
27+
2828
2929Examples
3030--------
docs/system/hoon/library/src/1a/gate/gth.md+4−3
@@ -7,7 +7,7 @@ Tests whether `a` is greater than `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,10 +21,11 @@ Source
2121
2222 ++ gth :: greater-than
2323 ~/ %gth
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- ?
2626 !(lte a b)
27− ::
27+
28+
2829
2930Examples
3031--------
docs/system/hoon/library/src/1a/gate/lte.md+3−2
@@ -7,7 +7,7 @@ Tests whether `a` is less than or equal to `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,8 +21,9 @@ Source
2121
2222 ++ lte :: less-equal
2323 ~/ %lte
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 |(=(a b) (lth a b))
26+
2627 ::
2728
2829Examples
docs/system/hoon/library/src/1a/gate/lth.md+5−6
@@ -21,15 +21,14 @@ Source
2121
2222 ++ lth :: less-than
2323 ~/ %lth
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- ?
26− ?& !=(a b)
27− |-
28− ?| =(0 a)
29− ?& !=(0 b)
26+ ?& !=(a b)
27+ |-
28+ ?| =(0 a)
29+ ?& !=(0 b)
3030 $(a (dec a), b (dec b))
3131 == == ==
32− ::
3332
3433Examples
3534--------
docs/system/hoon/library/src/1a/gate/max.md+2−3
@@ -7,7 +7,7 @@ Computes the greater of `a` and `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,11 +21,10 @@ Source
2121
2222 ++ max :: maximum
2323 ~/ %max
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- @
2626 ?: (gth a b) a
2727 b
28− ::
2928
3029Examples
3130--------
docs/system/hoon/library/src/1a/gate/min.md+3−4
@@ -7,7 +7,7 @@ Computes the lesser of `a` and `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,12 +21,11 @@ Source
2121
2222 ++ min :: minimum
2323 ~/ %min
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- @
2626 ?: (lth a b) a
2727 b
28− ::
29−
28+
3029Examples
3130--------
3231
docs/system/hoon/library/src/1a/gate/mod.md+3−3
@@ -7,7 +7,7 @@ Computes the remainder of dividing `a` by `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,11 +21,11 @@ Source
2121
2222 ++ mod :: remainder
2323 ~/ %mod
24− |= [a=@ b=@]
24+ |: [a=`@`1 b=`@`1]
2525 ^- @
2626 ?< =(0 b)
2727 (sub a (mul b (div a b)))
28− ::
28+
2929
3030Examples
3131--------
docs/system/hoon/library/src/1a/gate/mul.md+3−4
@@ -7,7 +7,7 @@ Multiplies `a` by `b`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,14 +21,13 @@ Source
2121
2222 ++ mul :: multiply
2323 ~/ %mul
24− |= [a=@ b=@]
24+ |: [a=`@`1 b=`@`1]
2525 ^- @
2626 =+ c=0
2727 |-
2828 ?: =(0 a) c
2929 $(a (dec a), c (add b c))
30− ::
31−
30+
3231Examples
3332--------
3433
docs/system/hoon/library/src/1a/gate/sub.md+9−9
@@ -7,9 +7,9 @@ Subtracts `b` from `a`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
12−`b` is an [atom]().
12+`b` is an atom.
1313
1414Produces
1515--------
@@ -19,13 +19,13 @@ An atom.
1919Source
2020------
2121
22− ++ sub :: subtract
23− ~/ %sub
24− |= [a=@ b=@]
25− ~| %subtract-underflow
26− ^- @
27− ?: =(0 b) a
28− $(a (dec a), b (dec b))
22+ ++ sub :: subtract
23+ ~/ %sub
24+ |= [a=@ b=@]
25+ ~| %subtract-underflow
26+ ^- @
27+ ?: =(0 b) a
28+ $(a (dec a), b (dec b))
2929
3030Examples
3131--------
docs/system/hoon/library/src/1b/gate/cap.md+14−14
@@ -2,8 +2,8 @@
22
33Tree head
44
5−Tests whether an `a` is in the head or tail of a [noun](). Produces the
6−[cube]() `%2` if it is within the head, or the cube `%3` if it is
5+Tests whether an `a` is in the head or tail of a noun. Produces the
6+cube `%2` if it is within the head, or the cube `%3` if it is
77within the tail.
88
99Accepts
@@ -14,22 +14,22 @@ Accepts
1414Produces
1515--------
1616
17−A [cube]().
17+A cube.
1818
1919Source
2020------
2121
22− ++ cap :: tree head
23− ~/ %cap
24− |= a=@
25− ^- ?(%2 %3)
26− ?- a
27− %2 %2
28− %3 %3
29− ?(%0 %1) !!
30− * $(a (div a 2))
31− ==
32− ::
22+ ++ cap :: tree head
23+ ~/ %cap
24+ |= a=@
25+ ^- ?(%2 %3)
26+ ?- a
27+ %2 %2
28+ %3 %3
29+ ?(%0 %1) !!
30+ * $(a (div a 2))
31+ ==
32+ ::
3333
3434Examples
3535--------
docs/system/hoon/library/src/1b/gate/mas.md+11−11
@@ -17,17 +17,17 @@ An atom.
1717Source
1818------
1919
20− ++ mas :: tree body
21− ~/ %mas
22− |= a=@
23− ^- @
24− ?- a
25− 1 !!
26− 2 1
27− 3 1
28− * (add (mod a 2) (mul $(a (div a 2)) 2))
29− ==
30− ::
20+ ++ mas :: tree body
21+ ~/ %mas
22+ |= a=@
23+ ^- @
24+ ?- a
25+ 1 !!
26+ 2 1
27+ 3 1
28+ * (add (mod a 2) (mul $(a (div a 2)) 2))
29+ ==
30+ ::
3131
3232Examples
3333--------
docs/system/hoon/library/src/1b/gate/peg.md+5−6
@@ -7,7 +7,7 @@ Computes the axis of `b` within axis `a`.
77Accepts
88-------
99
10−`a` is an [atom]().
10+`a` is an atom.
1111
1212`b` is an atom.
1313
@@ -21,15 +21,14 @@ Source
2121
2222 ++ peg :: tree connect
2323 ~/ %peg
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
2525 ^- @
2626 ?- b
27− 1 a
28− 2 (mul a 2)
29− 3 +((mul a 2))
27+ $1 a
28+ $2 (mul a 2)
29+ $3 +((mul a 2))
3030 * (add (mod b 2) (mul $(b (div b 2)) 2))
3131 ==
32− ::
3332
3433Examples
3534--------
docs/system/hoon/library/src/1c/mold/bloq.md+1−2
@@ -4,11 +4,10 @@ Blocksize
44
55Atom representing a blocksize, by convention expressed as a power of 2.
66
7−
87Source
98------
109
11− ++ bloq ,@ :: blockclass
10+ ++ bloq @ :: blockclass
1211
1312Examples
1413--------
docs/system/hoon/library/src/1c/mold/each.md+7−6
@@ -2,20 +2,21 @@
22
33Mold of fork between two
44
5−[mold]() generator: produces a dicriminated [fork]() between two types.
5+mold generator: produces a dicriminated fork between two types.
66
77Source
88------
99
10− ++ each |*([a=$+(* *) b=$+(* *)] $%([& p=a] [| p=b])) :: either a or b
10+ ++ each
11+ |* {a/$-(* *) b/$-(* *)} :: either a or b
12+ $%({$& p/a} {$| p/b}) :: a default
13+
1114
1215Examples
1316--------
1417
15− ~zod/try=> :type; *(each cord time)
18+ > ? *(each cord time)
19+ ?({$.y p/@t} {$.n p/@da})
1620 [%.y p='']
17− {[%.y p=@t] [%.n p=@da]}
18−
19−
2021
2122***
docs/system/hoon/library/src/1c/mold/gate.md+9−11
@@ -3,28 +3,26 @@
33Function
44
55A core with one arm, `$`--the empty name--which transforms a sample noun into a product
6−noun. If used [dryly]() as a type, the [subject]() must have a sample type of [`*`]().
6+noun. If used dryly as a type, the subject must have a sample type of `*`.
77
88
99Source
1010------
1111
12− ++ gate $+(* *) :: general gate
12+ ++ gate $-(* *) :: general gate
13+
1314
1415Examples
1516--------
1617
17−See also: [`++lift`](), [`++cork`]()
18+See also: `++lift`, `++cork`
1819
19− ~zod/try=> *gate
20− <1|mws [* <101.jzo 1.ypj %164>]>
21− ~zod/try=> `gate`|=(* 0)
22− <1|mws [* <101.jzo 1.ypj %164>]>
20+ > ? gate
21+ <1.ybc {* <110.jyx 1.ztu $151>}>
22+ <1.ybc {* <110.jyx 1.ztu $151>}>
2323
24− ~zod/try=> (|=(a=* [a 'b']) 'c')
25− [99 'b']
26− ~zod/try=> (`gate`|=(a=* [a 'b']) 'c')
27− [99 98]
24+ > (`gate`|=(a/* [a 'b']) 1)
25+ [1 'b']
2826
2927
3028
docs/system/hoon/library/src/1c/mold/list.md+9−7
@@ -2,26 +2,28 @@
22
33List
44
5−[mold]() generator. `++list` generates a mold of a null-termanated list of a
5+mold generator. `++list` generates a mold of a null-termanated list of a
66homogenous type.
77
88
99Source
1010------
1111
12− ++ list |* a=_,* :: null-term list
12+ ++ list |* a/$-(* *) :: null-term list
13+ $@($~ {i/a t/(list a)}) ::
14+
1315
1416Examples
1517--------
1618
17−See also: [`++turn`](), [`++snag`]()
19+See also: `++turn`, `++snag`
1820
19− ~zod/try=> *(list)
21+ > *(list)
2022 ~
21− ~zod/try=> `(list ,@)`"abc"
23+ > `(list @)`"abc"
2224 ~[97 98 99]
23− ~zod/try=> (snag 0 "abc")
24− ~~a
25+ > (snag 0 "abc")
26+ 'a'
2527
2628
2729
docs/system/hoon/library/src/1c/mold/lone.md+2−4
@@ -1,14 +1,12 @@
11### `++lone`
22
3−Tile generator. `++lone` puts face of `p` on something.
3+`++lone` puts face of `p` on something.
44
55XX unused
66
77Source
88------
99
10− ++ lone |*(a=$+(* *) ,p=a) :: just one thing
11−
12−
10+ ++ lone |*(a/$-(* *) p/a) :: just one thing
1311
1412***
docs/system/hoon/library/src/1c/mold/pair.md+3−2
@@ -2,13 +2,14 @@
22
33Mold of pair of types
44
5−[mold]() generator. Produces a tuple of two of the types passed in.
5+mold generator. Produces a tuple of two of the types passed in.
66
77
88Source
99------
1010
11− ++ pair |*([a=$+(* *) b=$+(* *)] ,[p=a q=b]) :: just a pair
11+ ++ pair |*({a/$-(* *) b/$-(* *)} {p/a q/b}) :: just a pair
12+
1213
1314
1415Examples
docs/system/hoon/library/src/1c/mold/pole.md+5−2
@@ -2,12 +2,15 @@
22
33Faceless list
44
5−A [`++list`]() without the [face]()s `i` and `t`.
5+A `++list` without the faces `i` and `t`.
66
77Source
88------
99
10− ++ pole |* a=_,* :: nameless list
10+ ++ pole |* a/$-(* *) :: nameless list
11+ $@($~ {a (pole a)}) ::
12+
13+
1114
1215Examples
1316--------
docs/system/hoon/library/src/1c/mold/qual.md+3−2
@@ -7,7 +7,8 @@ A `++qual` is a tuple of four of the types passed in.
77Source
88------
99
10− ++ qual |* [a=$+(* *) b=$+(* *) c=$+(* *) d=$+(* *)] :: just a quadruple
10+ ++ qual |* {a/$-(* *) b/$-(* *) c/$-(* *) d/$-(* *)} :: just a quadruple
11+ {p/a q/b r/c s/d} ::
1112
1213Examples
1314--------
@@ -17,4 +18,4 @@ Examples
1718
1819
1920
20−***
21+ ***
docs/system/hoon/library/src/1c/mold/trap.md+3−4
@@ -2,18 +2,17 @@
22
33Core with one arm `$`
44
5−A trap is a core with one arm `++$`. Used when XX
5+A trap is a core with one arm `++$`.
66
77Source
88------
99
10− ++ trap ,_|.(_*) :: makes perfect sense
10+ ++ trap |*(a/_* _|?(*a)) :: makes perfect sense
11+
1112
1213Examples
1314--------
1415
15−See also: `|.`
16−
1716 ~zod/try=> *trap
1817 <1.mws 101.jzo 1.ypj %164>
1918 ~zod/try=> (*trap)
docs/system/hoon/library/src/1c/mold/tree.md+4−2
@@ -8,12 +8,14 @@ left/right sub `++tree` of the same type. Pretty-printed with `{}`.
88Source
99------
1010
11− ++ tree |* a=_,* :: binary tree
11+ ++ tree |* a/$-(* *) :: binary tree
12+ $@($~ {n/a l/(tree a) r/(tree a)}) ::
13+
1214
1315Examples
1416--------
1517
16− ~zod/try=> `(tree ,[@ tape])`[[1 "hi"] [[2 "bye"] ~ ~] ~]
18+ ~zod/try=> `(tree {@ tape})`[[1 "hi"] [[2 "bye"] ~ ~] ~]
1719 {[2 "bye"] [1 "hi"]}
1820
1921
docs/system/hoon/library/src/1c/mold/trel.md+5−3
@@ -2,17 +2,19 @@
22
33Mold of three types
44
5−[`++mold`]() of the tuple of the three types passed in.
5+`++mold` of the tuple of the three types passed in.
66
77Source
88------
99
10− ++ trel |* [a=$+(* *) b=$+(* *) c=$+(* *)] :: just a triple
10+ ++ trel |* {a/$-(* *) b/$-(* *) c/$-(* *)} :: just a triple
11+ {p/a q/b r/c} ::
12+
1113
1214Examples
1315--------
1416
15− ~zod/try=> *(trel ,@ud ,@t ,@s)
17+ ~zod/try=> *(trel @ud @t @s)
1618 [p=0 q='' r=--0]
1719
1820
docs/system/hoon/library/src/1c/mold/unit.md+13−7
@@ -2,26 +2,32 @@
22
33Maybe
44
5−[mold]() generator. A `++unit` is either `~` or `[~ u=a]` where `a` is the
5+mold generator. A `++unit` is either `~` or `[~ u=a]` where `a` is the
66type that was passed in.
77
88
99Source
1010------
1111
12− ++ unit |* a=_,* :: maybe
12+ ++ unit |* a/$-(* *) :: maybe
13+ $@($~ {$~ u/a}) ::
14+
1315
1416Examples
1517--------
1618
17−See also: [`++bind`]()
19+See also: `++bind`
1820
19− ~zod/try=> :type; *(unit time)
21+ ~zod/try=> ? *(unit time)
22+ ?({$~ u/@da} $~)
2023 ~
21− u(@da)
22− ~zod/try=> `(unit time)`[~ -<-]
23− [~ ~2014.9.24..19.25.10..7dd5]
2424
25+ ~zod/try=> > =a |= a/@
26+ ^- (unit @)
27+ ?~ a ~
28+ [~ a]
29+ > (a 2)
30+ [~ u=2]
2531
2632
2733***
docs/system/hoon/library/src/2a/gate/biff.md+5−4
@@ -2,7 +2,7 @@
22
33Unit as argument
44
5−Applies a function `b` that produces a unit to the unwrapped value of [++unit]()
5+Applies a function `b` that produces a unit to the unwrapped value of ++unit
66`a` (`u.a`). If `a` is empty, `~` is produced.
77
88Accepts
@@ -21,16 +21,17 @@ Source
2121------
2222
2323 ++ biff :: apply
24− |* [a=(unit) b=$+(* (unit))]
24+ |* {a/(unit) b/$-(* (unit))}
2525 ?~ a ~
2626 (b u.a)
2727
28+
2829Examples
2930--------
3031
31− ~zod/try=> (biff (some 5) |=(a=@ (some (add a 2))))
32+ ~zod/try=> (biff (some 5) |=(a/@ (some (add a 2))))
3233 [~ u=7]
33− ~zod/try=> (biff ~ |=(a=@ (some (add a 2))))
34+ ~zod/try=> (biff ~ |=(a/@ (some (add a 2))))
3435 ~
3536
3637
docs/system/hoon/library/src/2a/gate/bind.md+6−5
@@ -2,7 +2,7 @@
22
33Non-unit function to unit, producing unit
44
5−Applies a function `b` to the value (`u.a`) of a [++unit]() `a`, producing
5+Applies a function `b` to the value (`u.a`) of a ++unit `a`, producing
66a unit. Used when you want a function that does not accept or produce a
77unit to both accept and produce a unit.
88
@@ -22,17 +22,18 @@ Source
2222------
2323
2424 ++ bind :: argue
25− |* [a=(unit) b=gate]
25+ |* {a/(unit) b/gate}
2626 ?~ a ~
2727 [~ u=(b u.a)]
2828
29+
2930Examples
3031--------
3132
32− ~zod/try=> (bind ((unit ,@) [~ 97]) ,@t)
33+ ~zod/try=> (bind ((unit @) [~ 97]) ,@t)
3334 [~ `a`]
34− ~zod/try=> =a |=(a=@ (add a 1))
35− ~zod/try=> (bind ((unit ,@) [~ 2]) a)
35+ ~zod/try=> =a |=(a/@ (add a 1))
36+ ~zod/try=> (bind ((unit @) [~ 2]) a)
3637 [~ 3]
3738
3839
docs/system/hoon/library/src/2a/gate/bond.md+4−3
@@ -2,7 +2,7 @@
22
33Replace null
44
5−Replaces an empty [++unit]() `b` with the product of a called [trap]()
5+Replaces an empty ++unit `b` with the product of a called trap
66`a`. If the unit is not empty, then the original unit is produced.
77
88Accepts
@@ -21,11 +21,12 @@ Source
2121------
2222
2323 ++ bond :: replace
24− |* a=trap
25− |* b=(unit)
24+ |* a/(trap)
25+ |* b/(unit)
2626 ?~ b $:a
2727 u.b
2828
29+
2930Examples
3031--------
3132
docs/system/hoon/library/src/2a/gate/both.md+3−2
@@ -3,7 +3,7 @@
33Group unit values into pair
44
55Produces `~` if either `a` or `b` are empty. Otherwise, produces a
6−[++unit]() whose value is a cell of the values of two input units `a` and
6+++unit whose value is a cell of the values of two input units `a` and
77`b`.
88
99Accepts
@@ -22,11 +22,12 @@ Source
2222------
2323
2424 ++ both :: all the above
25− |* [a=(unit) b=(unit)]
25+ |* {a/(unit) b/(unit)}
2626 ?~ a ~
2727 ?~ b ~
2828 [~ u=[u.a u.b]]
2929
30+
3031Examples
3132--------
3233
docs/system/hoon/library/src/2a/gate/clap.md+7−6
@@ -2,7 +2,7 @@
22
33Apply function to two units
44
5−Applies a binary function `c`--which does not usually accept or produce a [`++unit`]()--
5+Applies a binary function `c`--which does not usually accept or produce a `++unit`--
66to the values of two units, `a` and `b`, producing a unit.
77
88Accepts
@@ -23,20 +23,21 @@ Source
2323------
2424
2525 ++ clap :: combine
26− |* [a=(unit) b=(unit) c=_|=(^ +<-)]
26+ |* {a/(unit) b/(unit) c/_|=(^ +<-)}
2727 ?~ a b
2828 ?~ b a
2929 [~ u=(c u.a u.b)]
3030
31+
3132Examples
3233--------
3334
34− ~zod/try=> =u ((unit ,@t) [~ 'a'])
35− ~zod/try=> =v ((unit ,@t) [~ 'b'])
35+ ~zod/try=> =u ((unit @t) [~ 'a'])
36+ ~zod/try=> =v ((unit @t) [~ 'b'])
3637 ~zod/try=> (clap u v |=([a=@t b=@t] (welp (trip a) (trip b))))
3738 [~ u="ab"]
38− ~zod/try=> =a ((unit ,@u) [~ 1])
39− ~zod/try=> =b ((unit ,@u) [~ 2])
39+ ~zod/try=> =a ((unit @u) [~ 1])
40+ ~zod/try=> =b ((unit @u) [~ 2])
4041 ~zod/try=> =c |=([a=@ b=@] (add a b))
4142 ~zod/try=> (clap a b c)
4243 [~ 3]
docs/system/hoon/library/src/2a/gate/drop.md+5−4
@@ -2,7 +2,7 @@
22
33Unit to list
44
5−Makes a [++list]() of the unwrapped value (`u.a`) of a [`++unit`]() `a`.
5+Makes a ++list of the unwrapped value (`u.a`) of a `++unit` `a`.
66
77Accepts
88-------
@@ -18,17 +18,18 @@ Source
1818------
1919
2020 ++ drop :: enlist
21− |* a=(unit)
21+ |* a/(unit)
2222 ?~ a ~
2323 [i=u.a t=~]
2424
25+
2526Examples
2627--------
2728
28− ~zod/try=> =a ((unit ,@) [~ 97])
29+ ~zod/try=> =a ((unit @) [~ 97])
2930 ~zod/try=> (drop a)
3031 [i=97 t=~]
31− ~zod/try=> =a ((unit ,@) [~])
32+ ~zod/try=> =a ((unit @) [~])
3233 ~zod/try=> (drop a)
3334 ~
3435
docs/system/hoon/library/src/2a/gate/fall.md+4−3
@@ -2,14 +2,14 @@
22
33Give unit a default value
44
5−Produces a default value `b` for a [`++unit`]() `a` in cases where `a` is null.
5+Produces a default value `b` for a `++unit` `a` in cases where `a` is null.
66
77Accepts
88-------
99
1010`a` is a unit.
1111
12−`b` is a [noun]() that's used as the default value.
12+`b` is a noun that's used as the default value.
1313
1414Produces
1515--------
@@ -20,9 +20,10 @@ Source
2020------
2121
2222 ++ fall :: default
23− |* [a=(unit) b=*]
23+ |* {a/(unit) b/*}
2424 ?~(a b u.a)
2525
26+
2627Examples
2728--------
2829
docs/system/hoon/library/src/2a/gate/lift.md+6−5
@@ -2,7 +2,7 @@
22
33Curried bind
44
5−Accepts a [`++gate`]() `a` and produces a function that accepts [`++unit`]()
5+Accepts a `++gate` `a` and produces a function that accepts `++unit`
66`b` to which it applies `a`. Used when you want a function that does not accept
77or produce a unit to both accept and produce a unit.
88
@@ -22,16 +22,17 @@ Source
2222------
2323
2424 ++ lift :: lift gate (fmap)
25− |* a=gate :: flipped
26− |* b=(unit) :: curried
25+ |* a/gate :: flipped
26+ |* b/(unit) :: curried
2727 (bind b a) :: bind
2828
29+
2930Examples
3031--------
3132
32− ~zod/try=> ((lift dec) `(unit ,@)`~)
33+ ~zod/try=> ((lift dec) `(unit @)`~)
3334 ~
34− ~zod/try=> ((lift dec) `(unit ,@)`[~ 20])
35+ ~zod/try=> ((lift dec) `(unit @)`[~ 20])
3536 [~ 19]
3637
3738
docs/system/hoon/library/src/2a/gate/mate.md+12−11
@@ -23,25 +23,26 @@ A unit or crash.
2323Source
2424------
2525
26−++ mate :: choose
27− |* [a=(unit) b=(unit)]
28− ?~ b a
29− ?~ a b
30− ?.(=(u.a u.b) ~|('mate' !!) a)
26+ ++ mate :: choose
27+ |* {a/(unit) b/(unit)}
28+ ?~ b a
29+ ?~ a b
30+ ?.(=(u.a u.b) ~|('mate' !!) a)
31+
3132
3233Examples
3334--------
3435
35− ~zod/try=> =a ((unit ,@) [~ 97])
36− ~zod/try=> =b ((unit ,@) [~ 97])
36+ ~zod/try=> =a ((unit @) [~ 97])
37+ ~zod/try=> =b ((unit @) [~ 97])
3738 ~zod/try=> (mate a b)
3839 [~ 97]
39− ~zod/try=> =a ((unit ,@) [~ 97])
40− ~zod/try=> =b ((unit ,@) [~])
40+ ~zod/try=> =a ((unit @) [~ 97])
41+ ~zod/try=> =b ((unit @) [~])
4142 ~zod/try=> (mate a b)
4243 [~ 97]
43− ~zod/try=> =a ((unit ,@) [~ 97])
44− ~zod/try=> =b ((unit ,@) [~ 98])
44+ ~zod/try=> =a ((unit @) [~ 97])
45+ ~zod/try=> =b ((unit @) [~ 98])
4546 ~zod/try=> (mate a b)
4647 ! 'mate'
4748 ! exit
docs/system/hoon/library/src/2a/gate/need.md+7−6
@@ -2,7 +2,7 @@
22
33Unwrap unit
44
5−Retrieve the value from a [`++unit`]() and crash if the unit is null.
5+Retrieve the value from a `++unit` and crash if the unit is null.
66
77Accepts
88-------
@@ -18,20 +18,21 @@ Source
1818------
1919
2020 ++ need :: demand
21− |* a=(unit)
22− ?~ a !!
21+ |* a/(unit)
22+ ?~ a ~|(%need !!)
2323 u.a
2424
25+
2526Examples
2627--------
2728
28− ~zod/try=> =a ((unit ,[@t @t]) [~ ['a' 'b']])
29+ ~zod/try=> =a ((unit [@t @t]) [~ ['a' 'b']])
2930 ~zod/try=> (need a)
3031 ['a' 'b']
31− ~zod/try=> =a ((unit ,@ud) [~ 17])
32+ ~zod/try=> =a ((unit @ud) [~ 17])
3233 ~zod/try=> (need a)
3334 17
34− ~zod/try=> =a ((unit ,@) [~])
35+ ~zod/try=> =a ((unit @) [~])
3536 ~zod/try=> (need a)
3637 ! exit
3738
docs/system/hoon/library/src/2b/gate/flop.md+2−1
@@ -19,7 +19,7 @@ Source
1919
2020 ++ flop :: reverse
2121 ~/ %flop
22− |* a=(list)
22+ |* a/(list)
2323 => .(a (homo a))
2424 ^+ a
2525 =+ b=`_a`~
@@ -28,6 +28,7 @@ Source
2828 $(a t.a, b [i.a b])
2929
3030
31+
3132Examples
3233--------
3334
docs/system/hoon/library/src/2b/gate/homo.md+4−3
@@ -2,7 +2,7 @@
22
33Homogenize
44
5−Produces a [`++list`]() whose type is a fork of all the contained types in the
5+Produces a `++list` whose type is a fork of all the contained types in the
66list `a`. Used when you want to make all the types of the elements of a list the same.
77
88Accepts
@@ -19,12 +19,13 @@ Source
1919------
2020
2121 ++ homo :: homogenize
22− |* a=(list)
22+ |* a/(list)
2323 ^+ =< $
24− |% +- $ ?:(_? ~ [i=(snag 0 a) t=$])
24+ |% +- $ ?:(*? ~ [i=(snag 0 a) t=$])
2525 --
2626 a
2727
28+
2829Examples
2930--------
3031
docs/system/hoon/library/src/2b/gate/lent.md+4−3
@@ -2,7 +2,7 @@
22
33List length
44
5−Produces the length of any [`++list`]() `a` as an atom.
5+Produces the length of any `++list` `a` as an atom.
66
77Accepts
88-------
@@ -19,13 +19,14 @@ Source
1919
2020 ++ lent :: length
2121 ~/ %lent
22− |= a=(list)
22+ |= a/(list)
2323 ^- @
2424 =+ b=0
2525 |-
26− ?~ a b
26+ ?~ a b
2727 $(a t.a, b +(b))
2828
29+
2930Examples
3031--------
3132
docs/system/hoon/library/src/2b/gate/levy.md+7−4
@@ -2,7 +2,7 @@
22
33Logical "and" on list
44
5−Computes the Boolean logical "and" on the results of [gate]() `b` applied to each individual element in [`++list`]() `a`.
5+Computes the Boolean logical "and" on the results of gate `b` applied to each individual element in `++list` `a`.
66
77Accepts
88-------
@@ -14,24 +14,27 @@ Accepts
1414Produces
1515--------
1616
17+A boolean.
18+
1719Source
1820------
1921
2022 ++ levy
2123 ~/ %levy :: all of
22− |* [a=(list) b=_|=(p=* .?(p))]
24+ |* {a/(list) b/$-(* ?)}
2325 |- ^- ?
2426 ?~ a &
2527 ?. (b i.a) |
2628 $(a t.a)
2729
30+
2831Examples
2932--------
3033
31− ~zod/try=> =a |=(a=@ (lte a 1))
34+ ~zod/try=> =a |=(a/@ (lte a 1))
3235 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
3336 %.n
34− ~zod/try=> =a |=(a=@ (lte a 3))
37+ ~zod/try=> =a |=(a/@ (lte a 3))
3538 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
3639 %.y
3740
docs/system/hoon/library/src/2b/gate/lien.md+16−7
@@ -2,19 +2,28 @@
22
33Logical "or" on list
44
5+Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
6+
7+Accepts
8+-------
9+
10+`a` is a list.
11+
12+`b` is a gate.
13+
14+Source
15+------
16+
517 ++ lien :: some of
618 ~/ %lien
7− |* [a=(list) b=$+(* ?)]
19+ |* {a/(list) b/$-(* ?)}
820 |- ^- ?
921 ?~ a |
1022 ?: (b i.a) &
1123 $(a t.a)
12−
13−Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
14−
15−`a` is a list.
16−
17−`b` is a gate.
24+
25+Examples
26+--------
1827
1928 ~zod/try=> =a |=(a=@ (gte a 1))
2029 ~zod/try=> (lien (limo [0 1 2 1 ~]) a)
docs/system/hoon/library/src/2b/gate/limo.md+1−1
@@ -12,7 +12,7 @@ Accepts
1212Produces
1313--------
1414
15−A list
15+A `++list`.
1616
1717Source
1818------
docs/system/hoon/library/src/2b/gate/murn.md+6−5
@@ -2,16 +2,16 @@
22
33Maybe transform
44
5−Passes each member of [`++list`]() `a` to [gate]() `b`, which must produce a
6−[`++unit`](). Produces a new list with all the results that do not produce
5+Passes each member of `++list` `a` to gate `b`, which must produce a
6+`++unit`. Produces a new list with all the results that do not produce
77`~`.
88
99Accepts
1010-------
1111
12−`a` is a [list]().
12+`a` is a list.
1313
14−`b` is a [gate]() that produces a [unit]().
14+`b` is a gate that produces a unit.
1515
1616Produces
1717--------
@@ -22,7 +22,8 @@ Source
2222------
2323
2424 ++ murn :: maybe transform
25− |* [a=(list) b=$+(* (unit))]
25+ ~/ %murn
26+ |* {a/(list) b/$-(* (unit))}
2627 |-
2728 ?~ a ~
2829 =+ c=(b i.a)
docs/system/hoon/library/src/2b/gate/reap.md+5−4
@@ -2,12 +2,12 @@
22
33Replicate
44
5−Replicate: produces a [`++list`]() containing `a` copies of `b`.
5+Replicate: produces a `++list` containing `a` copies of `b`.
66
77Accepts
88-------
99
10−`b` is a [noun]()
10+`b` is a noun.
1111
1212Produces
1313--------
@@ -18,8 +18,9 @@ Source
1818------
1919
2020 ++ reap :: replicate
21− |* [a=@ b=*]
22− |- ^- (list ,_b)
21+ ~/ %reap
22+ |* {a/@ b/*}
23+ |- ^- (list _b)
2324 ?~ a ~
2425 [b $(a (dec a))]
2526
docs/system/hoon/library/src/2b/gate/reel.md+6−5
@@ -2,8 +2,8 @@
22
33Right fold
44
5−Right fold: moves right to left across a [`++list`]() `a`, recursively slamming
6−a binary [gate]() `b` with an element from `a` and an accumulator, producing
5+Right fold: moves right to left across a `++list` `a`, recursively slamming
6+a binary gate `b` with an element from `a` and an accumulator, producing
77the final value of the accumulator.
88
99Accepts
@@ -14,19 +14,20 @@ Accepts
1414Produces
1515--------
1616
17−The accumulator, which is a [noun]().
17+The accumulator, which is a noun.
1818
1919Source
2020------
2121
22− ++ reel :: right fold
22+ ++ reel :: right fold
2323 ~/ %reel
24− |* [a=(list) b=_|=([* *] +<+)]
24+ |* {a/(list) b/_|=({* *} +<+)}
2525 |- ^+ +<+.b
2626 ?~ a
2727 +<+.b
2828 (b i.a $(a t.a))
2929
30+
3031Examples
3132--------
3233
docs/system/hoon/library/src/2b/gate/skid.md+6−4
@@ -2,8 +2,8 @@
22
33Separate
44
5−Separates a [`++list`]() `a` into two lists - Those elements of `a` who produce
6−true when slammed to [gate]() `b` and those who produce `%.n`.
5+Separates a `++list` `a` into two lists - Those elements of `a` who produce
6+true when slammed to gate `b` and those who produce `%.n`.
77
88Accepts
99-------
@@ -19,17 +19,19 @@ Source
1919------
2020
2121 ++ skid :: separate
22− |* [a=(list) b=$+(* ?)]
22+ ~/ %skid
23+ |* {a/(list) b/$-(* ?)}
2324 |- ^+ [p=a q=a]
2425 ?~ a [~ ~]
2526 =+ c=$(a t.a)
2627 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
2728
2829
30+
2931Examples
3032--------
3133
32− ~zod/try=> =a |=(a=@ (gth a 1))
34+ ~zod/try=> =a |=(a/@ (gth a 1))
3335 ~zod/try=> (skid (limo [0 1 2 3 ~]) a)
3436 [p=[i=2 t=[i=3 t=~]] q=[i=0 t=[i=1 t=~]]]
3537
docs/system/hoon/library/src/2b/gate/skim.md+12−9
@@ -9,26 +9,29 @@ producing a list of all of the members that produce `%.y`. Inverse of
99Accepts
1010-------
1111
12−`b` is a [gate]() that accepts one argument and produces a loobean.
12+`b` is a gate that accepts one argument and produces a boolean.
1313
1414Produces
1515--------
1616
17+A boolean
18+
1719Source
1820------
1921
20−++ skim :: only
21− ~/ %skim
22− |* [a=(list) b=_|=(p=* .?(p))]
23− |-
24− ^+ a`
25− ?~ a ~
26− ?:((b i.a) [i.a $(a t.a)] $(a t.a))
22+ ++ skim :: only
23+ ~/ %skim
24+ |* {a/(list) b/$-(* ?)}
25+ |-
26+ ^+ a
27+ ?~ a ~
28+ ?:((b i.a) [i.a $(a t.a)] $(a t.a))
29+
2730
2831Examples
2932--------
3033
31− ~zod/try=> =a |=(a=@ (gth a 1))
34+ ~zod/try=> =a |=(a/@ (gth a 1))
3235 ~zod/try=> (skim (limo [0 1 2 3 ~]) a)
3336 [i=2 t=[i=3 t=~]]
3437
docs/system/hoon/library/src/2b/gate/skip.md+5−4
@@ -2,14 +2,14 @@
22
33Except
44
5−Cycles through the members of [`++list`]() `a`, passing them to a [gate]() `b`.
5+Cycles through the members of `++list` `a`, passing them to a gate `b`.
66Produces a list of all of the members that produce `%.n`. Inverse of
77`++skim`.
88
99Accepts
1010-------
1111
12−`b` is a [gate]() that accepts one argument and produces a loobean.
12+`b` is a gate that accepts one argument and produces a loobean.
1313
1414Produces
1515--------
@@ -21,16 +21,17 @@ Source
2121
2222 ++ skip :: except
2323 ~/ %skip
24− |* [a=(list) b=_|=(p=* .?(p))]
24+ |* {a/(list) b/$-(* ?)}
2525 |-
2626 ^+ a
2727 ?~ a ~
2828 ?:((b i.a) $(a t.a) [i.a $(a t.a)])
2929
30+
3031Examples
3132--------
3233
33− ~zod/try=> =a |=(a=@ (gth a 1))
34+ ~zod/try=> =a |=(a/@ (gth a 1))
3435 ~zod/try=> (skip (limo [0 1 2 3 ~]) a)
3536 [i=0 t=[i=1 t=~]]
3637
docs/system/hoon/library/src/2b/gate/slag.md+3−2
@@ -8,7 +8,7 @@ Accepts an atom `a` and list `b`, producing the remaining elements from
88Accepts
99-------
1010
11−`b` is a [list]().
11+`b` is a list.
1212
1313Produces
1414--------
@@ -20,12 +20,13 @@ Source
2020
2121 ++ slag :: suffix
2222 ~/ %slag
23− |* [a=@ b=(list)]
23+ |* {a/@ b/(list)}
2424 |- ^+ b
2525 ?: =(0 a) b
2626 ?~ b ~
2727 $(b t.b, a (dec a))
2828
29+
2930Examples
3031--------
3132
docs/system/hoon/library/src/2b/gate/snag.md+4−3
@@ -2,13 +2,13 @@
22
33Index
44
5−Accepts an atom `a` and a [`++list`]() `b`, producing the element at the index
5+Accepts an atom `a` and a `++list` `b`, producing the element at the index
66of `a`and failing if the list is null. Lists are 0-indexed.
77
88Accepts
99-------
1010
11−`b` is a [list]().
11+`b` is a list.
1212
1313Produces
1414--------
@@ -20,13 +20,14 @@ Source
2020
2121 ++ snag :: index
2222 ~/ %snag
23− |* [a=@ b=(list)]
23+ |* {a/@ b/(list)}
2424 |-
2525 ?~ b
2626 ~|('snag-fail' !!)
2727 ?: =(0 a) i.b
2828 $(b t.b, a (dec a))
2929
30+
3031Examples
3132--------
3233
docs/system/hoon/library/src/2b/gate/sort.md+7−6
@@ -2,7 +2,7 @@
22
33Quicksort
44
5−Quicksort: accepts a [`++list`]() `a` and a [gate]() `b` which accepts two nouns and
5+Quicksort: accepts a `++list` `a` and a gate `b` which accepts two nouns and
66produces a loobean. `++sort` then produces a list of the elements of `a`,
77sorted according to `b`.
88
@@ -19,21 +19,22 @@ A list
1919Source
2020------
2121
22− ++ sort :: quicksort
22+ ++ sort !. :: quicksort
2323 ~/ %sort
24− |* [a=(list) b=$+([* *] ?)]
24+ |* {a/(list) b/$-([* *] ?)}
2525 => .(a ^.(homo a))
2626 |- ^+ a
2727 ?~ a ~
2828 %+ weld
29− $(a (skim t.a |=(c=_i.a (b c i.a))))
29+ $(a (skim t.a |=(c/_i.a (b c i.a))))
3030 ^+ t.a
31− [i.a $(a (skim t.a |=(c=_i.a !(b c i.a))))]
31+ [i.a $(a (skim t.a |=(c/_i.a !(b c i.a))))]
32+
3233
3334Examples
3435--------
3536
36− ~zod/try=> =a =|([p=@ q=@] |.((gth p q)))
37+ ~zod/try=> =a =|({p=@ q=@} |.((gth p q)))
3738 ~zod/try=> (sort (limo [0 1 2 3 ~]) a)
3839 ~[3 2 1 0]
3940
docs/system/hoon/library/src/2b/gate/swag.md+4−3
@@ -8,7 +8,7 @@ inclusive index `a`, producing `b` number of characters.
88Accepts
99-------
1010
11−`c` is a [list]().
11+`c` is a list.
1212
1313Produces
1414--------
@@ -19,8 +19,9 @@ Source
1919------
2020
2121 ++ swag :: infix
22− |* [[a=@ b=@] c=(list)]
23− (scag b (slag a c))
22+ |* {{a/@ b/@} c/(list)}
23+ (scag +<-> (slag +<-< c))
24+
2425
2526Examples
2627--------
docs/system/hoon/library/src/2b/gate/turn.md+4−3
@@ -2,7 +2,7 @@
22
33Gate to list
44
5−Accepts a [`++list`]() `a` and a [gate]() `b`. Produces a list with the gate applied
5+Accepts a `++list` `a` and a gate `b`. Produces a list with the gate applied
66to each element of the original list.
77
88Accepts
@@ -20,17 +20,18 @@ Source
2020
2121 ++ turn :: transform
2222 ~/ %turn
23− |* [a=(list) b=_,*]
23+ |* {a/(list) b/$-(* *)}
2424 |-
2525 ?~ a ~
2626 [i=(b i.a) t=$(a t.a)]
2727
28+
2829Examples
2930--------
3031
3132 ~zod/try=> (turn (limo [104 111 111 110 ~]) ,@t)
3233 <|h o o n|>
33− ~zod/try=> =a |=(a=@ (add a 4))
34+ ~zod/try=> =a |=(a/@ (add a 4))
3435 ~zod/try=> (turn (limo [1 2 3 4 ~]) a)
3536 ~[5 6 7 8]
3637
docs/system/hoon/library/src/2b/gate/weld.md+4−3
@@ -2,24 +2,25 @@
22
33Concatenate
44
5−Concatenate two [`++list`]()s `a` and `b`.
5+Concatenate two `++list`s `a` and `b`.
66
77Accepts
88-------
99
10−`a` and `b` are [list]()s.
10+`a` and `b` are lists.
1111
1212Source
1313------
1414
1515 ++ weld :: concatenate
1616 ~/ %weld
17− |* [a=(list) b=(list)]
17+ |* {a/(list) b/(list)}
1818 => .(a ^.(homo a), b ^.(homo b))
1919 |- ^+ b
2020 ?~ a b
2121 [i.a $(a t.a)]
2222
23+
2324Examples
2425--------
2526
docs/system/hoon/library/src/2b/gate/welp.md+5−4
@@ -2,7 +2,7 @@
22
33Perfect weld
44
5−Concatenate two [`++list`]()s `a` and `b` without losing their type information
5+Concatenate two `++list`s `a` and `b` without losing their type information
66to homogenization.
77
88Accepts
@@ -21,7 +21,7 @@ Source
2121------
2222
2323 ++ welp :: perfect weld
24− =| [* *]
24+ =| {* *}
2525 |%
2626 +- $
2727 ?~ +<-
@@ -29,6 +29,7 @@ Source
2929 +<-(+ $(+<- +<->))
3030 --
3131
32+
3233Examples
3334--------
3435
@@ -36,10 +37,10 @@ Examples
3637 "foobar"
3738 ~zod/arvo=/hoon/hoon> (welp ~[60 61 62] ~[%a %b %c])
3839 [60 61 62 %a %b %c ~]
39− ~zod/arvo=/hoon/hoon> :type; (welp ~[60 61 62] ~[%a %b %c])
40+ ~zod/arvo=/hoon/hoon>? (welp ~[60 61 62] ~[%a %b %c])
4041 [60 61 62 %a %b %c ~]
4142 [@ud @ud @ud %a %b %c %~]
42− ~zod/arvo=/hoon/hoon> (welp [sa/1 so/2 ~] si/3)
43+ ~zod/arvo=/hoon/hoon> (welp [sa+1 so+2 ~] si/3)
4344 [[%sa 1] [%so 2] %si 3]
4445
4546
docs/system/hoon/library/src/2b/gate/zing.md+3−1
@@ -2,7 +2,7 @@
22
33Cons
44
5−Turns a [`++list`]() of lists into a single list by promoting the elements of
5+Turns a `++list` of lists into a single list by promoting the elements of
66each sublist into the higher.
77
88Accepts
@@ -27,6 +27,8 @@ Source
2727 (welp +<- $(+< +<+))
2828 --
2929
30+
31+
3032Examples
3133--------
3234