on master help sign in
1a-2c
42a1833Henry Ault
docs/system/hoon/library/src/1a/gate/add.md+1−1
@@ -7,7 +7,7 @@ Produces the sum of `a` and `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
docs/system/hoon/library/src/1a/gate/dec.md+2−3
@@ -7,7 +7,7 @@ Decrements `a` by `1`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12Produces
12Produces
13--------
13--------
@@ -19,14 +19,13 @@ Source
19
19
20 ++ dec :: decrement
20 ++ dec :: decrement
21 ~/ %dec
21 ~/ %dec
22− |= a=@
22+ |= a/@
23 ~| %decrement-underflow
23 ~| %decrement-underflow
24 ?< =(0 a)
24 ?< =(0 a)
25 =+ b=0
25 =+ b=0
26 |- ^- @
26 |- ^- @
27 ?: =(a +(b)) b
27 ?: =(a +(b)) b
28 $(b +(b))
28 $(b +(b))
29− ::
30
29
31Examples
30Examples
32--------
31--------
docs/system/hoon/library/src/1a/gate/div.md+2−2
@@ -7,9 +7,9 @@ Computes `a` divided by `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12−`b` is an [atom]().
12+`b` is an atom.
13
13
14Produces
14Produces
15--------
15--------
docs/system/hoon/library/src/1a/gate/gte.md+3−3
@@ -7,7 +7,7 @@ Tests whether `a` is greater than a number `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,10 +21,10 @@ Source
21
21
22 ++ gte :: greater-equal
22 ++ gte :: greater-equal
23 ~/ %gte
23 ~/ %gte
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- ?
25 ^- ?
26 !(lth a b)
26 !(lth a b)
27− ::
27+
28
28
29Examples
29Examples
30--------
30--------
docs/system/hoon/library/src/1a/gate/gth.md+4−3
@@ -7,7 +7,7 @@ Tests whether `a` is greater than `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,10 +21,11 @@ Source
21
21
22 ++ gth :: greater-than
22 ++ gth :: greater-than
23 ~/ %gth
23 ~/ %gth
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- ?
25 ^- ?
26 !(lte a b)
26 !(lte a b)
27− ::
27+
28+
28
29
29Examples
30Examples
30--------
31--------
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`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,8 +21,9 @@ Source
21
21
22 ++ lte :: less-equal
22 ++ lte :: less-equal
23 ~/ %lte
23 ~/ %lte
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 |(=(a b) (lth a b))
25 |(=(a b) (lth a b))
26+
26 ::
27 ::
27
28
28Examples
29Examples
docs/system/hoon/library/src/1a/gate/lth.md+5−6
@@ -21,15 +21,14 @@ Source
21
21
22 ++ lth :: less-than
22 ++ lth :: less-than
23 ~/ %lth
23 ~/ %lth
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- ?
25 ^- ?
26− ?& !=(a b)
26+ ?& !=(a b)
27− |-
27+ |-
28− ?| =(0 a)
28+ ?| =(0 a)
29− ?& !=(0 b)
29+ ?& !=(0 b)
30 $(a (dec a), b (dec b))
30 $(a (dec a), b (dec b))
31 == == ==
31 == == ==
32− ::
33
32
34Examples
33Examples
35--------
34--------
docs/system/hoon/library/src/1a/gate/max.md+2−3
@@ -7,7 +7,7 @@ Computes the greater of `a` and `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,11 +21,10 @@ Source
21
21
22 ++ max :: maximum
22 ++ max :: maximum
23 ~/ %max
23 ~/ %max
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- @
25 ^- @
26 ?: (gth a b) a
26 ?: (gth a b) a
27 b
27 b
28− ::
29
28
30Examples
29Examples
31--------
30--------
docs/system/hoon/library/src/1a/gate/min.md+3−4
@@ -7,7 +7,7 @@ Computes the lesser of `a` and `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,12 +21,11 @@ Source
21
21
22 ++ min :: minimum
22 ++ min :: minimum
23 ~/ %min
23 ~/ %min
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- @
25 ^- @
26 ?: (lth a b) a
26 ?: (lth a b) a
27 b
27 b
28− ::
28+
29−
30Examples
29Examples
31--------
30--------
32
31
docs/system/hoon/library/src/1a/gate/mod.md+3−3
@@ -7,7 +7,7 @@ Computes the remainder of dividing `a` by `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,11 +21,11 @@ Source
21
21
22 ++ mod :: remainder
22 ++ mod :: remainder
23 ~/ %mod
23 ~/ %mod
24− |= [a=@ b=@]
24+ |: [a=`@`1 b=`@`1]
25 ^- @
25 ^- @
26 ?< =(0 b)
26 ?< =(0 b)
27 (sub a (mul b (div a b)))
27 (sub a (mul b (div a b)))
28− ::
28+
29
29
30Examples
30Examples
31--------
31--------
docs/system/hoon/library/src/1a/gate/mul.md+3−4
@@ -7,7 +7,7 @@ Multiplies `a` by `b`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,14 +21,13 @@ Source
21
21
22 ++ mul :: multiply
22 ++ mul :: multiply
23 ~/ %mul
23 ~/ %mul
24− |= [a=@ b=@]
24+ |: [a=`@`1 b=`@`1]
25 ^- @
25 ^- @
26 =+ c=0
26 =+ c=0
27 |-
27 |-
28 ?: =(0 a) c
28 ?: =(0 a) c
29 $(a (dec a), c (add b c))
29 $(a (dec a), c (add b c))
30− ::
30+
31−
32Examples
31Examples
33--------
32--------
34
33
docs/system/hoon/library/src/1a/gate/sub.md+9−9
@@ -7,9 +7,9 @@ Subtracts `b` from `a`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12−`b` is an [atom]().
12+`b` is an atom.
13
13
14Produces
14Produces
15--------
15--------
@@ -19,13 +19,13 @@ An atom.
19Source
19Source
20------
20------
21
21
22− ++ sub :: subtract
22+ ++ sub :: subtract
23− ~/ %sub
23+ ~/ %sub
24− |= [a=@ b=@]
24+ |= [a=@ b=@]
25− ~| %subtract-underflow
25+ ~| %subtract-underflow
26− ^- @
26+ ^- @
27− ?: =(0 b) a
27+ ?: =(0 b) a
28− $(a (dec a), b (dec b))
28+ $(a (dec a), b (dec b))
29
29
30Examples
30Examples
31--------
31--------
docs/system/hoon/library/src/1b/gate/cap.md+14−14
@@ -2,8 +2,8 @@
2
2
3Tree head
3Tree head
4
4
5−Tests whether an `a` is in the head or tail of a [noun](). Produces the
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
6+cube `%2` if it is within the head, or the cube `%3` if it is
7within the tail.
7within the tail.
8
8
9Accepts
9Accepts
@@ -14,22 +14,22 @@ Accepts
14Produces
14Produces
15--------
15--------
16
16
17−A [cube]().
17+A cube.
18
18
19Source
19Source
20------
20------
21
21
22− ++ cap :: tree head
22+ ++ cap :: tree head
23− ~/ %cap
23+ ~/ %cap
24− |= a=@
24+ |= a=@
25− ^- ?(%2 %3)
25+ ^- ?(%2 %3)
26− ?- a
26+ ?- a
27− %2 %2
27+ %2 %2
28− %3 %3
28+ %3 %3
29− ?(%0 %1) !!
29+ ?(%0 %1) !!
30− * $(a (div a 2))
30+ * $(a (div a 2))
31− ==
31+ ==
32− ::
32+ ::
33
33
34Examples
34Examples
35--------
35--------
docs/system/hoon/library/src/1b/gate/mas.md+11−11
@@ -17,17 +17,17 @@ An atom.
17Source
17Source
18------
18------
19
19
20− ++ mas :: tree body
20+ ++ mas :: tree body
21− ~/ %mas
21+ ~/ %mas
22− |= a=@
22+ |= a=@
23− ^- @
23+ ^- @
24− ?- a
24+ ?- a
25− 1 !!
25+ 1 !!
26− 2 1
26+ 2 1
27− 3 1
27+ 3 1
28− * (add (mod a 2) (mul $(a (div a 2)) 2))
28+ * (add (mod a 2) (mul $(a (div a 2)) 2))
29− ==
29+ ==
30− ::
30+ ::
31
31
32Examples
32Examples
33--------
33--------
docs/system/hoon/library/src/1b/gate/peg.md+5−6
@@ -7,7 +7,7 @@ Computes the axis of `b` within axis `a`.
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` is an [atom]().
10+`a` is an atom.
11
11
12`b` is an atom.
12`b` is an atom.
13
13
@@ -21,15 +21,14 @@ Source
21
21
22 ++ peg :: tree connect
22 ++ peg :: tree connect
23 ~/ %peg
23 ~/ %peg
24− |= [a=@ b=@]
24+ |= {a/@ b/@}
25 ^- @
25 ^- @
26 ?- b
26 ?- b
27− 1 a
27+ $1 a
28− 2 (mul a 2)
28+ $2 (mul a 2)
29− 3 +((mul a 2))
29+ $3 +((mul a 2))
30 * (add (mod b 2) (mul $(b (div b 2)) 2))
30 * (add (mod b 2) (mul $(b (div b 2)) 2))
31 ==
31 ==
32− ::
33
32
34Examples
33Examples
35--------
34--------
docs/system/hoon/library/src/1c/mold/bloq.md+1−2
@@ -4,11 +4,10 @@ Blocksize
4
4
5Atom representing a blocksize, by convention expressed as a power of 2.
5Atom representing a blocksize, by convention expressed as a power of 2.
6
6
7−
8Source
7Source
9------
8------
10
9
11− ++ bloq ,@ :: blockclass
10+ ++ bloq @ :: blockclass
12
11
13Examples
12Examples
14--------
13--------
docs/system/hoon/library/src/1c/mold/each.md+7−6
@@ -2,20 +2,21 @@
2
2
3Mold of fork between two
3Mold of fork between two
4
4
5−[mold]() generator: produces a dicriminated [fork]() between two types.
5+mold generator: produces a dicriminated fork between two types.
6
6
7Source
7Source
8------
8------
9
9
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+
11
14
12Examples
15Examples
13--------
16--------
14
17
15− ~zod/try=> :type; *(each cord time)
18+ > ? *(each cord time)
19+ ?({$.y p/@t} {$.n p/@da})
16 [%.y p='']
20 [%.y p='']
17− {[%.y p=@t] [%.n p=@da]}
18−
19−
20
21
21***
22***
docs/system/hoon/library/src/1c/mold/gate.md+9−11
@@ -3,28 +3,26 @@
3Function
3Function
4
4
5A core with one arm, `$`--the empty name--which transforms a sample noun into a product
5A 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 `*`.
7
7
8
8
9Source
9Source
10------
10------
11
11
12− ++ gate $+(* *) :: general gate
12+ ++ gate $-(* *) :: general gate
13+
13
14
14Examples
15Examples
15--------
16--------
16
17
17−See also: [`++lift`](), [`++cork`]()
18+See also: `++lift`, `++cork`
18
19
19− ~zod/try=> *gate
20+ > ? gate
20− <1|mws [* <101.jzo 1.ypj %164>]>
21+ <1.ybc {* <110.jyx 1.ztu $151>}>
21− ~zod/try=> `gate`|=(* 0)
22+ <1.ybc {* <110.jyx 1.ztu $151>}>
22− <1|mws [* <101.jzo 1.ypj %164>]>
23
23
24− ~zod/try=> (|=(a=* [a 'b']) 'c')
25− [99 'b']
26− ~zod/try=> (`gate`|=(a=* [a 'b']) 'c')
24+ > (`gate`|=(a/* [a 'b']) 1)
27− [99 98]
25+ [1 'b']
28
26
29
27
30
28
docs/system/hoon/library/src/1c/mold/list.md+9−7
@@ -2,26 +2,28 @@
2
2
3List
3List
4
4
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
6homogenous type.
6homogenous type.
7
7
8
8
9Source
9Source
10------
10------
11
11
12− ++ list |* a=_,* :: null-term list
12+ ++ list |* a/$-(* *) :: null-term list
13+ $@($~ {i/a t/(list a)}) ::
14+
13
15
14Examples
16Examples
15--------
17--------
16
18
17−See also: [`++turn`](), [`++snag`]()
19+See also: `++turn`, `++snag`
18
20
19− ~zod/try=> *(list)
21+ > *(list)
20 ~
22 ~
21− ~zod/try=> `(list ,@)`"abc"
23+ > `(list @)`"abc"
22 ~[97 98 99]
24 ~[97 98 99]
23− ~zod/try=> (snag 0 "abc")
25+ > (snag 0 "abc")
24− ~~a
26+ 'a'
25
27
26
28
27
29
docs/system/hoon/library/src/1c/mold/lone.md+2−4
@@ -1,14 +1,12 @@
1### `++lone`
1### `++lone`
2
2
3−Tile generator. `++lone` puts face of `p` on something.
3+`++lone` puts face of `p` on something.
4
4
5XX unused
5XX unused
6
6
7Source
7Source
8------
8------
9
9
10− ++ lone |*(a=$+(* *) ,p=a) :: just one thing
10+ ++ lone |*(a/$-(* *) p/a) :: just one thing
11−
12−
13
11
14***
12***
docs/system/hoon/library/src/1c/mold/pair.md+3−2
@@ -2,13 +2,14 @@
2
2
3Mold of pair of types
3Mold of pair of types
4
4
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.
6
6
7
7
8Source
8Source
9------
9------
10
10
11− ++ pair |*([a=$+(* *) b=$+(* *)] ,[p=a q=b]) :: just a pair
11+ ++ pair |*({a/$-(* *) b/$-(* *)} {p/a q/b}) :: just a pair
12+
12
13
13
14
14Examples
15Examples
docs/system/hoon/library/src/1c/mold/pole.md+5−2
@@ -2,12 +2,15 @@
2
2
3Faceless list
3Faceless list
4
4
5−A [`++list`]() without the [face]()s `i` and `t`.
5+A `++list` without the faces `i` and `t`.
6
6
7Source
7Source
8------
8------
9
9
10− ++ pole |* a=_,* :: nameless list
10+ ++ pole |* a/$-(* *) :: nameless list
11+ $@($~ {a (pole a)}) ::
12+
13+
11
14
12Examples
15Examples
13--------
16--------
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.
7Source
7Source
8------
8------
9
9
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} ::
11
12
12Examples
13Examples
13--------
14--------
@@ -17,4 +18,4 @@ Examples
17
18
18
19
19
20
20−***
21+ ***
docs/system/hoon/library/src/1c/mold/trap.md+3−4
@@ -2,18 +2,17 @@
2
2
3Core with one arm `$`
3Core with one arm `$`
4
4
5−A trap is a core with one arm `++$`. Used when XX
5+A trap is a core with one arm `++$`.
6
6
7Source
7Source
8------
8------
9
9
10− ++ trap ,_|.(_*) :: makes perfect sense
10+ ++ trap |*(a/_* _|?(*a)) :: makes perfect sense
11+
11
12
12Examples
13Examples
13--------
14--------
14
15
15−See also: `|.`
16−
17 ~zod/try=> *trap
16 ~zod/try=> *trap
18 <1.mws 101.jzo 1.ypj %164>
17 <1.mws 101.jzo 1.ypj %164>
19 ~zod/try=> (*trap)
18 ~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 `{}`.
8Source
8Source
9------
9------
10
10
11− ++ tree |* a=_,* :: binary tree
11+ ++ tree |* a/$-(* *) :: binary tree
12+ $@($~ {n/a l/(tree a) r/(tree a)}) ::
13+
12
14
13Examples
15Examples
14--------
16--------
15
17
16− ~zod/try=> `(tree ,[@ tape])`[[1 "hi"] [[2 "bye"] ~ ~] ~]
18+ ~zod/try=> `(tree {@ tape})`[[1 "hi"] [[2 "bye"] ~ ~] ~]
17 {[2 "bye"] [1 "hi"]}
19 {[2 "bye"] [1 "hi"]}
18
20
19
21
docs/system/hoon/library/src/1c/mold/trel.md+5−3
@@ -2,17 +2,19 @@
2
2
3Mold of three types
3Mold of three types
4
4
5−[`++mold`]() of the tuple of the three types passed in.
5+`++mold` of the tuple of the three types passed in.
6
6
7Source
7Source
8------
8------
9
9
10− ++ trel |* [a=$+(* *) b=$+(* *) c=$+(* *)] :: just a triple
10+ ++ trel |* {a/$-(* *) b/$-(* *) c/$-(* *)} :: just a triple
11+ {p/a q/b r/c} ::
12+
11
13
12Examples
14Examples
13--------
15--------
14
16
15− ~zod/try=> *(trel ,@ud ,@t ,@s)
17+ ~zod/try=> *(trel @ud @t @s)
16 [p=0 q='' r=--0]
18 [p=0 q='' r=--0]
17
19
18
20
docs/system/hoon/library/src/1c/mold/unit.md+13−7
@@ -2,26 +2,32 @@
2
2
3Maybe
3Maybe
4
4
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
6type that was passed in.
6type that was passed in.
7
7
8
8
9Source
9Source
10------
10------
11
11
12− ++ unit |* a=_,* :: maybe
12+ ++ unit |* a/$-(* *) :: maybe
13+ $@($~ {$~ u/a}) ::
14+
13
15
14Examples
16Examples
15--------
17--------
16
18
17−See also: [`++bind`]()
19+See also: `++bind`
18
20
19− ~zod/try=> :type; *(unit time)
21+ ~zod/try=> ? *(unit time)
22+ ?({$~ u/@da} $~)
20 ~
23 ~
21− u(@da)
22− ~zod/try=> `(unit time)`[~ -<-]
23− [~ ~2014.9.24..19.25.10..7dd5]
24
24
25+ ~zod/try=> > =a |= a/@
26+ ^- (unit @)
27+ ?~ a ~
28+ [~ a]
29+ > (a 2)
30+ [~ u=2]
25
31
26
32
27***
33***
docs/system/hoon/library/src/2a/gate/biff.md+5−4
@@ -2,7 +2,7 @@
2
2
3Unit as argument
3Unit as argument
4
4
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
6`a` (`u.a`). If `a` is empty, `~` is produced.
6`a` (`u.a`). If `a` is empty, `~` is produced.
7
7
8Accepts
8Accepts
@@ -21,16 +21,17 @@ Source
21------
21------
22
22
23 ++ biff :: apply
23 ++ biff :: apply
24− |* [a=(unit) b=$+(* (unit))]
24+ |* {a/(unit) b/$-(* (unit))}
25 ?~ a ~
25 ?~ a ~
26 (b u.a)
26 (b u.a)
27
27
28+
28Examples
29Examples
29--------
30--------
30
31
31− ~zod/try=> (biff (some 5) |=(a=@ (some (add a 2))))
32+ ~zod/try=> (biff (some 5) |=(a/@ (some (add a 2))))
32 [~ u=7]
33 [~ u=7]
33− ~zod/try=> (biff ~ |=(a=@ (some (add a 2))))
34+ ~zod/try=> (biff ~ |=(a/@ (some (add a 2))))
34 ~
35 ~
35
36
36
37
docs/system/hoon/library/src/2a/gate/bind.md+6−5
@@ -2,7 +2,7 @@
2
2
3Non-unit function to unit, producing unit
3Non-unit function to unit, producing unit
4
4
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
6a unit. Used when you want a function that does not accept or produce a
6a unit. Used when you want a function that does not accept or produce a
7unit to both accept and produce a unit.
7unit to both accept and produce a unit.
8
8
@@ -22,17 +22,18 @@ Source
22------
22------
23
23
24 ++ bind :: argue
24 ++ bind :: argue
25− |* [a=(unit) b=gate]
25+ |* {a/(unit) b/gate}
26 ?~ a ~
26 ?~ a ~
27 [~ u=(b u.a)]
27 [~ u=(b u.a)]
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
32− ~zod/try=> (bind ((unit ,@) [~ 97]) ,@t)
33+ ~zod/try=> (bind ((unit @) [~ 97]) ,@t)
33 [~ `a`]
34 [~ `a`]
34− ~zod/try=> =a |=(a=@ (add a 1))
35+ ~zod/try=> =a |=(a/@ (add a 1))
35− ~zod/try=> (bind ((unit ,@) [~ 2]) a)
36+ ~zod/try=> (bind ((unit @) [~ 2]) a)
36 [~ 3]
37 [~ 3]
37
38
38
39
docs/system/hoon/library/src/2a/gate/bond.md+4−3
@@ -2,7 +2,7 @@
2
2
3Replace null
3Replace null
4
4
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
6`a`. If the unit is not empty, then the original unit is produced.
6`a`. If the unit is not empty, then the original unit is produced.
7
7
8Accepts
8Accepts
@@ -21,11 +21,12 @@ Source
21------
21------
22
22
23 ++ bond :: replace
23 ++ bond :: replace
24− |* a=trap
24+ |* a/(trap)
25− |* b=(unit)
25+ |* b/(unit)
26 ?~ b $:a
26 ?~ b $:a
27 u.b
27 u.b
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
docs/system/hoon/library/src/2a/gate/both.md+3−2
@@ -3,7 +3,7 @@
3Group unit values into pair
3Group unit values into pair
4
4
5Produces `~` if either `a` or `b` are empty. Otherwise, produces a
5Produces `~` 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
7`b`.
7`b`.
8
8
9Accepts
9Accepts
@@ -22,11 +22,12 @@ Source
22------
22------
23
23
24 ++ both :: all the above
24 ++ both :: all the above
25− |* [a=(unit) b=(unit)]
25+ |* {a/(unit) b/(unit)}
26 ?~ a ~
26 ?~ a ~
27 ?~ b ~
27 ?~ b ~
28 [~ u=[u.a u.b]]
28 [~ u=[u.a u.b]]
29
29
30+
30Examples
31Examples
31--------
32--------
32
33
docs/system/hoon/library/src/2a/gate/clap.md+7−6
@@ -2,7 +2,7 @@
2
2
3Apply function to two units
3Apply function to two units
4
4
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`--
6to the values of two units, `a` and `b`, producing a unit.
6to the values of two units, `a` and `b`, producing a unit.
7
7
8Accepts
8Accepts
@@ -23,20 +23,21 @@ Source
23------
23------
24
24
25 ++ clap :: combine
25 ++ clap :: combine
26− |* [a=(unit) b=(unit) c=_|=(^ +<-)]
26+ |* {a/(unit) b/(unit) c/_|=(^ +<-)}
27 ?~ a b
27 ?~ a b
28 ?~ b a
28 ?~ b a
29 [~ u=(c u.a u.b)]
29 [~ u=(c u.a u.b)]
30
30
31+
31Examples
32Examples
32--------
33--------
33
34
34− ~zod/try=> =u ((unit ,@t) [~ 'a'])
35+ ~zod/try=> =u ((unit @t) [~ 'a'])
35− ~zod/try=> =v ((unit ,@t) [~ 'b'])
36+ ~zod/try=> =v ((unit @t) [~ 'b'])
36 ~zod/try=> (clap u v |=([a=@t b=@t] (welp (trip a) (trip b))))
37 ~zod/try=> (clap u v |=([a=@t b=@t] (welp (trip a) (trip b))))
37 [~ u="ab"]
38 [~ u="ab"]
38− ~zod/try=> =a ((unit ,@u) [~ 1])
39+ ~zod/try=> =a ((unit @u) [~ 1])
39− ~zod/try=> =b ((unit ,@u) [~ 2])
40+ ~zod/try=> =b ((unit @u) [~ 2])
40 ~zod/try=> =c |=([a=@ b=@] (add a b))
41 ~zod/try=> =c |=([a=@ b=@] (add a b))
41 ~zod/try=> (clap a b c)
42 ~zod/try=> (clap a b c)
42 [~ 3]
43 [~ 3]
docs/system/hoon/library/src/2a/gate/drop.md+5−4
@@ -2,7 +2,7 @@
2
2
3Unit to list
3Unit to list
4
4
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`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -18,17 +18,18 @@ Source
18------
18------
19
19
20 ++ drop :: enlist
20 ++ drop :: enlist
21− |* a=(unit)
21+ |* a/(unit)
22 ?~ a ~
22 ?~ a ~
23 [i=u.a t=~]
23 [i=u.a t=~]
24
24
25+
25Examples
26Examples
26--------
27--------
27
28
28− ~zod/try=> =a ((unit ,@) [~ 97])
29+ ~zod/try=> =a ((unit @) [~ 97])
29 ~zod/try=> (drop a)
30 ~zod/try=> (drop a)
30 [i=97 t=~]
31 [i=97 t=~]
31− ~zod/try=> =a ((unit ,@) [~])
32+ ~zod/try=> =a ((unit @) [~])
32 ~zod/try=> (drop a)
33 ~zod/try=> (drop a)
33 ~
34 ~
34
35
docs/system/hoon/library/src/2a/gate/fall.md+4−3
@@ -2,14 +2,14 @@
2
2
3Give unit a default value
3Give unit a default value
4
4
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.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10`a` is a unit.
10`a` is a unit.
11
11
12−`b` is a [noun]() that's used as the default value.
12+`b` is a noun that's used as the default value.
13
13
14Produces
14Produces
15--------
15--------
@@ -20,9 +20,10 @@ Source
20------
20------
21
21
22 ++ fall :: default
22 ++ fall :: default
23− |* [a=(unit) b=*]
23+ |* {a/(unit) b/*}
24 ?~(a b u.a)
24 ?~(a b u.a)
25
25
26+
26Examples
27Examples
27--------
28--------
28
29
docs/system/hoon/library/src/2a/gate/lift.md+6−5
@@ -2,7 +2,7 @@
2
2
3Curried bind
3Curried bind
4
4
5−Accepts a [`++gate`]() `a` and produces a function that accepts [`++unit`]()
5+Accepts a `++gate` `a` and produces a function that accepts `++unit`
6`b` to which it applies `a`. Used when you want a function that does not accept
6`b` to which it applies `a`. Used when you want a function that does not accept
7or produce a unit to both accept and produce a unit.
7or produce a unit to both accept and produce a unit.
8
8
@@ -22,16 +22,17 @@ Source
22------
22------
23
23
24 ++ lift :: lift gate (fmap)
24 ++ lift :: lift gate (fmap)
25− |* a=gate :: flipped
25+ |* a/gate :: flipped
26− |* b=(unit) :: curried
26+ |* b/(unit) :: curried
27 (bind b a) :: bind
27 (bind b a) :: bind
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
32− ~zod/try=> ((lift dec) `(unit ,@)`~)
33+ ~zod/try=> ((lift dec) `(unit @)`~)
33 ~
34 ~
34− ~zod/try=> ((lift dec) `(unit ,@)`[~ 20])
35+ ~zod/try=> ((lift dec) `(unit @)`[~ 20])
35 [~ 19]
36 [~ 19]
36
37
37
38
docs/system/hoon/library/src/2a/gate/mate.md+12−11
@@ -23,25 +23,26 @@ A unit or crash.
23Source
23Source
24------
24------
25
25
26−++ mate :: choose
26+ ++ mate :: choose
27− |* [a=(unit) b=(unit)]
27+ |* {a/(unit) b/(unit)}
28− ?~ b a
28+ ?~ b a
29− ?~ a b
29+ ?~ a b
30− ?.(=(u.a u.b) ~|('mate' !!) a)
30+ ?.(=(u.a u.b) ~|('mate' !!) a)
31+
31
32
32Examples
33Examples
33--------
34--------
34
35
35− ~zod/try=> =a ((unit ,@) [~ 97])
36+ ~zod/try=> =a ((unit @) [~ 97])
36− ~zod/try=> =b ((unit ,@) [~ 97])
37+ ~zod/try=> =b ((unit @) [~ 97])
37 ~zod/try=> (mate a b)
38 ~zod/try=> (mate a b)
38 [~ 97]
39 [~ 97]
39− ~zod/try=> =a ((unit ,@) [~ 97])
40+ ~zod/try=> =a ((unit @) [~ 97])
40− ~zod/try=> =b ((unit ,@) [~])
41+ ~zod/try=> =b ((unit @) [~])
41 ~zod/try=> (mate a b)
42 ~zod/try=> (mate a b)
42 [~ 97]
43 [~ 97]
43− ~zod/try=> =a ((unit ,@) [~ 97])
44+ ~zod/try=> =a ((unit @) [~ 97])
44− ~zod/try=> =b ((unit ,@) [~ 98])
45+ ~zod/try=> =b ((unit @) [~ 98])
45 ~zod/try=> (mate a b)
46 ~zod/try=> (mate a b)
46 ! 'mate'
47 ! 'mate'
47 ! exit
48 ! exit
docs/system/hoon/library/src/2a/gate/need.md+7−6
@@ -2,7 +2,7 @@
2
2
3Unwrap unit
3Unwrap unit
4
4
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.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -18,20 +18,21 @@ Source
18------
18------
19
19
20 ++ need :: demand
20 ++ need :: demand
21− |* a=(unit)
21+ |* a/(unit)
22− ?~ a !!
22+ ?~ a ~|(%need !!)
23 u.a
23 u.a
24
24
25+
25Examples
26Examples
26--------
27--------
27
28
28− ~zod/try=> =a ((unit ,[@t @t]) [~ ['a' 'b']])
29+ ~zod/try=> =a ((unit [@t @t]) [~ ['a' 'b']])
29 ~zod/try=> (need a)
30 ~zod/try=> (need a)
30 ['a' 'b']
31 ['a' 'b']
31− ~zod/try=> =a ((unit ,@ud) [~ 17])
32+ ~zod/try=> =a ((unit @ud) [~ 17])
32 ~zod/try=> (need a)
33 ~zod/try=> (need a)
33 17
34 17
34− ~zod/try=> =a ((unit ,@) [~])
35+ ~zod/try=> =a ((unit @) [~])
35 ~zod/try=> (need a)
36 ~zod/try=> (need a)
36 ! exit
37 ! exit
37
38
docs/system/hoon/library/src/2b/gate/flop.md+2−1
@@ -19,7 +19,7 @@ Source
19
19
20 ++ flop :: reverse
20 ++ flop :: reverse
21 ~/ %flop
21 ~/ %flop
22− |* a=(list)
22+ |* a/(list)
23 => .(a (homo a))
23 => .(a (homo a))
24 ^+ a
24 ^+ a
25 =+ b=`_a`~
25 =+ b=`_a`~
@@ -28,6 +28,7 @@ Source
28 $(a t.a, b [i.a b])
28 $(a t.a, b [i.a b])
29
29
30
30
31+
31Examples
32Examples
32--------
33--------
33
34
docs/system/hoon/library/src/2b/gate/homo.md+4−3
@@ -2,7 +2,7 @@
2
2
3Homogenize
3Homogenize
4
4
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
6list `a`. Used when you want to make all the types of the elements of a list the same.
6list `a`. Used when you want to make all the types of the elements of a list the same.
7
7
8Accepts
8Accepts
@@ -19,12 +19,13 @@ Source
19------
19------
20
20
21 ++ homo :: homogenize
21 ++ homo :: homogenize
22− |* a=(list)
22+ |* a/(list)
23 ^+ =< $
23 ^+ =< $
24− |% +- $ ?:(_? ~ [i=(snag 0 a) t=$])
24+ |% +- $ ?:(*? ~ [i=(snag 0 a) t=$])
25 --
25 --
26 a
26 a
27
27
28+
28Examples
29Examples
29--------
30--------
30
31
docs/system/hoon/library/src/2b/gate/lent.md+4−3
@@ -2,7 +2,7 @@
2
2
3List length
3List length
4
4
5−Produces the length of any [`++list`]() `a` as an atom.
5+Produces the length of any `++list` `a` as an atom.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -19,13 +19,14 @@ Source
19
19
20 ++ lent :: length
20 ++ lent :: length
21 ~/ %lent
21 ~/ %lent
22− |= a=(list)
22+ |= a/(list)
23 ^- @
23 ^- @
24 =+ b=0
24 =+ b=0
25 |-
25 |-
26− ?~ a b
26+ ?~ a b
27 $(a t.a, b +(b))
27 $(a t.a, b +(b))
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
docs/system/hoon/library/src/2b/gate/levy.md+7−4
@@ -2,7 +2,7 @@
2
2
3Logical "and" on list
3Logical "and" on list
4
4
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`.
6
6
7Accepts
7Accepts
8-------
8-------
@@ -14,24 +14,27 @@ Accepts
14Produces
14Produces
15--------
15--------
16
16
17+A boolean.
18+
17Source
19Source
18------
20------
19
21
20 ++ levy
22 ++ levy
21 ~/ %levy :: all of
23 ~/ %levy :: all of
22− |* [a=(list) b=_|=(p=* .?(p))]
24+ |* {a/(list) b/$-(* ?)}
23 |- ^- ?
25 |- ^- ?
24 ?~ a &
26 ?~ a &
25 ?. (b i.a) |
27 ?. (b i.a) |
26 $(a t.a)
28 $(a t.a)
27
29
30+
28Examples
31Examples
29--------
32--------
30
33
31− ~zod/try=> =a |=(a=@ (lte a 1))
34+ ~zod/try=> =a |=(a/@ (lte a 1))
32 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
35 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
33 %.n
36 %.n
34− ~zod/try=> =a |=(a=@ (lte a 3))
37+ ~zod/try=> =a |=(a/@ (lte a 3))
35 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
38 ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
36 %.y
39 %.y
37
40
docs/system/hoon/library/src/2b/gate/lien.md+16−7
@@ -2,19 +2,28 @@
2
2
3Logical "or" on list
3Logical "or" on list
4
4
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+
5 ++ lien :: some of
17 ++ lien :: some of
6 ~/ %lien
18 ~/ %lien
7− |* [a=(list) b=$+(* ?)]
19+ |* {a/(list) b/$-(* ?)}
8 |- ^- ?
20 |- ^- ?
9 ?~ a |
21 ?~ a |
10 ?: (b i.a) &
22 ?: (b i.a) &
11 $(a t.a)
23 $(a t.a)
12−
24+
13−Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
25+Examples
14−
26+--------
15−`a` is a list.
16−
17−`b` is a gate.
18
27
19 ~zod/try=> =a |=(a=@ (gte a 1))
28 ~zod/try=> =a |=(a=@ (gte a 1))
20 ~zod/try=> (lien (limo [0 1 2 1 ~]) a)
29 ~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
12Produces
12Produces
13--------
13--------
14
14
15−A list
15+A `++list`.
16
16
17Source
17Source
18------
18------
docs/system/hoon/library/src/2b/gate/murn.md+6−5
@@ -2,16 +2,16 @@
2
2
3Maybe transform
3Maybe transform
4
4
5−Passes each member of [`++list`]() `a` to [gate]() `b`, which must produce a
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
6+`++unit`. Produces a new list with all the results that do not produce
7`~`.
7`~`.
8
8
9Accepts
9Accepts
10-------
10-------
11
11
12−`a` is a [list]().
12+`a` is a list.
13
13
14−`b` is a [gate]() that produces a [unit]().
14+`b` is a gate that produces a unit.
15
15
16Produces
16Produces
17--------
17--------
@@ -22,7 +22,8 @@ Source
22------
22------
23
23
24 ++ murn :: maybe transform
24 ++ murn :: maybe transform
25+ ~/ %murn
25− |* [a=(list) b=$+(* (unit))]
26+ |* {a/(list) b/$-(* (unit))}
26 |-
27 |-
27 ?~ a ~
28 ?~ a ~
28 =+ c=(b i.a)
29 =+ c=(b i.a)
docs/system/hoon/library/src/2b/gate/reap.md+5−4
@@ -2,12 +2,12 @@
2
2
3Replicate
3Replicate
4
4
5−Replicate: produces a [`++list`]() containing `a` copies of `b`.
5+Replicate: produces a `++list` containing `a` copies of `b`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`b` is a [noun]()
10+`b` is a noun.
11
11
12Produces
12Produces
13--------
13--------
@@ -18,8 +18,9 @@ Source
18------
18------
19
19
20 ++ reap :: replicate
20 ++ reap :: replicate
21+ ~/ %reap
21− |* [a=@ b=*]
22+ |* {a/@ b/*}
22− |- ^- (list ,_b)
23+ |- ^- (list _b)
23 ?~ a ~
24 ?~ a ~
24 [b $(a (dec a))]
25 [b $(a (dec a))]
25
26
docs/system/hoon/library/src/2b/gate/reel.md+6−5
@@ -2,8 +2,8 @@
2
2
3Right fold
3Right fold
4
4
5−Right fold: moves right to left across a [`++list`]() `a`, recursively slamming
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
6+a binary gate `b` with an element from `a` and an accumulator, producing
7the final value of the accumulator.
7the final value of the accumulator.
8
8
9Accepts
9Accepts
@@ -14,19 +14,20 @@ Accepts
14Produces
14Produces
15--------
15--------
16
16
17−The accumulator, which is a [noun]().
17+The accumulator, which is a noun.
18
18
19Source
19Source
20------
20------
21
21
22− ++ reel :: right fold
22+ ++ reel :: right fold
23 ~/ %reel
23 ~/ %reel
24− |* [a=(list) b=_|=([* *] +<+)]
24+ |* {a/(list) b/_|=({* *} +<+)}
25 |- ^+ +<+.b
25 |- ^+ +<+.b
26 ?~ a
26 ?~ a
27 +<+.b
27 +<+.b
28 (b i.a $(a t.a))
28 (b i.a $(a t.a))
29
29
30+
30Examples
31Examples
31--------
32--------
32
33
docs/system/hoon/library/src/2b/gate/skid.md+6−4
@@ -2,8 +2,8 @@
2
2
3Separate
3Separate
4
4
5−Separates a [`++list`]() `a` into two lists - Those elements of `a` who produce
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`.
6+true when slammed to gate `b` and those who produce `%.n`.
7
7
8Accepts
8Accepts
9-------
9-------
@@ -19,17 +19,19 @@ Source
19------
19------
20
20
21 ++ skid :: separate
21 ++ skid :: separate
22+ ~/ %skid
22− |* [a=(list) b=$+(* ?)]
23+ |* {a/(list) b/$-(* ?)}
23 |- ^+ [p=a q=a]
24 |- ^+ [p=a q=a]
24 ?~ a [~ ~]
25 ?~ a [~ ~]
25 =+ c=$(a t.a)
26 =+ c=$(a t.a)
26 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
27 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
27
28
28
29
30+
29Examples
31Examples
30--------
32--------
31
33
32− ~zod/try=> =a |=(a=@ (gth a 1))
34+ ~zod/try=> =a |=(a/@ (gth a 1))
33 ~zod/try=> (skid (limo [0 1 2 3 ~]) a)
35 ~zod/try=> (skid (limo [0 1 2 3 ~]) a)
34 [p=[i=2 t=[i=3 t=~]] q=[i=0 t=[i=1 t=~]]]
36 [p=[i=2 t=[i=3 t=~]] q=[i=0 t=[i=1 t=~]]]
35
37
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
9Accepts
9Accepts
10-------
10-------
11
11
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.
13
13
14Produces
14Produces
15--------
15--------
16
16
17+A boolean
18+
17Source
19Source
18------
20------
19
21
20−++ skim :: only
22+ ++ skim :: only
21− ~/ %skim
23+ ~/ %skim
22− |* [a=(list) b=_|=(p=* .?(p))]
24+ |* {a/(list) b/$-(* ?)}
23− |-
25+ |-
24− ^+ a`
26+ ^+ a
25− ?~ a ~
27+ ?~ a ~
26− ?:((b i.a) [i.a $(a t.a)] $(a t.a))
28+ ?:((b i.a) [i.a $(a t.a)] $(a t.a))
29+
27
30
28Examples
31Examples
29--------
32--------
30
33
31− ~zod/try=> =a |=(a=@ (gth a 1))
34+ ~zod/try=> =a |=(a/@ (gth a 1))
32 ~zod/try=> (skim (limo [0 1 2 3 ~]) a)
35 ~zod/try=> (skim (limo [0 1 2 3 ~]) a)
33 [i=2 t=[i=3 t=~]]
36 [i=2 t=[i=3 t=~]]
34
37
docs/system/hoon/library/src/2b/gate/skip.md+5−4
@@ -2,14 +2,14 @@
2
2
3Except
3Except
4
4
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`.
6Produces a list of all of the members that produce `%.n`. Inverse of
6Produces a list of all of the members that produce `%.n`. Inverse of
7`++skim`.
7`++skim`.
8
8
9Accepts
9Accepts
10-------
10-------
11
11
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.
13
13
14Produces
14Produces
15--------
15--------
@@ -21,16 +21,17 @@ Source
21
21
22 ++ skip :: except
22 ++ skip :: except
23 ~/ %skip
23 ~/ %skip
24− |* [a=(list) b=_|=(p=* .?(p))]
24+ |* {a/(list) b/$-(* ?)}
25 |-
25 |-
26 ^+ a
26 ^+ a
27 ?~ a ~
27 ?~ a ~
28 ?:((b i.a) $(a t.a) [i.a $(a t.a)])
28 ?:((b i.a) $(a t.a) [i.a $(a t.a)])
29
29
30+
30Examples
31Examples
31--------
32--------
32
33
33− ~zod/try=> =a |=(a=@ (gth a 1))
34+ ~zod/try=> =a |=(a/@ (gth a 1))
34 ~zod/try=> (skip (limo [0 1 2 3 ~]) a)
35 ~zod/try=> (skip (limo [0 1 2 3 ~]) a)
35 [i=0 t=[i=1 t=~]]
36 [i=0 t=[i=1 t=~]]
36
37
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
8Accepts
8Accepts
9-------
9-------
10
10
11−`b` is a [list]().
11+`b` is a list.
12
12
13Produces
13Produces
14--------
14--------
@@ -20,12 +20,13 @@ Source
20
20
21 ++ slag :: suffix
21 ++ slag :: suffix
22 ~/ %slag
22 ~/ %slag
23− |* [a=@ b=(list)]
23+ |* {a/@ b/(list)}
24 |- ^+ b
24 |- ^+ b
25 ?: =(0 a) b
25 ?: =(0 a) b
26 ?~ b ~
26 ?~ b ~
27 $(b t.b, a (dec a))
27 $(b t.b, a (dec a))
28
28
29+
29Examples
30Examples
30--------
31--------
31
32
docs/system/hoon/library/src/2b/gate/snag.md+4−3
@@ -2,13 +2,13 @@
2
2
3Index
3Index
4
4
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
6of `a`and failing if the list is null. Lists are 0-indexed.
6of `a`and failing if the list is null. Lists are 0-indexed.
7
7
8Accepts
8Accepts
9-------
9-------
10
10
11−`b` is a [list]().
11+`b` is a list.
12
12
13Produces
13Produces
14--------
14--------
@@ -20,13 +20,14 @@ Source
20
20
21 ++ snag :: index
21 ++ snag :: index
22 ~/ %snag
22 ~/ %snag
23− |* [a=@ b=(list)]
23+ |* {a/@ b/(list)}
24 |-
24 |-
25 ?~ b
25 ?~ b
26 ~|('snag-fail' !!)
26 ~|('snag-fail' !!)
27 ?: =(0 a) i.b
27 ?: =(0 a) i.b
28 $(b t.b, a (dec a))
28 $(b t.b, a (dec a))
29
29
30+
30Examples
31Examples
31--------
32--------
32
33
docs/system/hoon/library/src/2b/gate/sort.md+7−6
@@ -2,7 +2,7 @@
2
2
3Quicksort
3Quicksort
4
4
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
6produces a loobean. `++sort` then produces a list of the elements of `a`,
6produces a loobean. `++sort` then produces a list of the elements of `a`,
7sorted according to `b`.
7sorted according to `b`.
8
8
@@ -19,21 +19,22 @@ A list
19Source
19Source
20------
20------
21
21
22− ++ sort :: quicksort
22+ ++ sort !. :: quicksort
23 ~/ %sort
23 ~/ %sort
24− |* [a=(list) b=$+([* *] ?)]
24+ |* {a/(list) b/$-([* *] ?)}
25 => .(a ^.(homo a))
25 => .(a ^.(homo a))
26 |- ^+ a
26 |- ^+ a
27 ?~ a ~
27 ?~ a ~
28 %+ weld
28 %+ 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))))
30 ^+ t.a
30 ^+ 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+
32
33
33Examples
34Examples
34--------
35--------
35
36
36− ~zod/try=> =a =|([p=@ q=@] |.((gth p q)))
37+ ~zod/try=> =a =|({p=@ q=@} |.((gth p q)))
37 ~zod/try=> (sort (limo [0 1 2 3 ~]) a)
38 ~zod/try=> (sort (limo [0 1 2 3 ~]) a)
38 ~[3 2 1 0]
39 ~[3 2 1 0]
39
40
docs/system/hoon/library/src/2b/gate/swag.md+4−3
@@ -8,7 +8,7 @@ inclusive index `a`, producing `b` number of characters.
8Accepts
8Accepts
9-------
9-------
10
10
11−`c` is a [list]().
11+`c` is a list.
12
12
13Produces
13Produces
14--------
14--------
@@ -19,8 +19,9 @@ Source
19------
19------
20
20
21 ++ swag :: infix
21 ++ swag :: infix
22− |* [[a=@ b=@] c=(list)]
22+ |* {{a/@ b/@} c/(list)}
23− (scag b (slag a c))
23+ (scag +<-> (slag +<-< c))
24+
24
25
25Examples
26Examples
26--------
27--------
docs/system/hoon/library/src/2b/gate/turn.md+4−3
@@ -2,7 +2,7 @@
2
2
3Gate to list
3Gate to list
4
4
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
6to each element of the original list.
6to each element of the original list.
7
7
8Accepts
8Accepts
@@ -20,17 +20,18 @@ Source
20
20
21 ++ turn :: transform
21 ++ turn :: transform
22 ~/ %turn
22 ~/ %turn
23− |* [a=(list) b=_,*]
23+ |* {a/(list) b/$-(* *)}
24 |-
24 |-
25 ?~ a ~
25 ?~ a ~
26 [i=(b i.a) t=$(a t.a)]
26 [i=(b i.a) t=$(a t.a)]
27
27
28+
28Examples
29Examples
29--------
30--------
30
31
31 ~zod/try=> (turn (limo [104 111 111 110 ~]) ,@t)
32 ~zod/try=> (turn (limo [104 111 111 110 ~]) ,@t)
32 <|h o o n|>
33 <|h o o n|>
33− ~zod/try=> =a |=(a=@ (add a 4))
34+ ~zod/try=> =a |=(a/@ (add a 4))
34 ~zod/try=> (turn (limo [1 2 3 4 ~]) a)
35 ~zod/try=> (turn (limo [1 2 3 4 ~]) a)
35 ~[5 6 7 8]
36 ~[5 6 7 8]
36
37
docs/system/hoon/library/src/2b/gate/weld.md+4−3
@@ -2,24 +2,25 @@
2
2
3Concatenate
3Concatenate
4
4
5−Concatenate two [`++list`]()s `a` and `b`.
5+Concatenate two `++list`s `a` and `b`.
6
6
7Accepts
7Accepts
8-------
8-------
9
9
10−`a` and `b` are [list]()s.
10+`a` and `b` are lists.
11
11
12Source
12Source
13------
13------
14
14
15 ++ weld :: concatenate
15 ++ weld :: concatenate
16 ~/ %weld
16 ~/ %weld
17− |* [a=(list) b=(list)]
17+ |* {a/(list) b/(list)}
18 => .(a ^.(homo a), b ^.(homo b))
18 => .(a ^.(homo a), b ^.(homo b))
19 |- ^+ b
19 |- ^+ b
20 ?~ a b
20 ?~ a b
21 [i.a $(a t.a)]
21 [i.a $(a t.a)]
22
22
23+
23Examples
24Examples
24--------
25--------
25
26
docs/system/hoon/library/src/2b/gate/welp.md+5−4
@@ -2,7 +2,7 @@
2
2
3Perfect weld
3Perfect weld
4
4
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
6to homogenization.
6to homogenization.
7
7
8Accepts
8Accepts
@@ -21,7 +21,7 @@ Source
21------
21------
22
22
23 ++ welp :: perfect weld
23 ++ welp :: perfect weld
24− =| [* *]
24+ =| {* *}
25 |%
25 |%
26 +- $
26 +- $
27 ?~ +<-
27 ?~ +<-
@@ -29,6 +29,7 @@ Source
29 +<-(+ $(+<- +<->))
29 +<-(+ $(+<- +<->))
30 --
30 --
31
31
32+
32Examples
33Examples
33--------
34--------
34
35
@@ -36,10 +37,10 @@ Examples
36 "foobar"
37 "foobar"
37 ~zod/arvo=/hoon/hoon> (welp ~[60 61 62] ~[%a %b %c])
38 ~zod/arvo=/hoon/hoon> (welp ~[60 61 62] ~[%a %b %c])
38 [60 61 62 %a %b %c ~]
39 [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])
40 [60 61 62 %a %b %c ~]
41 [60 61 62 %a %b %c ~]
41 [@ud @ud @ud %a %b %c %~]
42 [@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)
43 [[%sa 1] [%so 2] %si 3]
44 [[%sa 1] [%so 2] %si 3]
44
45
45
46
docs/system/hoon/library/src/2b/gate/zing.md+3−1
@@ -2,7 +2,7 @@
2
2
3Cons
3Cons
4
4
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
6each sublist into the higher.
6each sublist into the higher.
7
7
8Accepts
8Accepts
@@ -27,6 +27,8 @@ Source
27 (welp +<- $(+< +<+))
27 (welp +<- $(+< +<+))
28 --
28 --
29
29
30+
31+
30Examples
32Examples
31--------
33--------
32
34