@@ -24,24 +24,26 @@ A [`unit`](/docs/hoon/reference/stdlib/1c#unit).
2424#### Source
2525
2626```hoon
27− ++ biff
28− |* [a=(unit) b=$-(* (unit))]
29− ?~ a ~
30− (b u.a)
27+++ biff
28+ |* [a=(unit) b=$-(* (unit))]
29+ ?~ a ~
30+ (b u.a)
3131```
3232
3333#### Examples
3434
3535```
36− > (biff (some 5) |=(a=@ (some (add a 2))))
37− [~ u=7]
38−
39− > (biff ~ |=(a=@ (some (add a 2))))
40− ~
36+> (biff (some 5) |=(a=@ (some (add a 2))))
37+[~ u=7]
4138```
4239
40+```
41+> (biff ~ |=(a=@ (some (add a 2))))
42+~
43+```
4344
4445---
46+
4547### `++bind`
4648
4749Non-unit function to [`unit`](/docs/hoon/reference/stdlib/1c#unit), producing [`unit`](/docs/hoon/reference/stdlib/1c#unit)
@@ -63,26 +65,27 @@ A [`unit`](/docs/hoon/reference/stdlib/1c#unit).
6365#### Source
6466
6567```hoon
66− ++ bind
67− |* [a=(unit) b=gate]
68− ?~ a ~
69− [~ u=(b u.a)]
68+++ bind
69+ |* [a=(unit) b=gate]
70+ ?~ a ~
71+ [~ u=(b u.a)]
7072```
7173
72−
7374#### Examples
7475
7576```
76− > (bind ((unit @) [~ 97]) ,@t)
77− [~ u='a']
78−
79− > =a |=(a=@ (add a 1))
80− > (bind ((unit @) [~ 2]) a)
81− [~ u=3]
77+> (bind ((unit @) [~ 97]) ,@t)
78+[~ u='a']
8279```
8380
81+```
82+> =a |=(a=@ (add a 1))
83+> (bind ((unit @) [~ 2]) a)
84+[~ u=3]
85+```
8486
8587---
88+
8689### `++bond`
8790
8891Replace null
@@ -103,11 +106,11 @@ Either the product of `a` or the value inside of [`unit`](/docs/hoon/reference/s
103106#### Source
104107
105108```hoon
106− ++ bond
107− |* a=(trap)
108− |* b=(unit)
109− ?~ b $:a
110− u.b
109+++ bond
110+ |* a=(trap)
111+ |* b=(unit)
112+ ?~ b $:a
113+ u.b
111114```
112115
113116#### Examples
@@ -117,13 +120,15 @@ Either the product of `a` or the value inside of [`unit`](/docs/hoon/reference/s
117120 1.024
118121 > ((bond |.((bex 10))) ~)
119122 1.024
123+```
120124
125+```
121126 > ((bond |.((bex 10))) (slaw %ud '123'))
122127 123
123128```
124129
125−
126130---
131+
127132### `++both`
128133
129134Group [`unit`](/docs/hoon/reference/stdlib/1c#unit) values into pair
@@ -145,31 +150,36 @@ A [`unit`](/docs/hoon/reference/stdlib/1c#unit) of the two initial values.
145150#### Source
146151
147152```hoon
148− ++ both
149− |* [a=(unit) b=(unit)]
150− ?~ a ~
151− ?~ b ~
152− [~ u=[u.a u.b]]
153+++ both
154+ |* [a=(unit) b=(unit)]
155+ ?~ a ~
156+ ?~ b ~
157+ [~ u=[u.a u.b]]
153158```
154159
155160#### Examples
156161
157162```
158− > (both (some 1) (some %b))
159− [~ u=[1 %b]]
163+> (both (some 1) (some %b))
164+[~ u=[1 %b]]
165+```
160166
161− > (both ~ (some %b))
162− ~
167+```
168+> (both ~ (some %b))
169+~
163170```
164171
165172---
173+
166174### `++clap`
167175
168−Apply function to two [`units`](/docs/hoon/reference/stdlib/1c#unit)
176+Combine two [`units`](/docs/hoon/reference/stdlib/1c#unit) with function
169177
170178Applies a binary function `c`--which does not usually accept or produce a
171179[`unit`](/docs/hoon/reference/stdlib/1c#unit)-- to the values of two [`units`](/docs/hoon/reference/stdlib/1c#unit), `a` and `b`, producing a [`unit`](/docs/hoon/reference/stdlib/1c#unit).
172180
181+If `a` is null, produces `b`. If `b` is null, produces `a`. Otherwise, produces the produce of `c` in a `unit`.
182+
173183#### Accepts
174184
175185`a` is a [`unit`](/docs/hoon/reference/stdlib/1c#unit).
@@ -185,31 +195,81 @@ A [`unit`](/docs/hoon/reference/stdlib/1c#unit).
185195#### Source
186196
187197```hoon
188− ++ clap :: combine
189− |* [a=(unit) b=(unit) c=_|=(^ +<-)]
190− ?~ a b
191− ?~ b a
192− [~ u=(c u.a u.b)]
198+++ clap
199+ |* [a=(unit) b=(unit) c=_=>(~ |=(^ +<-))]
200+ ?~ a b
201+ ?~ b a
202+ [~ u=(c u.a u.b)]
193203```
194204
195205#### Examples
196206
197207```
198− > =u ((unit @t) [~ 'a'])
199− > =v ((unit @t) [~ 'b'])
200− > (clap u v |=([a=@t b=@t] (welp (trip a) (trip b))))
201− [~ u="ab"]
208+> (clap ~ `'b' |=([a=@tD b=@tD] `tape`[a b ~]))
209+[~ u='b']
210+```
211+
212+```
213+> (clap `'a' ~ |=([a=@tD b=@tD] `tape`[a b ~]))
214+[~ u='a']
215+```
216+
217+```
218+> (clap `'a' `'b' |=([a=@tD b=@tD] `tape`[a b ~]))
219+[~ u="ab"]
220+```
221+
222+---
223+
224+### `++clef`
225+
226+Compose two [`units`](/docs/hoon/reference/stdlib/1c#unit) with function
227+
228+Applies a binary function `c`--which does not usually accept [`units`](/docs/hoon/reference/stdlib/1c#unit)-- to the values of two [`units`](/docs/hoon/reference/stdlib/1c#unit), `a` and `b`, producing a [`unit`](/docs/hoon/reference/stdlib/1c#unit).
229+
230+If `a` or `b` are null, produces null. Otherwise, produces the produce of `c`.
231+
232+#### Accepts
233+
234+`a` is a `unit`.
235+
236+`b` is a `unit`.
237+
238+`c` is a `gate` that takes a `cell` and produces a `unit`.
239+
240+#### Produces
241+
242+A `unit`.
243+
244+#### Source
245+
246+```hoon
247+++ clef
248+ |* [a=(unit) b=(unit) c=_=>(~ |=(^ `+<-))]
249+ ?~ a ~
250+ ?~ b ~
251+ (c u.a u.b)
252+```
253+
254+#### Examples
202255
203− > =a ((unit @u) [~ 1])
204− > =b ((unit @u) [~ 2])
205− > =c |=([a=@ b=@] (add a b))
256+```
257+> (clef ~ `'b' |=([a=@tD b=@tD] `(unit tape)`[~ [a b ~]]))
258+~
259+```
206260
207− > (clap a b c)
208− [~ 3]
261+```
262+> (clef `'a' ~ |=([a=@tD b=@tD] `(unit tape)`[~ [a b ~]]))
263+~
209264```
210265
266+```
267+> (clef `'a' `'b' |=([a=@tD b=@tD] `(unit tape)`[~ [a b ~]]))
268+[~ "ab"]
269+```
211270
212271---
272+
213273### `++drop`
214274
215275[`Unit`](/docs/hoon/reference/stdlib/1c#unit) to list
@@ -227,26 +287,28 @@ A list.
227287#### Source
228288
229289```hoon
230− ++ drop :: enlist
231− |* a=(unit)
232− ?~ a ~
233− [i=u.a t=~]
290+++ drop
291+ |* a=(unit)
292+ ?~ a ~
293+ [i=u.a t=~]
234294```
235295
236296#### Examples
237297
238298```
239− > =a ((unit @) [~ 97])
240− > (drop a)
241− [i=97 t=~]
242−
243− > =a ((unit @) [~])
244− > (drop a)
245− ~
299+> =a ((unit @) [~ 97])
300+> (drop a)
301+[i=97 t=~]
246302```
247303
304+```
305+> =a ((unit @) [~])
306+> (drop a)
307+~
308+```
248309
249310---
311+
250312### `++fall`
251313
252314Give [`unit`](/docs/hoon/reference/stdlib/1c#unit) a default value
@@ -266,32 +328,125 @@ Either a [`noun`](/docs/glossary/noun) `b` or the unwrapped value of [`unit`](/d
266328#### Source
267329
268330```hoon
269− ++ fall :: default
270− |* [a=(unit) b=*]
271− ?~(a b u.a)
331+++ fall
332+ |* [a=(unit) b=*]
333+ ?~(a b u.a)
334+```
335+
336+#### Examples
337+
338+```
339+> (fall ~ 'a')
340+'a'
341+> (fall [~ u=0] 'a')
342+0
343+```
344+
345+---
346+
347+### `++flit`
348+
349+Make filter
350+
351+Accepts gate `a` which produces a `?`. Applies `a` to `b`, producing `b` wrapped in a `unit` if true, otherwise produces null.
352+
353+`+flit` is a wet gate that takes `a` and produces a new wet gate that takes `b`.
354+
355+#### Accepts
356+
357+`a` is a `gate` which produces `?`, and is the sample of the outer wet gate.
358+
359+`b` is any `noun`, and is the sample of the inner wet gate.
360+
361+#### Produces
362+
363+`(unit [type])`, where `[type]` is the type of `b`.
364+
365+#### Source
366+
367+```hoon
368+++ flit
369+ |* a=$-(* ?)
370+ |* b=*
371+ ?.((a b) ~ [~ u=b])
372+```
373+
374+#### Examples
375+
376+```
377+> =f (flit |=(=@ud ?:(=(ud 1) %.y %.n)))
378+> (f 1)
379+[~ 1]
380+> (f 2)
381+~
382+```
383+
384+---
385+
386+### `++hunt`
387+
388+First of units
389+
390+Apply binary gate `ord`, which produces a `?`, to units `a` and `b`. Produce `a` if true and `b` if false. If `a` is null, produce `b`. If `b` is null, produce `a`.
391+
392+This allows selecting between two units by some rule.
393+
394+#### Accepts
395+
396+`ord` is a `$-(^ ?)` - a binary gate that produces `?`.
397+
398+`a` is a `unit`.
399+
400+`b` is a `unit`.
401+
402+#### Produces
403+
404+A `unit`.
405+
406+#### Source
407+
408+```hoon
409+++ hunt
410+ |* [ord=$-(^ ?) a=(unit) b=(unit)]
411+ ^- %- unit
412+ $? _?>(?=(^ a) u.a)
413+ _?>(?=(^ b) u.b)
414+ ==
415+ ?~ a b
416+ ?~ b a
417+ ?:((ord u.a u.b) a b)
272418```
273419
274420#### Examples
275421
276422```
277− > (fall ~ 'a')
278− 'a'
279− > (fall [~ u=0] 'a')
280− 0
423+> (hunt gte ~ `20)
424+[~ 20]
425+```
426+
427+```
428+> (hunt gte `10 ~)
429+[~ 10]
430+```
431+
432+```
433+> (hunt gte `10 `20)
434+[~ 20]
281435```
282436
283437---
438+
284439### `++lift`
285440
286441Curried bind
287442
288−Accepts a `++gate` `a` and produces a function that accepts [`unit`](/docs/hoon/reference/stdlib/1c#unit)
443+Accepts function `a` and produces a function that accepts [`unit`](/docs/hoon/reference/stdlib/1c#unit)
289444`b` to which it applies `a`. Used when you want a function that does not accept
290445or produce a [`unit`](/docs/hoon/reference/stdlib/1c#unit) to both accept and produce a [`unit`](/docs/hoon/reference/stdlib/1c#unit).
291446
292447#### Accepts
293448
294−`a` is a gate.
449+`a` is a `mold`.
295450
296451`b` is a [`unit`](/docs/hoon/reference/stdlib/1c#unit).
297452
@@ -302,24 +457,26 @@ A [`unit`](/docs/hoon/reference/stdlib/1c#unit).
302457#### Source
303458
304459```hoon
305− ++ lift :: lift gate (fmap)
306− |* a=gate :: flipped
307− |* b=(unit) :: curried
308− (bind b a) :: bind
460+++ lift
461+ |* a=mold
462+ |* b=(unit)
463+ (bind b a)
309464```
310465
311466#### Examples
312467
313468```
314− > ((lift dec) `(unit @)`~)
315− ~
316−
317− > ((lift dec) `(unit @)`[~ 20])
318− [~ 19]
469+> ((lift dec) `(unit @)`~)
470+~
319471```
320472
473+```
474+> ((lift dec) `(unit @)`[~ 20])
475+[~ 19]
476+```
321477
322478---
479+
323480### `++mate`
324481
325482Choose
@@ -343,35 +500,39 @@ A [`unit`](/docs/hoon/reference/stdlib/1c#unit) or crash.
343500#### Source
344501
345502```hoon
346− ++ mate :: choose
347− |* [a=(unit) b=(unit)]
348− ?~ b a
349− ?~ a b
350− ?.(=(u.a u.b) ~|('mate' !!) a)
503+++ mate
504+ |* [a=(unit) b=(unit)]
505+ ?~ b a
506+ ?~ a b
507+ ?.(=(u.a u.b) ~>(%mean.'mate' !!) a)
351508```
352509
353510#### Examples
354511
355512```
356− > =a ((unit @) [~ 97])
357− > =b ((unit @) [~ 97])
358− > (mate a b)
359− [~ 97]
360−
361− > =a ((unit @) [~ 97])
362− > =b ((unit @) [~])
363− > (mate a b)
364− [~ 97]
513+> =a ((unit @) [~ 97])
514+> =b ((unit @) [~ 97])
515+> (mate a b)
516+[~ 97]
517+```
365518
366− > =a ((unit @) [~ 97])
367− > =b ((unit @) [~ 98])
368− > (mate a b)
369− ! 'mate'
370− ! exit
519+```
520+> =a ((unit @) [~ 97])
521+> =b ((unit @) [~])
522+> (mate a b)
523+[~ 97]
371524```
372525
526+```
527+> =a ((unit @) [~ 97])
528+> =b ((unit @) [~ 98])
529+> (mate a b)
530+! 'mate'
531+! exit
532+```
373533
374534---
535+
375536### `++need`
376537
377538Unwrap [`unit`](/docs/hoon/reference/stdlib/1c#unit)
@@ -389,30 +550,35 @@ Either the unwrapped value of `a` (`u.a`), or crash.
389550#### Source
390551
391552```hoon
392− ++ need :: demand
393− |* a=(unit)
394− ?~ a ~|(%need !!)
395− u.a
553+++ need
554+ ~/ %need
555+ |* a=(unit)
556+ ?~ a ~>(%mean.'need' !!)
557+ u.a
396558```
397559
398560#### Examples
399561
400562```
401− > =a ((unit [@t @t]) [~ ['a' 'b']])
402− > (need a)
403− ['a' 'b']
404−
405− > =a ((unit @ud) [~ 17])
406− > (need a)
407− 17
563+> =a ((unit [@t @t]) [~ ['a' 'b']])
564+> (need a)
565+['a' 'b']
566+```
408567
409− > =a ((unit @) [~])
410− > (need a)
411− ! exit
568+```
569+> =a ((unit @ud) [~ 17])
570+> (need a)
571+17
412572```
413573
574+```
575+> =a ((unit @) [~])
576+> (need a)
577+! exit
578+```
414579
415580---
581+
416582### `++some`
417583
418584Wrap value in a [`unit`](/docs/hoon/reference/stdlib/1c#unit)
@@ -430,20 +596,21 @@ A [`unit`](/docs/hoon/reference/stdlib/1c#unit).
430596#### Source
431597
432598```hoon
433− ++ some :: lift (pure)
434− |* a=*
435− [~ u=a]
599+++ some
600+ |* a=*
601+ [~ u=a]
436602```
437603
438604#### Examples
439605
440606```
441− > (some ['a' 'b'])
442− [~ u=['a' 'b']]
443−
444− > (some &)
445− [~ u=%.y]
607+> (some ['a' 'b'])
608+[~ u=['a' 'b']]
446609```
447610
611+```
612+> (some &)
613+[~ u=%.y]
614+```
448615
449616---