on master help sign in
Merge branch 'master' into roll-reel-redux
commit2b16725b96857e1320f645981f3315adefcd88fe authorpoprox <51337059+drbeefsupreme@users.noreply.github.com> dateMon 27 Sep 2021, 14:13 (5 years ago) parent3fd7a2f4f23237
119 files changed+8142−10599
.gitignore+4−1 components/EventPreview.js+42−38 content/blog/value-of-address-space-pt1.md+1−5 content/blog/value-of-address-space-pt2.md+11−33 content/blog/value-of-address-space-pt3.md+5−15 content/docs/_index.md+1−1 content/docs/arvo/concepts/subscriptions.md+43−43 content/docs/development/environment.md+1−1 content/docs/hoon/reference/rune/tis.md+9−3 content/docs/hoon/reference/stdlib/1a.md+403−284 content/docs/hoon/reference/stdlib/1b.md+125−89 content/docs/hoon/reference/stdlib/1c.md+201−122 content/docs/hoon/reference/stdlib/2a.md+298−131 content/docs/hoon/reference/stdlib/2b.md+630−431 content/docs/hoon/reference/stdlib/2c.md+713−637 content/docs/hoon/reference/stdlib/2d.md+55−54 content/docs/hoon/reference/stdlib/2e.md+98−178 content/docs/hoon/reference/stdlib/2f.md+163−285 content/docs/hoon/reference/stdlib/2g.md+26−26 content/docs/hoon/reference/stdlib/2h.md+345−345 content/docs/hoon/reference/stdlib/2i.md+720−436 content/docs/hoon/reference/stdlib/2j.md+263−155 content/docs/hoon/reference/stdlib/2k.md+191−135 content/docs/hoon/reference/stdlib/2l.md+5−3 content/docs/hoon/reference/stdlib/2m.md+40−32 content/docs/hoon/reference/stdlib/2n.md+152−138 content/docs/hoon/reference/stdlib/2o.md+99−86 content/docs/hoon/reference/stdlib/2p.md+125−119 content/docs/hoon/reference/stdlib/2q.md+350−139 content/docs/hoon/reference/stdlib/3a.md+25−5 content/docs/hoon/reference/stdlib/3b.md+200−29 content/docs/hoon/reference/stdlib/3c.md+26−10 content/docs/hoon/reference/stdlib/3d.md+26−12 content/docs/hoon/reference/stdlib/3f.md+20−4 content/docs/hoon/reference/stdlib/3g.md+23−42 content/docs/hoon/reference/stdlib/4a.md+5−1 content/docs/hoon/reference/stdlib/4b.md+36−37 content/docs/hoon/reference/stdlib/4c.md+12−16 content/docs/hoon/reference/stdlib/4d.md+4−4 content/docs/hoon/reference/stdlib/4e.md+20−33 content/docs/hoon/reference/stdlib/4f.md+49−53 content/docs/hoon/reference/stdlib/4g.md+8−8 content/docs/hoon/reference/stdlib/4h.md+66−64 content/docs/hoon/reference/stdlib/4i.md+70−72 content/docs/hoon/reference/stdlib/4j.md+62−64 content/docs/hoon/reference/stdlib/4k.md+5−5 content/docs/hoon/reference/stdlib/4l.md+11−13 content/docs/hoon/reference/stdlib/4m.md+20−18 content/docs/hoon/reference/stdlib/4n.md+15−13 content/docs/hoon/reference/stdlib/4o.md+31−127 content/docs/hoon/reference/stdlib/5c.md+77−1 content/docs/hoon/reference/stdlib/5f.md+18−23 content/docs/hoon/reference/stdlib/table-of-contents.md+95−63 content/grants/analytics-script.md+2−1 content/grants/art-by-urbit.md+1 content/grants/authenticate-with-urbit.md+36 content/grants/azimuth-cli.md+164 content/grants/bridge-l2-revamp.md+1 content/grants/calendar-ui.md+1 content/grants/comprehensive-local-server-and-mum-explanation-video.md+2−1 content/grants/contacts.md+1 content/grants/content-producer.md+1 content/grants/cross-platform-desktop-urbit-app.md+2−1 content/grants/educational-guide-todomvc-urbit-edition.md+1 content/grants/feed-aggregator.md+1 content/grants/graph-store-documentation-guide.md+1 content/grants/guide-to-s3.md+1 content/grants/host-two-urbit-meetups-12.md+2−1 content/grants/host-two-urbit-meetups-13.md+59 content/grants/host-two-urbit-meetups-14.md+59 content/grants/host-two-urbit-meetups-15.md+59 content/grants/json-jet.md+1 content/grants/links-in-urbit-reference-docs.md+2−1 content/grants/login-with-urbit.md+1 content/grants/machine-learning.md+1 content/grants/minimal-urbit-os.md+1 content/grants/network-explorer-data-pipeline-http-api.md+1 content/grants/network-explorer.md−233 content/grants/nuck-jet.md+1 content/grants/overhaul-the-urbitorg-website.md+1 content/grants/planet-sales.md+1 content/grants/pokur.md+90 content/grants/search-in-groups.md+1−1 content/grants/slaw-scot-jets.md+1−1 content/grants/-smol-future-sustained-knowledge-sharing-and-marketing.md → content/grants/smol-future-sustained-knowledge-sharing-and-marketing.md content/grants/speech-recognition.md+1 content/grants/translate-key-parts-of-urbitorg-into-german.md+1 content/grants/translate-key-parts-of-urbitorg-into-korean.md+1 content/grants/translate-key-parts-of-urbitorg-into-spanish.md+1 content/grants/try-urbit-website.md+2−1 content/grants/ucal-google-and-outlook-integration.md+1 content/grants/urbian-a-customized-linux-distribution-for-urbit-appliances.md+1 content/grants/urbit-community-concierge-east-coast-2q2021.md+2−1 content/grants/urbit-community-concierge-east-coast.md+2−1 content/grants/urbit-community-concierge-west-coast-2q2021.md+2−1 content/grants/urbit-community-concierge-west-coast.md+2−1 content/grants/urbit-event-series.md+1 content/grants/urbit-explainer-video.md+1 content/grants/urbit-http-api-for-emacs-elisp.md+1 content/grants/urbit-http-api-for-kotlin.md+1 content/grants/urbit-http-api-for-python.md+1 content/grants/urbit-http-api-for-rust.md+1 content/grants/urbit-http-interface-java-edition.md+1 content/grants/urbit-http-library-for-ruby.md+1 content/grants/urbit-irc-bridge.md+1 content/grants/urbit-lfs-filehosting.md+1 content/grants/urbit-react-cookbook.md+1 content/grants/video-content-manager.md+1 content/grants/volt-lightning-on-urbit.md+1 content/grants/webrtc-gall-agent-and-external-app.md+15−17 content/grants/webrtc.md−80 lib/glossary.js+665−532 next.config.js−8 package-lock.json+865−3153 package.json+1−5 pages/events.js+15−4 pages/events/[slug].js+2−2 pages/index.js+11−6 yarn.lock−1865
.gitignore+4−1
@@ -13,6 +13,7 @@
1313# next.js
1414/.next/
1515/out/
16+.next
1617
1718# production
1819/build
@@ -37,4 +38,6 @@ yarn-error.log*
3738.vercel
3839
3940# editors
40−/.nova/
41+/.nova/
42+
43+yarn.lock
components/EventPreview.js+42−38
@@ -4,6 +4,7 @@ import {
44 ShowOrHide,
55 ReadableList,
66 Person,
7+ Name,
78 DateRange,
89} from "../components/Snippets";
910import {
@@ -14,6 +15,42 @@ import {
1415 formatTimeZone,
1516} from "../lib/lib";
1617
18+// JAL(2021.9.13) Couldn't quite get this to work properly. There's a trailing
19+// "and"
20+//
21+// function GuestList({ guests, textClass }) {
22+
23+// const renderGuests = guests?.length > 2 ? guests?.slice(0,2) : guests;
24+// const noRenderGuestsCount = guests?.slice(2).length;
25+
26+// return (
27+// <p className={textClass + " type-sub"}>
28+// <b>
29+// {renderGuests?.length > 1 ? "With guests " : "With guest "}
30+// </b>
31+// <ReadableList>
32+// {renderGuests?.map((guest, index) => (
33+// <>
34+// <Person
35+// key={`${guest.name}-${guest.patp}`}
36+// nameClassNames={textClass}
37+// patpClassNames={textClass}
38+// name={guest.name}
39+// patp={guest.patp}
40+// />
41+// {renderGuests?.length > 1 ? <span>, </span> : <></>}
42+// </>
43+// ))}
44+// {noRenderGuestsCount > 1 ?
45+// <Name>{noRenderGuestsCount} more </Name>
46+// :
47+// <></>
48+// }
49+// </ReadableList>
50+// </p>
51+// );
52+// }
53+
1754export default function EventPreview({ event, className, big }) {
1855 // Event tiles have a 'dark mode' used when their background images are dark and white text is needed for legibility.
1956 const grayText = event?.dark ? "text-washedWhite" : "text-wall-400";
@@ -46,7 +83,11 @@ export default function EventPreview({ event, className, big }) {
4683 } flex-col h-full`}
4784 >
4885 <h3 className={`${blackText} mb-2`}>{event.title}</h3>
49− <p className={`${blackText} mb-2`}>{event.location}</p>
86+ <p className={blackText + ""}>{event.description}</p>
87+ </div>
88+
89+ <div className="absolute p-6 left-0 bottom-0 w-full pr-32">
90+ <p className={`${blackText} type-sub mb-1`}>{event.location}</p>
5091 <DateRange
5192 starts={starts}
5293 ends={ends}
@@ -54,43 +95,6 @@ export default function EventPreview({ event, className, big }) {
5495 />
5596 </div>
5697
57− <div className="absolute p-6 left-0 bottom-0 w-full pr-32">
58− <ShowOrHide condition={event.hosts}>
59− <p className={blackText + " type-sub"}>
60− <b>{"Hosted by "}</b>
61− <ReadableList>
62− {event.hosts?.map((host, index) => (
63− <Person
64− key={`${host.name}-${host.patp}`}
65− nameClassNames={blackText}
66− patpClassNames={blackText}
67− name={host.name}
68− patp={host.patp}
69− />
70− ))}
71− </ReadableList>
72− </p>
73− </ShowOrHide>
74− <ShowOrHide condition={event.guests}>
75− <p className={blackText + " type-sub"}>
76− <b>
77− {event.guests?.length > 1 ? "With guests " : "With guest "}
78− </b>
79− <ReadableList>
80− {event.guests?.map((guest, index) => (
81− <Person
82− key={`${guest.name}-${guest.patp}`}
83− nameClassNames={blackText}
84− patpClassNames={blackText}
85− name={guest.name}
86− patp={guest.patp}
87− />
88− ))}
89− </ReadableList>
90− </p>
91− </ShowOrHide>
92− </div>
93−
9498 {inFuture && event.registration_url ? (
9599 <div className="absolute right-0 bottom-0 p-6">
96100 <a
content/blog/value-of-address-space-pt1.md+1−5
@@ -9,11 +9,7 @@ ship = "~patnes-rigtyn + ~ravmel-ropdyl"
99image = "https://media.urbit.org/site/posts/essays/value-of-address-space-pt1.jpg"
1010+++
1111
12−<br>
13−
14−<img class="ba" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt1.jpg">
15−
16−<br>
12+![](https://media.urbit.org/site/posts/essays/value-of-address-space-pt1.jpg)
1713
1814_This is the first in a series of three posts on Urbit address space. See also [part 2](https://urbit.org/blog/value-of-address-space-pt2/) and [part 3](https://urbit.org/blog/value-of-address-space-pt3/)._
1915
content/blog/value-of-address-space-pt2.md+11−33
@@ -9,11 +9,7 @@ ship = "~patnes-rigtyn + ~ravmel-ropdyl"
99image = "https://media.urbit.org/site/posts/essays/value-of-address-space-pt2.jpg"
1010+++
1111
12−<br>
13−
14−<img class="ba" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt2.jpg">
15−
16−<br>
12+![](https://media.urbit.org/site/posts/essays/value-of-address-space-pt2.jpg)
1713
1814_This is the second in a series of three posts on Urbit address space. See also [part 1](https://urbit.org/blog/value-of-address-space-pt1/) and [part 3](https://urbit.org/blog/value-of-address-space-pt3/)._
1915
@@ -25,21 +21,17 @@ Value and price are distinct concepts that often get conflated. In our view, Urb
2521
2622256 galaxies, ~65,000 stars, ~4B planets.
2723
28−<br>
29−
30−<img class="ba w-100" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt2a.svg">
31−
32−<br>
24+![](https://media.urbit.org/site/posts/essays/value-of-address-space-pt2a.svg)
3325
3426A foundational design principle of the Urbit network is that the address space is limited. This rarity helps qualify Urbit as a [collectible](https://nakamotoinstitute.org/shelling-out/), and thus creates a non-zero acquisition cost for an address. This cost discourages abuses like spam and bot-net attacks. Traditionally, these attacks are made with quasi-unlimited access to IP addresses. The unit economics of acquiring planets for these nefarious purposes is a strong deterrent.
3527
36−There are 256 galaxies on the network. Each galaxy is initialized with ownership of 256 stars. Galaxies act as root nodes for peer discovery and packet routing within the Urbit network, and they are each also entitled to vote on updates to the smart contracts which govern the network. To date, galaxies trade primarily on OTC (over the counter) desks, and rarely appear on the open market.
28+There are 256 galaxies on the network. Each galaxy is initialized with ownership of 255 stars. Galaxies act as root nodes for peer discovery and packet routing within the Urbit network, and they are each also entitled to vote on updates to the smart contracts which govern the network. To date, galaxies trade primarily on OTC (over the counter) desks, and rarely appear on the open market.
3729
38−There are 65,536 total stars on the network. In turn, each star is initialized with ownership of 65,536 planets. Stars currently trade on platforms independent of Tlon, such as [urbit.live](https://urbit.live/) and [opensea.io](https://opensea.io/). The current price range can easily be ascertained on those sites, but as of the time of this writing, stars are selling at a price that greatly discounts their planet holdings.
30+There are 65,280 total stars on the network. In turn, each star is initialized with ownership of 65,535 planets. Stars currently trade on platforms independent of Tlon, such as [urbit.live](https://urbit.live/) and [opensea.io](https://opensea.io/). The current price range can easily be ascertained on those sites, but as of the time of this writing, stars are selling at a price that greatly discounts their planet holdings.
3931
4032One would expect that in an efficient market the relative pricing of stars on one hand, and planets on the other hand would eventually align (so to speak). This may come to pass as the Urbit community increases education about Urbit, and as additional planet sellers and hosting providers enter the space.
4133
42−Finally, there are 4,294,967,296 (or 2<sup>32</sup>) planets on the network. Planets currently trade largely in a range of $10 to $15. We expect planet prices to fluctuate from provider to provider as described in the previous post, based on the quality of services various providers offer. That said, it's worth noting that the cost to configure addresses for distribution is fairly static and this may act as something of a lower bound.
34+Finally, there are 4,294,901,760 (or ~2<sup>32</sup>) planets on the network. Planets currently trade largely in a range of $10 to $15. We expect planet prices to fluctuate from provider to provider as described in the previous post, based on the quality of services various providers offer. That said, it's worth noting that the cost to configure addresses for distribution is fairly static and this may act as something of a lower bound.
4335
4436That said, we also anticipate that planet prices will be abstracted away from most purchasers, and will be included in bundled annual packages of hosting and data routing services. For this reason, infrastructure service providers (i.e. hosting providers) will likely be the best positioned parties to capture value from planet distribution.
4537
@@ -65,31 +57,21 @@ Utility is only one component of a value calculation. To further develop the inq
6557
6658Urbit IDs are individually represented by non-fungible ERC-721 tokens, and can therefore be sold by any platform that supports this token standard. Currently there are three known Urbit-exclusive sales platforms and one generalized ERC-721 platform that list Urbit IDs. Prices for stars and planets are readily available. Volume is low, as no effort has been made to promote the fact of availability, yet the number of [total transactions](https://azimuth.network/stats/events.txt) has increased steadily since the network was launched to Ethereum in 2019, even absent public messaging.
6759
68−<br>
69−<img class="" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt2-tps.svg">
70−<br>
60+![](https://media.urbit.org/site/posts/essays/value-of-address-space-pt2-tps.svg)
7161
72−<br>
73−<img class="" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt2-tss.svg">
74−<br>
62+![](https://media.urbit.org/site/posts/essays/value-of-address-space-pt2-tss.svg)
7563
7664Buying non-fungible tokens like Urbit IDs is rather different than trading quasi-fungible tokens like Bitcoin (even setting aside the issue of volume). Each Urbit ID is unique, and so they tend to be purchased by end users for their specific characteristics, rather than generically. As an example, the planet `~parret-barret` sold for about $1,000 at a time when most planets were selling for $10-20, perhaps due to its rhyming name. Planets with circular sigils also often sell for significantly more than other planets — we’re not entirely sure why this is the case.
7765
7866## Planet Sales
7967
80−<br>
81−<img class="" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt2e-price-eth.svg">
82−<br>
68+![](https://media.urbit.org/site/posts/essays/value-of-address-space-pt2e-price-eth.svg)
8369
84−<br>
85−<img class="" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt2e-price-btc.svg">
86−<br>
70+![](https://media.urbit.org/site/posts/essays/value-of-address-space-pt2e-price-btc.svg)
8771
8872## Star Sales
8973
90−<br>
91−<img class="w-100" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt2e-price-btc-usd.svg">
92−<br>
74+![](https://media.urbit.org/site/posts/essays/value-of-address-space-pt2e-price-btc-usd.svg)
9375
9476This ID-specific trading pattern is generally appropriate in our view: Urbit ID isn’t designed to be rapidly traded at high volume. Urbit is more like a house than a fungible good like a currency.
9577
@@ -97,11 +79,7 @@ For the time being buying and selling of Urbit IDs happens through auctions on s
9779
9880Strictly speaking, liquidity is a measure of the degree to which a given asset will change in value due to a given transaction. In that sense, Urbit address space is likely fairly illiquid. But liquidity can’t be properly understood without volume. As noted above, the volume of transactions on the network has been steadily increasing since inception, and yet the price has remained fairly constant. This seems to indicate a healthy ratio.
9981
100−<br>
101−
102−<img class="ba w-100" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt2b.svg">
103−
104−<br>
82+![](https://media.urbit.org/site/posts/essays/value-of-address-space-pt2b.svg)
10583
10684A further impact on liquidity and volume is that of available supply. At present, the majority of Urbit address space is locked by smart contracts. These lockups began to release at varying linear rates in January 2019. All address space will be completely unlocked and tradeable by January 2025. Eventually as both understanding and demand increase, we anticipate that planets will find an equilibrium price, and stars will be repriced accordingly.
10785
content/blog/value-of-address-space-pt3.md+5−15
@@ -11,9 +11,7 @@ image = "https://media.urbit.org/site/posts/essays/value-of-address-space-pt3.jp
1111
1212<br>
1313
14−<img class="ba" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt3.jpg">
15−
16−<br>
14+![](https://media.urbit.org/site/posts/essays/value-of-address-space-pt3.jpg)
1715
1816_This is the third in a series of three posts on Urbit address space. See also [part 1](https://urbit.org/blog/value-of-address-space-pt1/) and [part 2](https://urbit.org/blog/value-of-address-space-pt2/)._
1917
@@ -53,13 +51,9 @@ A locked star is held in a contract and can neither be booted nor issue planets.
5351
5452In practice, the only Urbit IDs that are ‘locked’ are stars. A galaxy that is said to be locked is simply a galaxy whose stars are currently held by a lockup contract. A locked galaxy can be transferred (i.e. sold or simply moved to a new key) and booted (importantly, any galaxy—booted or not—can vote), but it can’t issue stars until the lockup contract expires.
5553
56−<br>
57−<img class="ba" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt3-graph1.png">
58−<br>
54+![Star Unlocking Schedule](https://media.urbit.org/site/posts/essays/value-of-address-space-pt3-graph1.png)
5955
60−<br>
61−<img class="ba" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt3-graph2.png">
62−<br>
56+![Total Urbit IDs Spawned and Activated](https://media.urbit.org/site/posts/essays/value-of-address-space-pt3-graph2.png)
6357
6458These lockups all began to release at varying linear rates in January 2019 (specifically on Tue Jan 08 23:34:41 2019 UTC).
6559
@@ -78,9 +72,7 @@ Spawning Limits –
7872
7973Unlocked stars are further gated by the number of planets they’re able to spawn. Every unlocked star was immediately able to spawn 1024 planets from the moment Urbit went live on the blockchain in January 2019—we wanted everyone to be able to invite some friends to their communities right away. From that date forward, the spawnable amount doubles every year (365 days), maxing out at 65,535 spawnable planets after 6 years.
8074
81−<br>
82−<img class="ba" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt3-graph3.png">
83−<br>
75+![Total Spawnable Planets and Spawnable Planets per Star](https://media.urbit.org/site/posts/essays/value-of-address-space-pt3-graph3.png)
8476
8577When we layer the spawning limits over the various lockup contracts, we find that all Urbit address space is both unlocked and spawnable by January 9, 2025.
8678
@@ -92,9 +84,7 @@ We consider the opacity of our understanding about transactions on the network t
9284
9385The chart below is an estimate (as of January 2020) based on our general understanding of how galaxies are distributed. Much of this is anecdotal, and it’s largely based on the very few transactions we’ve observed within the galaxy table since Urbit went on chain in 2019. This chart should therefore be understood as incomplete, and an estimate only.
9486
95−<br>
96−<img class="ba" src="https://media.urbit.org/site/posts/essays/value-of-address-space-pt3-graph4.png">
97−<br>
87+![Estimated Galaxy Distribution](https://media.urbit.org/site/posts/essays/value-of-address-space-pt3-graph4.png)
9888
9989Address space distribution is best understood in terms of galaxies and stars independently, as they’re distinct assets. The chart above only illustrates galaxy distribution, but describes Tlon’s “naked” galaxy holdings, which are galaxies empty of their stars. These galaxies are empty because the stars they once contained have been distributed, primarily to Tlon contractors, employees, and to certain private buyers.
10090
content/docs/_index.md+1−1
@@ -6,7 +6,7 @@ template = "sections/docs.html"
66
77Welcome to the developer documentation for the Urbit project. This documentation
88is maintained by [Tlon](https://tlon.io) and the Urbit community in a public
9−[Github repository](https://github.com/urbit/docs). Issues and contributions are
9+[Github repository](https://github.com/urbit/urbit.org/tree/master/content/docs). Issues and contributions are
1010welcome.
1111
1212This documentation provides a series of explainers, guides, tutorials and
content/docs/arvo/concepts/subscriptions.md+43−43
@@ -4,7 +4,7 @@ weight = 50
44template = "doc.html"
55+++
66
7−Urbit relies heavily on subscriptions throughout the stack. We strongly
7+Urbit relies heavily on subscriptions throughout the stack. We strongly
88prefer reactive data flow compared to querying or polling, which is why
99for example our equivalent to git natively supports subscriptions to its
1010data.
@@ -12,7 +12,7 @@ data.
1212We have many application-level styles of subscription, but we only have
1313three true subscription types in Arvo, named for the vane they're
1414implemented in: Clay subscriptions (filesystem), Gall subscriptions
15−(applications), and Jael subscriptions (Urbit ID info). They're at
15+(applications), and Jael subscriptions (Urbit ID info). They're at
1616three different points in the idea maze of subscriptions, and we'll
1717encounter each of them here.
1818
@@ -28,9 +28,9 @@ later request.
2828### Exactly-once updates
2929
3030Some subscriptions need the subscriber to receive each update separately
31−instead of collapsing them into a single diff. Sometimes a subscription
31+instead of collapsing them into a single diff. Sometimes a subscription
3232is really a sequence of commands, in which case there's no meaningful
33−way to collapse them. Similarly, software updates may be expected to be
33+way to collapse them. Similarly, software updates may be expected to be
3434applied in order.
3535
3636### Syncing data
@@ -38,79 +38,79 @@ applied in order.
3838Other times, it's more natural to think of a subscription as
3939communicating a data structure, where the only goal is to keep the data
4040structure on the subscriber's side up-to-date with what's on the
41−publisher's side. In this case, it's perfectly fine to collapse several
41+publisher's side. In this case, it's perfectly fine to collapse several
4242updates into one large update, or even to resend the entire data
43−structure. Partial updates exist only as an optimization.
43+structure. Partial updates exist only as an optimization.
4444
4545For this sort of subscription, we commonly use terms like "diff" instead
4646of "message" or "update", and we say that we "apply a diff" instead of
47−"process an update". We also often identify the subscription with the
47+"process an update". We also often identify the subscription with the
4848data structure itself.
4949
5050## Memory pressure
5151
5252Naively implemented, subscriptions pose a memory leak risk if the
5353subscriber can't receive updates as fast as the publisher wants to send
54−them. This commonly happens when the subscriber goes offline for an
55−extended period of time (possibly forever; especially for comets). It's
54+them. This commonly happens when the subscriber goes offline for an
55+extended period of time (possibly forever; especially for comets). It's
5656sufficient to bound the amount of memory dedicated to any particular
5757subscriber.
5858
5959In a synchronous system, you don't have to worry about what happens if
60−one side or the other ceases to be available. All of our subscriptions,
60+one side or the other ceases to be available. All of our subscriptions,
6161though, can happen between ships.
6262
6363### Small data
6464
6565For particularly low-volume subscriptions, it may be acceptable to
66−ignore the problem. Jael uses this approach, since the only time it's
66+ignore the problem. Jael uses this approach, since the only time it's
6767used across ships is to update moon keys, which is very low-volume and
68−less than 1KB per update. If these subscriptions are used for more,
68+less than 1KB per update. If these subscriptions are used for more,
6969this strategy will have to be revisited.
7070
7171### Buffers
7272
73−A common solution to this problem is the venerable buffer. If more than
74−N updates need to be sent, start dropping updates. There are several
73+A common solution to this problem is the venerable buffer. If more than
74+N updates need to be sent, start dropping updates. There are several
7575options for what to do when the buffer is full and the publisher wishes
7676to send another message:
7777
78−- Drop the oldest message. Particularly suitable for systems where new
79−messages obsolete old ones. For example, if you just need the latest
80−ticker price for an asset, you could use a buffer size of one and
81−replaced it any time you have a new price.
78+- Drop the oldest message. Particularly suitable for systems where new
79+ messages obsolete old ones. For example, if you just need the latest
80+ ticker price for an asset, you could use a buffer size of one and
81+ replaced it any time you have a new price.
8282
83−- Don't add the new message to the buffer. Semantically this is usually
84−less helpful, but mechanically it can be simpler and reduce memory
85−churn, since the buffer stops changing and new messages are simply
86−ignored.
83+- Don't add the new message to the buffer. Semantically this is usually
84+ less helpful, but mechanically it can be simpler and reduce memory
85+ churn, since the buffer stops changing and new messages are simply
86+ ignored.
8787
88−- Drop the newest message and close the subscription. Unlike the
89−previous two, this is compatible with the principle of exactly-once
90−messaging. Specifically, it preserves the guarantee that you won't
91−receive two non-consecutive subscription updates, at the cost of making
92−you resubscribe if you fall behind.
88+- Drop the newest message and close the subscription. Unlike the
89+ previous two, this is compatible with the principle of exactly-once
90+ messaging. Specifically, it preserves the guarantee that you won't
91+ receive two non-consecutive subscription updates, at the cost of making
92+ you resubscribe if you fall behind.
9393
94−Gall subscriptions use the last of these. The buffer is bounded by a
94+Gall subscriptions use the last of these. The buffer is bounded by a
9595simple heuristic, and when a subscription exceeds that buffer, it is
9696closed and the app is expected to resubscribe when they come back
97−online. Note that even though the subscription is closed, messages in
97+online. Note that even though the subscription is closed, messages in
9898flight cannot be removed until they've been acknowledged since Ames
9999guarantees exactly-once messaging, so those last few messages will be
100100stuck in memory until the subscriber comes back online.
101101
102102Buffers are commonly bounded by size, but this puts constraints on the
103−types of messages may be sent. They may also be bounded in time: if the
103+types of messages may be sent. They may also be bounded in time: if the
104104subscriber stops taking messages for at least X time, the buffer is
105−full. Gall taks a hybrid approach; currently the heuristic is that the
105+full. Gall taks a hybrid approach; currently the heuristic is that the
106106buffer counts as full if it has at least five messages and it has been
10710730 seconds since a message was acknowledged.
108108
109109### One at a time
110110
111−Another scheme is to avoid multi-message subscriptions. Instead of
111+Another scheme is to avoid multi-message subscriptions. Instead of
112112allowing the subscriber to subscribe to all future updates on a path,
113−allow them to "subscribe" to the *next* update only. When they get that
113+allow them to "subscribe" to the _next_ update only. When they get that
114114update, they subscribe to the new next update, so that they ultimately
115115get every message.
116116
@@ -122,41 +122,41 @@ This is near the theoretical ideal for memory usage, since you'll never
122122queue up several messages to send to the subscriber.
123123
124124It also encourages processing each update in order rather than zooming
125−forward from time to time. It's possible (if a little awkward) to
125+forward from time to time. It's possible (if a little awkward) to
126126simulate this with buffers though, and it's possible to allow zooming
127127forward in the one-at-a-time scheme by having the requests be "most
128128recent after update N" instead of "next after update N".
129129
130130This scheme is at its strongest, then, when you're already storing
131131intermediate states or updates, or when you don't care about
132−intermediate states and always send the most recent one. Otherwise,
132+intermediate states and always send the most recent one. Otherwise,
133133buffers are a convenient place to temporarily store updates that you
134−don't want to store internally. Of course, if it's semantically
134+don't want to store internally. Of course, if it's semantically
135135important that you give each update separately, buffers won't save you
136136from having to store the intermediate updates, since they may fill up.
137137
138138Another conceptual advantage is that it has no notion of "connectivity".
139−It operates forever in a single mode. By contrast, buffer-based
139+It operates forever in a single mode. By contrast, buffer-based
140140solutions must keep track of whether the buffer is full and react to
141−that. This increases complexity in the system, and complexity is the
141+that. This increases complexity in the system, and complexity is the
142142great evil.
143143
144144The biggest disadvantage of this system is that it takes much longer to
145−process many small updates. With buffers, the publisher could have a
145+process many small updates. With buffers, the publisher could have a
146146dozen small updates in flight at the same time, while in this scheme
147147they would only send one at a time, waiting for a response between each
148−one. Losing this pipelining can be quite significant for some
148+one. Losing this pipelining can be quite significant for some
149149applications, but for low-volume subscriptions (certainly anything that
150150updates less than once per minute) this will have no noticeable effect.
151151
152−Clay uses this scheme. It's low-volume, it stores all previous states
152+Clay uses this scheme. It's low-volume, it stores all previous states
153153anyway (since it's a revision-control system), and it's sometimes
154154important to get updates one at a time (for example when downloading OTA
155−software updates). Ships that send OTA updates often have many ships
155+software updates). Ships that send OTA updates often have many ships
156156subscribed to them, and the updates themselves may be large, so it's
157157important they don't queue up when ships inevitably disappear.
158158
159159I tend to think most Gall subscriptions should follow this pattern as
160−well. Our most latency-sensitive subscriptions are chat messages, and
160+well. Our most latency-sensitive subscriptions are chat messages, and
161161while I haven't tested it, I would guess that even those wouldn't be
162162affected by this scheme.
content/docs/development/environment.md+1−1
@@ -14,7 +14,7 @@ To do work with Hoon, we recommended using a "fake" ship -- one that's not
1414connected to the network.
1515
1616Because such a ship has no presence on the network, you don't need an Azimuth
17−identity. You just need to have [installed the Urbit binary](/getting-started).
17+identity. You just need to have [installed the Urbit binary](/getting-started/cli).
1818
1919To create a fake ship named `~zod`, run the command below. You can replace `zod`
2020with any valid Urbit ship-name.
content/docs/hoon/reference/rune/tis.md+9−3
@@ -423,11 +423,11 @@ Regular: **running**.
423423
424424### `=*` "tistar"
425425
426−`[%tstr p=term q=hoon r=hoon]`: define a macro.
426+`[%tstr p=term q=hoon r=hoon]`: define a deferred expression.
427427
428428##### Produces
429429
430−`r`, compiled with a subject in which `p` is a macro for `q`.
430+`r`, compiled with a subject in which `p` is a deferred expression for `q`.
431431
432432##### Syntax
433433
@@ -435,7 +435,13 @@ Regular: **3-fixed**.
435435
436436##### Discussion
437437
438−The difference between macroing and pinning is that pinning changes the subject, but for macroing the subject noun stays the same. The macro'd expression, `q`, is recorded in the type information of `p`. `q` is calculated every time you use the `p` macro.
438+`=*` assigns a name to an expression that will be evaluated in each place the
439+name is dereferenced. This allows you to "write" through it to the original
440+subject `axis`. `q` is recorded in the type information of `p`, and `q` is
441+calculated every time you use `p`.
442+
443+This rune has some similarities with macros, and some similarities with aliases,
444+but it is not really either.
439445
440446##### Examples
441447
content/docs/hoon/reference/stdlib/1a.md+403−284
@@ -4,7 +4,7 @@ weight = 1
44template = "doc.html"
55+++
66
7−### `++add`
7+## `++add`
88
99Add
1010
@@ -23,41 +23,54 @@ An [`atom`](/docs/glossary/atom).
2323#### Source
2424
2525```hoon
26− ++ add
27− ~/ %add
28− |= [a=@ b=@]
29− ^- @
30− ?: =(0 a) b
31− $(a (dec a), b +(b))
26+++ add
27+ ~/ %add
28+ |= [a=@ b=@]
29+ ^- @
30+ ?: =(0 a) b
31+ $(a (dec a), b +(b))
3232```
3333
3434#### Examples
3535
3636```
37− > (add 2 2)
38− 4
37+> (add 2 2)
38+4
39+```
3940
40− > (add 1 1.000.000)
41− 1.000.001
41+```
42+> (add 1 1.000.000)
43+1.000.001
44+```
4245
43− > (add 1.333 (mul 2 2))
44− 1.337
46+```
47+> (add 1.333 (mul 2 2))
48+1.337
49+```
4550
46− > (add 'a' 4)
47− 101
51+```
52+> (add 'a' 4)
53+101
54+```
4855
49− > (add 'a' 'b')
50− 195
56+```
57+> (add 'a' 'b')
58+195
59+```
5160
52− > (add 0xc 0xf)
53− 27
61+```
62+> (add 0xc 0xf)
63+27
64+```
5465
55− > `@ux`(add 0xc 0xf)
56− 0x1b
66+```
67+> `@ux`(add 0xc 0xf)
68+0x1b
5769```
5870
5971---
60−### `++dec`
72+
73+## `++dec`
6174
6275Decrement
6376
@@ -74,41 +87,47 @@ An [`atom`](/docs/glossary/atom).
7487#### Source
7588
7689```hoon
77− ++ dec
78− ~/ %dec
79− |= a=@
80− ~| %decrement-underflow
81− ?< =(0 a)
82− =+ b=0
83− |- ^- @
84− ?: =(a +(b)) b
85− $(b +(b))
90+++ dec
91+ ~/ %dec
92+ |= a=@
93+ ~_ leaf+"decrement-underflow"
94+ ?< =(0 a)
95+ =+ b=0
96+ |- ^- @
97+ ?: =(a +(b)) b
98+ $(b +(b))
8699```
87100
88101#### Examples
89102
90103```
91− > (dec 7)
92− 6
93−
94− > (dec 0)
95− ! decrement-underflow
96− ! exit
104+> (dec 7)
105+6
106+```
97107
98− > (dec 'b')
99− 97
100− > `@t`(dec 'b')
101− 'a'
108+```
109+> (dec 0)
110+! decrement-underflow
111+! exit
112+```
102113
103− > (dec 0xc)
104− 11
105− > `@ux`(dec 0xc)
106− 0xb
114+```
115+> (dec 'b')
116+97
117+> `@t`(dec 'b')
118+'a'
107119```
108120
121+```
122+> (dec 0xc)
123+11
124+> `@ux`(dec 0xc)
125+0xb
126+```
109127
110128---
111−### `++div`
129+
130+## `++div`
112131
113132Divide
114133
@@ -127,43 +146,52 @@ An [`atom`](/docs/glossary/atom).
127146#### Source
128147
129148```hoon
130− ++ div
131− ~/ %div
132− |: [a=`@`1 b=`@`1]
133− ^- @
134− ~_ leaf+"divide-by-zero"
135− ?< =(0 b)
136− =+ c=0
137− |-
138− ?: (lth a b) c
139− $(a (sub a b), c +(c))
149+++ div
150+ ~/ %div
151+ |: [a=`@`1 b=`@`1]
152+ ^- @
153+ ~_ leaf+"divide-by-zero"
154+ ?< =(0 b)
155+ =+ c=0
156+ |-
157+ ?: (lth a b) c
158+ $(a (sub a b), c +(c))
140159```
141160
142161#### Examples
143162
144163```
145− > (div 4 2)
146− 2
164+> (div 4 2)
165+2
166+```
147167
148− > (div 17 8)
149− 2
168+```
169+> (div 17 8)
170+2
171+```
150172
151− > (div 20 30)
152− 0
173+```
174+> (div 20 30)
175+0
176+```
153177
154− > (div 'ab' 'a')
155− 259
156− > `@`'ab'
157− 25.185
158− > `@`a
159− 97
178+```
179+> (div 'ab' 'a')
180+259
181+> `@`'ab'
182+25.185
183+> `@`a
184+97
185+```
160186
161− > (div 0x9f 0x29)
162− 6
187+```
188+> (div 0x9f 0x29)
189+6
163190```
164191
165192---
166−### `++dvr`
193+
194+## `++dvr`
167195
168196Divide with remainder
169197
@@ -182,38 +210,47 @@ A cell of [`atoms`](/docs/glossary/atom).
182210#### Source
183211
184212```hoon
185− ++ dvr
186− ~/ %dvr
187− |= [a=@ b=@]
188− ^- [p=@ q=@]
189− [(div a b) (mod a b)]
213+++ dvr
214+ ~/ %dvr
215+ |= [a=@ b=@]
216+ ^- [p=@ q=@]
217+ [(div a b) (mod a b)]
190218```
191219
192220#### Examples
193221
194222```
195− > (dvr 17 8)
196− [p=2 q=1]
223+> (dvr 17 8)
224+[p=2 q=1]
225+```
197226
198− > (dvr 17 6)
199− [p=2 q=5]
227+```
228+> (dvr 17 6)
229+[p=2 q=5]
230+```
200231
201− > (dvr 18 6)
202− [p=3 q=0]
232+```
233+> (dvr 18 6)
234+[p=3 q=0]
235+```
203236
204− > (dvr 4 2)
205− [p=2 q=0]
237+```
238+> (dvr 4 2)
239+[p=2 q=0]
240+```
206241
207− > (dvr 'ab 'a')
208− [p=259 q=62]
209− > `@`'a'
210− 97
211− > `@`'ab'
212− 25.185
242+```
243+> (dvr 'ab 'a')
244+[p=259 q=62]
245+> `@`'a'
246+97
247+> `@`'ab'
248+25.185
213249```
214250
215251---
216−### `++gte`
252+
253+## `++gte`
217254
218255Greater-than/equal
219256
@@ -232,28 +269,33 @@ A flag.
232269#### Source
233270
234271```hoon
235− ++ gte
236− ~/ %gte
237− |= [a=@ b=@]
238− ^- ?
239− !(lth a b)
272+++ gte
273+ ~/ %gte
274+ |= [a=@ b=@]
275+ ^- ?
276+ !(lth a b)
240277```
241278
242279#### Examples
243280
244281```
245− > (gte 100 10)
246− %.y
282+> (gte 100 10)
283+%.y
284+```
247285
248− > (gte 4 4)
249− %.y
286+```
287+> (gte 4 4)
288+%.y
289+```
250290
251− > (gte 3 4)
252− %.n
291+```
292+> (gte 3 4)
293+%.n
253294```
254295
255296---
256−### `++gth`
297+
298+## `++gth`
257299
258300Greater-than
259301
@@ -272,29 +314,33 @@ A flag.
272314#### Source
273315
274316```hoon
275− ++ gth
276− ~/ %gth
277− |= [a=@ b=@]
278− ^- ?
279− !(lte a b)
317+++ gth
318+ ~/ %gth
319+ |= [a=@ b=@]
320+ ^- ?
321+ !(lte a b)
280322```
281323
282−
283324#### Examples
284325
285326```
286− > (gth 'd' 'c')
287− %.y
327+> (gth 'd' 'c')
328+%.y
329+```
288330
289− > (gth ~h1 ~m61)
290− %.n
331+```
332+> (gth ~h1 ~m61)
333+%.n
334+```
291335
292− > (gth 'steak' 'brisket')
293− %.n
336+```
337+> (gth 'steak' 'brisket')
338+%.n
294339```
295340
296341---
297−### `++lte`
342+
343+## `++lte`
298344
299345Less-than/equal
300346
@@ -313,45 +359,56 @@ A flag.
313359#### Source
314360
315361```hoon
316− ++ lte
317− ~/ %lte
318− |= [a=@ b=@]
319− |(=(a b) (lth a b))
362+++ lte
363+ ~/ %lte
364+ |= [a=@ b=@]
365+ |(=(a b) (lth a b))
320366```
321367
322368#### Examples
323369
324370```
325− > (lte 4 5)
326− %.y
327−
328− > (lte 5 4)
329− %.n
330−
331− > (lte 5 5)
332− %.y
371+> (lte 4 5)
372+%.y
373+```
333374
334− > (lte 0 0)
335− %.y
375+```
376+> (lte 5 4)
377+%.n
378+```
336379
380+```
381+> (lte 5 5)
382+%.y
383+```
337384
338− > (lte 'a' 'b')
339− %.y
340− > `@`'a'
341− 97
342− > `@`'b'
343− 98
385+```
386+> (lte 0 0)
387+%.y
388+```
344389
345− > (lte 'abraham' 'bob')
346− %.n
390+```
391+> (lte 'a' 'b')
392+%.y
393+> `@`'a'
394+97
395+> `@`'b'
396+98
397+```
347398
348− > (lte ~m61 ~h1)
349− %.n
399+```
400+> (lte 'abraham' 'bob')
401+%.n
350402```
351403
404+```
405+> (lte ~m61 ~h1)
406+%.n
407+```
352408
353409---
354−### `++lth`
410+
411+## `++lth`
355412
356413Less-than
357414
@@ -370,46 +427,57 @@ A flag.
370427#### Source
371428
372429```hoon
373− ++ lth
374− ~/ %lth
375− |= [a=@ b=@]
376− ^- ?
377− ?& !=(a b)
378− |-
379− ?| =(0 a)
380− ?& !=(0 b)
381− $(a (dec a), b (dec b))
382− == == ==
430+++ lth
431+ ~/ %lth
432+ |= [a=@ b=@]
433+ ^- ?
434+ ?& !=(a b)
435+ |-
436+ ?| =(0 a)
437+ ?& !=(0 b)
438+ $(a (dec a), b (dec b))
439+ == == ==
383440```
384441
385442#### Examples
386443
387444```
388− > (lth 4 5)
389− %.y
445+> (lth 4 5)
446+%.y
447+```
390448
391− > (lth 5 4)
392− %.n
449+```
450+> (lth 5 4)
451+%.n
452+```
393453
394− > (lth 5 5)
395− %.n
454+```
455+> (lth 5 5)
456+%.n
457+```
396458
397− > (lth 5 0)
398− %.n
459+```
460+> (lth 5 0)
461+%.n
462+```
399463
400− > (lth 'a' 'b')
401− %.y
402− > `@`'a'
403− 97
404− > `@`'b'
405− 98
464+```
465+> (lth 'a' 'b')
466+%.y
467+> `@`'a'
468+97
469+> `@`'b'
470+98
471+```
406472
407− > (lth 'abraham' 'bob')
408− %.n
473+```
474+> (lth 'abraham' 'bob')
475+%.n
409476```
410477
411478---
412−### `++max`
479+
480+## `++max`
413481
414482Maximum
415483
@@ -428,44 +496,59 @@ An [`atom`](/docs/glossary/atom).
428496#### Source
429497
430498```hoon
431− ++ max
432− ~/ %max
433− |= [a=@ b=@]
434− ^- @
435− ?: (gth a b) a
436− b
499+++ max
500+ ~/ %max
501+ |= [a=@ b=@]
502+ ^- @
503+ ?: (gth a b) a
504+ b
437505```
438506
439507#### Examples
440508
441509```
442− > (max 10 100)
443− 100
510+> (max 10 100)
511+100
512+```
444513
445− > (max 10.443 9)
446− 10.443
514+```
515+> (max 10.443 9)
516+10.443
517+```
447518
448− > (max 1 1)
449− 1
519+```
520+> (max 1 1)
521+1
522+```
450523
451− > (max 'abraham' 'bob')
452− 30.787.873.400.840.801
524+```
525+> (max 'abraham' 'bob')
526+30.787.873.400.840.801
527+```
453528
454− > `@t`(max 'abraham' 'bob')
455− 'abraham'
529+```
530+> `@t`(max 'abraham' 'bob')
531+'abraham'
532+```
456533
457− > `@t`(max 'abraham' 'benjamin')
458− 'benjamin'
534+```
535+> `@t`(max 'abraham' 'benjamin')
536+'benjamin'
537+```
459538
460− > `@dr`(max ~m6 ~h1)
461− ~h1
539+```
540+> `@dr`(max ~m6 ~h1)
541+~h1
542+```
462543
463− >`@ux`(max 0xe1 0x1e)
464− 0xe1
544+```
545+>`@ux`(max 0xe1 0x1e)
546+0xe1
465547```
466548
467549---
468−### `++min`
550+
551+## `++min`
469552
470553Minimum
471554
@@ -484,42 +567,54 @@ An [`atom`](/docs/glossary/atom).
484567#### Source
485568
486569```hoon
487− ++ min
488− ~/ %min
489− |= [a=@ b=@]
490− ^- @
491− ?: (lth a b) a
492− b
570+++ min
571+ ~/ %min
572+ |= [a=@ b=@]
573+ ^- @
574+ ?: (lth a b) a
575+ b
493576```
494577
495578#### Examples
496579
497580```
498− > (min 10 100)
499− 10
500−
501− > (min 10.443 9)
502− 9
581+> (min 10 100)
582+10
583+```
503584
504− > (min 1 1)
505− 1
585+```
586+> (min 10.443 9)
587+9
588+```
506589
507− > (min 'abraham' 'bob')
508− 6.451.042
590+```
591+> (min 1 1)
592+1
593+```
509594
510− > `@t`(min 'abraham' 'bob')
511− 'bob'
595+```
596+> (min 'abraham' 'bob')
597+6.451.042
598+```
512599
513− > `@t`(min 'abraham' 'benjamin')
514− 'abraham'
600+```
601+> `@t`(min 'abraham' 'bob')
602+'bob'
603+```
515604
516− > `@dr`(min ~m6 ~h1)
517− ~m6
605+```
606+> `@t`(min 'abraham' 'benjamin')
607+'abraham'
518608```
519609
610+```
611+> `@dr`(min ~m6 ~h1)
612+~m6
613+```
520614
521615---
522−### `++mod`
616+
617+## `++mod`
523618
524619Modulus
525620
@@ -538,39 +633,48 @@ An [`atom`](/docs/glossary/atom).
538633#### Source
539634
540635```hoon
541− ++ mod
542− ~/ %mod
543− |: [a=`@`1 b=`@`1]
544− ^- @
545− ?< =(0 b)
546− (sub a (mul b (div a b)))
636+++ mod
637+ ~/ %mod
638+ |: [a=`@`1 b=`@`1]
639+ ^- @
640+ ?< =(0 b)
641+ (sub a (mul b (div a b)))
547642```
548643
549644#### Examples
550645
551646```
552− > (mod 5 2)
553− 1
647+> (mod 5 2)
648+1
649+```
554650
555− > (mod 5 5)
556− 0
651+```
652+> (mod 5 5)
653+0
654+```
557655
558− > (mod 2 5)
559− 2
656+```
657+> (mod 2 5)
658+2
659+```
560660
561− > (mod 40 20)
562− 0
661+```
662+> (mod 40 20)
663+0
664+```
563665
564− > `@`'c'
565− 99
566− >`@`'a'
567− 97
568− > (mod 'c' 'a')
569− 2
666+```
667+> `@`'c'
668+99
669+>`@`'a'
670+97
671+> (mod 'c' 'a')
672+2
570673```
571674
572675---
573−### `++mul`
676+
677+## `++mul`
574678
575679Multiply
576680
@@ -589,39 +693,45 @@ An [`atom`](/docs/glossary/atom).
589693#### Source
590694
591695```hoon
592− ++ mul
593− ~/ %mul
594− |: [a=`@`1 b=`@`1]
595− ^- @
596− =+ c=0
597− |-
598− ?: =(0 a) c
599− $(a (dec a), c (add b c))
696+++ mul
697+ ~/ %mul
698+ |: [a=`@`1 b=`@`1]
699+ ^- @
700+ =+ c=0
701+ |-
702+ ?: =(0 a) c
703+ $(a (dec a), c (add b c))
600704```
601705
602706#### Examples
603707
604708```
605− > (mul 3 4)
606− 12
607−
608− > (mul 0 1)
609− 0
709+> (mul 3 4)
710+12
711+```
610712
611− > `@`'a'
612− 97
613− > `@`'b'
614− 98
615− > (mul 'a' 'b')
616− 9.506
713+```
714+> (mul 0 1)
715+0
716+```
617717
618− >`@ux`(mul 0x1f 0xe)
619− 0x1b2
718+```
719+> `@`'a'
720+97
721+> `@`'b'
722+98
723+> (mul 'a' 'b')
724+9.506
620725```
621726
727+```
728+>`@ux`(mul 0x1f 0xe)
729+0x1b2
730+```
622731
623732---
624−### `++sub`
733+
734+## `++sub`
625735
626736Subtract
627737
@@ -640,41 +750,50 @@ An [`atom`](/docs/glossary/atom).
640750#### Source
641751
642752```hoon
643− ++ sub
644− ~/ %sub
645− |= [a=@ b=@]
646− ~_ leaf+"subtract-underflow"
647− ^- @
648− ?: =(0 b) a
649− $(a (dec a), b (dec b))
753+++ sub
754+ ~/ %sub
755+ |= [a=@ b=@]
756+ ~_ leaf+"subtract-underflow"
757+ ^- @
758+ ?: =(0 b) a
759+ $(a (dec a), b (dec b))
650760```
651761
652−
653762#### Examples
654763
655764```
656− > (sub 10 5)
657− 5
765+> (sub 10 5)
766+5
767+```
658768
659− > (sub 243 44)
660− 199
769+```
770+> (sub 243 44)
771+199
772+```
661773
662− > (sub 5 0)
663− 5
774+```
775+> (sub 5 0)
776+5
777+```
664778
665− > (sub 0 5)
666− ! subtract-underflow
667− ! exit
779+```
780+> (sub 0 5)
781+! subtract-underflow
782+! exit
783+```
668784
669− > (sub 'c' 'a')
670− 2
671− > `@`'c'
672− 99
673− > `@`'a'
674− 97
785+```
786+> (sub 'c' 'a')
787+2
788+> `@`'c'
789+99
790+> `@`'a'
791+97
792+```
675793
676− > (sub 0x1f 0xe)
677− 17
678− > `@ux`(sub 0x1f 0xe)
679− 0x11
680−```
794+```
795+> (sub 0x1f 0xe)
796+17
797+> `@ux`(sub 0x1f 0xe)
798+0x11
799+```
content/docs/hoon/reference/stdlib/1b.md+125−89
@@ -7,7 +7,7 @@ template = "doc.html"
77Check out the Nock [explanation](/docs/nock/) for more
88information on the tree-addressing system.
99
10−### `++cap`
10+## `++cap`
1111
1212Tree head
1313
@@ -15,7 +15,6 @@ Tests whether the tree address `a` is in the head or the tail of a [`noun`](/doc
1515Produces the constant [`atom`](/docs/glossary/atom) `%2` if it is within the head (subtree `+2`), or
1616the constant [`atom`](/docs/glossary/atom) `%3` if it is within the tail (subtree `+3`).
1717
18−
1918#### Accepts
2019
2120`a` is an [`atom`](/docs/glossary/atom).
@@ -27,46 +26,57 @@ A constant [`atom`](/docs/glossary/atom).
2726#### Source
2827
2928```hoon
30− ++ cap
31− ~/ %cap
32− |= a=@
33− ^- ?($2 $3)
34− ?- a
35− $2 %2
36− $3 %3
37− ?(%0 %1) !!
38− * $(a (div a 2))
39− ==
29+++ cap
30+ ~/ %cap
31+ |= a=@
32+ ^- ?(%2 %3)
33+ ?- a
34+ %2 %2
35+ %3 %3
36+ ?(%0 %1) !!
37+ * $(a (div a 2))
38+ ==
4039```
4140
4241#### Examples
4342
4443```
45− > (cap 4)
46− %2
44+> (cap 4)
45+%2
46+```
4747
48− > (cap 6)
49− %3
48+```
49+> (cap 6)
50+%3
51+```
5052
51− > (cap (add 10 9))
52− %2
53+```
54+> (cap (add 10 9))
55+%2
56+```
5357
54− > (cap 1) ::address '1' is in neither the head nor the tail
55− ! exit
58+```
59+> (cap 1) ::address '1' is in neither the head nor the tail
60+! exit
61+```
5662
57− > (cap 0x40))
58− %2
59− > `@`0x40
60− 64
63+```
64+> (cap 0x40))
65+%2
66+> `@`0x40
67+64
68+```
6169
62− > (cap 'a')
63− %3
64− > `@`'a'
65− 97
70+```
71+> (cap 'a')
72+%3
73+> `@`'a'
74+97
6675```
6776
6877---
69−### `++mas`
78+
79+## `++mas`
7080
7181Address within head/tail
7282
@@ -84,51 +94,66 @@ An [`atom`](/docs/glossary/atom).
8494#### Source
8595
8696```hoon
87− ++ mas
88− ~/ %mas
89− |= a=@
90− ^- @
91− ?- a
92− 1 !!
93− 2 1
94− 3 1
95− * (add (mod a 2) (mul $(a (div a 2)) 2))
96− ==
97+++ mas
98+ ~/ %mas
99+ |= a=@
100+ ^- @
101+ ?- a
102+ ?(%2 %3) 1
103+ ?(%0 %1) !!
104+ * (add (mod a 2) (mul $(a (div a 2)) 2))
105+ ==
97106```
98107
99108#### Examples
100109
101110```
102− > (mas 3)
103− 1
111+> (mas 3)
112+1
113+```
104114
105− > (mas 4)
106− 2
115+```
116+> (mas 4)
117+2
118+```
107119
108− > (mas 5)
109− 3
110− > (cap 5) ::`(cap a)` computes whether address `a` is in the head or the tail
111− %2
120+```
121+> (mas 5)
122+3
123+> (cap 5) ::`(cap a)` computes whether address `a` is in the head or the tail
124+%2
125+```
112126
113− > (mas 7)
114− 3
115− > (cap 7)
116− %3
127+```
128+> (mas 7)
129+3
130+> (cap 7)
131+%3
132+```
117133
118− > (mas 11)
119− 7
134+```
135+> (mas 11)
136+7
137+```
120138
121− > (mas (mas 11))
122− 3
139+```
140+> (mas (mas 11))
141+3
142+```
123143
124− > (cap (mas 6))
125− %3
144+```
145+> (cap (mas 6))
146+%3
147+```
126148
127− > (mas 0)
128− ! exit ::address `0` is in neither the head nor the tail
149+```
150+> (mas 0) ::address `0` is in neither the head nor the tail
151+! exit
152+```
129153
130− > (mas 1)
131− ! exit ::address `1` is in neither the head nor the tail
154+```
155+> (mas 1) ::address `1` is in neither the head nor the tail
156+! exit
132157```
133158
134159#### Discussion
@@ -166,7 +191,8 @@ Notice how the old values in the head (subtree `+2`) were not illustrated in
166191this case, because `+7` is within the tail (subtree `+3`).
167192
168193---
169−### `++peg`
194+
195+## `++peg`
170196
171197Address within address
172198
@@ -186,43 +212,54 @@ An [`atom`](/docs/glossary/atom).
186212#### Source
187213
188214```hoon
189− ++ peg
190− ~/ %peg
191− |= [a=@ b=@]
192− ?< =(0 a)
193− ^- @
194− ?- b
195− $1 a
196− $2 (mul a 2)
197− $3 +((mul a 2))
198− * (add (mod b 2) (mul $(b (div b 2)) 2))
199− ==
215+++ peg
216+ ~/ %peg
217+ |= [a=@ b=@]
218+ ?< =(0 a)
219+ ^- @
220+ ?- b
221+ %1 a
222+ %2 (mul a 2)
223+ %3 +((mul a 2))
224+ * (add (mod b 2) (mul $(b (div b 2)) 2))
225+ ==
200226```
201227
202228#### Examples
203229
204230```
205− > (peg 4 1)
206− 4
207−
208− > (peg 1 4)
209− 4
231+> (peg 4 1)
232+4
233+```
210234
211− > (peg 4 2)
212− 8
235+```
236+> (peg 1 4)
237+4
238+```
213239
214− > (peg 4 8)
215− 32
240+```
241+> (peg 4 2)
242+8
243+```
216244
217− > (peg 4 (4 2))
218− 32
245+```
246+> (peg 4 8)
247+32
248+```
219249
220− > (peg 8 45)
221− 269
250+```
251+> (peg 4 (4 2))
252+32
253+```
222254
223− > (cap (peg 4 2)) ::`(cap a)` computes whether address `a` is in the head or the tail
224− %2
255+```
256+> (peg 8 45)
257+269
258+```
225259
260+```
261+> (cap (peg 4 2)) ::`(cap a)` computes whether address `a` is in the head or the tail
262+%2
226263```
227264
228265#### Discussion
@@ -269,5 +306,4 @@ Notice how relative address `+4` is at the same position as absolute address
269306 (continues...)
270307```
271308
272−
273309---
content/docs/hoon/reference/stdlib/1c.md+201−122
@@ -4,7 +4,7 @@ weight = 3
44template = "doc.html"
55+++
66
7−### `$bite`
7+## `+$bite`
88
99Atom slice specifier.
1010
@@ -42,7 +42,7 @@ supplied, it defaults to a value of 1.
4242 0
4343```
4444
45−### `$bloq`
45+## `+$bloq`
4646
4747Blocksize
4848
@@ -105,33 +105,40 @@ See the [bit arithmetic](/docs/hoon/reference/stdlib/2c) section for operations
105105
106106---
107107
108−### `++each`
108+## `++each`
109109
110110Mold of fork between two types
111111
112112A mold generator. Produces a discriminated fork between two types, defaulting to
113−`a`.
113+`this`.
114114
115115#### Source
116116
117− ++ each
118− |*([a=mold b=mold] $%([$| p=b] [$& p=a]))
119−
117+```hoon
118+++ each
119+ |$ [this that]
120+ $% [%| p=that]
121+ [%& p=this]
122+ ==
123+```
120124
121125#### Examples
122126
123127```
124− > ? *(each cord time)
125− ?({$.y p/@t} {$.n p/@da})
126− [%.y p='']
128+> ? *(each cord time)
129+ ?([%.y p=@t] [%.n p=@da])
130+[%.y p='']
131+```
127132
128− > ? *(each * tape)
129− ?({$.y p/*} {$.n p/""})
130− [%.y p=0]
133+```
134+> ? *(each * tape)
135+ ?([%.y p=*] [%.n p=""])
136+[%.y p=0]
131137```
132138
133139---
134−### `++gate`
140+
141+## `++gate`
135142
136143Function
137144
@@ -139,7 +146,6 @@ A [`core`](/docs/glossary/core) with one arm, `$`--the empty name--which transfo
139146product noun. If used dryly as a type, the subject must have a sample type of
140147`*`.
141148
142−
143149#### Source
144150
145151```hoon
@@ -150,16 +156,23 @@ product noun. If used dryly as a type, the subject must have a sample type of
150156#### Examples
151157
152158```
153− > ? gate
154− <1.rdl {* <31.ohr 1.jmk $143>}>
155− <1.rdl {* <31.ohr 1.jmk $143>}>
159+> ? gate
160+ <1.ddq [* <46.hgz 1.pnw %140>]>
161+<1.ddq [* <46.hgz 1.pnw %140>]>
162+```
156163
157− > (`gate`|=(a=* [a 'b']) 1)
158− [1 98]
164+```
165+> (`gate`|=(a=* [a 'b']) 1)
166+[1 98]
167+```
159168
160− > (`gate`|=(a=@ [a 'b']) 1)
161− ! nest-fail
162− ! exit
169+```
170+> (`gate`|=(a=@ [a 'b']) 1)
171+mint-nice
172+-need.@
173+-have.*
174+nest-fail
175+dojo: hoon expression failed
163176```
164177
165178#### Discussion
@@ -171,43 +184,51 @@ mathematical sense. Any `gate` normalizes to an iron `gate`.
171184See also: [`++lift`](/docs/hoon/reference/stdlib/2a#lift), [`++cork`](/docs/hoon/reference/stdlib/2n#cork)
172185
173186---
174−### `++list`
187+
188+## `++list`
175189
176190List
177191
178192A mold generator. Generates a mold of a null-terminated list of a
179193homogenous type.
180194
181−
182195#### Source
183196
184197```hoon
185− ++ list
186− |*(a=mold $@($~ (lest a)))
198+++ list
199+ |$ [item]
200+ $@(~ [i=item t=(list item)])
187201```
188202
189203#### Examples
190204
191205```
192− > *(list)
193− ~
194−
195− > `(list @)`"abc"
196− ~[97 98 99]
206+> *(list)
207+~
208+```
197209
198− > (snag 0 "abc")
199− 'a'
210+```
211+> `(list @)`"abc"
212+~[97 98 99]
213+```
200214
201− > `(list @)`[1 2 'j' ~]
202− ~[1 2 106]
215+```
216+> (snag 0 "abc")
217+'a'
218+```
203219
204220```
221+> `(list @)`[1 2 'j' ~]
222+~[1 2 106]
223+```
224+
205225#### Discussion
206226
207227See also: [`++turn`](/docs/hoon/reference/stdlib/2b#turn), [`++snag`](/docs/hoon/reference/stdlib/2b#snag)
208228
209229---
210−### `++lone`
230+
231+## `++lone`
211232
212233Face on mold
213234
@@ -216,56 +237,68 @@ A mold generator. Puts face of `p` on the passed-in mold.
216237#### Source
217238
218239```hoon
219− ++ lone
220− |*(a=mold [p=a])
240+++ lone
241+ |$ [item]
242+ p=item
221243```
222244
223245#### Examples
224246
225247```
226− > ? *cord
227− @t
228− ''
229− > ? *(lone cord)
230− p/@t
231− p=''
248+> ? *cord
249+@t
250+''
251+```
252+
253+```
254+> ? *(lone cord)
255+ p=@t
256+p=''
257+```
258+
259+```
260+> ? *(lone @)
261+ p=@
262+p=0
263+```
232264
233− > ? *(lone @)
234− p/@
235− p=0
236− > ? *@
237− @
238− 0
265+```
266+> ? *@
267+ @
268+0
239269```
240270
241271---
242−### `++pair`
272+
273+## `++pair`
243274
244275Mold of pair of types
245276
246277A mold generator. Produces a tuple of two of the types passed in.
247278
248−
249279#### Source
250280
251281```hoon
252− ++ pair
253− |*([a=mold b=mold] [p=a q=b])
282+++ pair
283+ |$ [head tail]
284+ [p=head q=tail]
254285```
255286
256287#### Examples
257288
258289```
259− > *(pair ? cord)
260− [p=%.y q='']
261−
262− > *(pair tape @)
263− [p="" q=0]
290+> *(pair ? cord)
291+[p=%.y q='']
292+```
264293
294+```
295+> *(pair tape @)
296+[p="" q=0]
265297```
266298
267299---
268−### `++pole`
300+
301+## `++pole`
269302
270303Faceless [`list`](/docs/hoon/reference/stdlib/1c#list)
271304
@@ -274,24 +307,26 @@ A mold generator. A [`list`](/docs/hoon/reference/stdlib/1c#list) without the fa
274307#### Source
275308
276309```hoon
277− ++ pole
278− |*(a=mold $@($~ [a (pole a)]))
310+++ pole
311+ |$ [item]
312+ $@(~ [item (pole item)])
279313```
280314
281−
282315#### Examples
283316
284317```
285− > =/(a "asdf" ?>(?=(^ a) `(lest @tD)`a))
286− [i='a' t=[i='s' t=[i='d' t=[i='f' t=~]]]]
287−
288− > `(pole char)`"asdf"
289− ['a' ['s' ['d' ['f' ~]]]]
318+> =/(a "asdf" ?>(?=(^ a) `(lest @tD)`a))
319+[i='a' t=[i='s' t=[i='d' t=[i='f' t=~]]]]
290320```
291321
322+```
323+> `(pole char)`"asdf"
324+['a' ['s' ['d' ['f' ~]]]]
325+```
292326
293327---
294−### `++qual`
328+
329+## `++qual`
295330
296331Mold of 4-type tuple
297332
@@ -300,43 +335,49 @@ A mold generator. Produces a tuple of four of the types passed in.
300335#### Source
301336
302337```hoon
303− ++ qual
304− |* [a=mold b=mold c=mold d=mold]
305− [p=a q=b r=c s=d]
338+++ qual
339+ |$ [first second third fourth]
340+ [p=first q=second r=third s=fourth]
306341```
307342
308343#### Examples
309344
310345```
311− > *(qual date time tape cord)
312− [p=[[a=%.y y=0] m=0 t=[d=0 h=0 m=0 s=0 f=~]] q=~292277024401-.1.1 r="" s='']
346+> *(qual date time tape cord)
347+[p=[[a=%.y y=0] m=0 t=[d=0 h=0 m=0 s=0 f=~]] q=~2000.1.1 r="" s='']
348+```
313349
314− > *(qual (list @) @u @ud @ux)
315− [p=~ q=0 r=0 s=0x0]
350+```
351+> *(qual (list @) @u @ud @ux)
352+[p=~ q=0 r=0 s=0x0]
316353```
317354
318355---
319−### `++quip`
356+
357+## `++quip`
320358
321359Mold of pair of [`list`](/docs/hoon/reference/stdlib/1c#list) and type
322360
323−A mold generator. Produces a tuple of a [`list`](/docs/hoon/reference/stdlib/1c#list) of `a` and the mold of `b`.
361+A mold generator. Produces a tuple of a [`list`](/docs/hoon/reference/stdlib/1c#list) of `item` and the mold of `state`.
324362
325363#### Source
326364
327365```hoon
328− ++ quip
329− |*([a=mold b=mold] [(list a) b])
366+++ quip
367+ |$ [item state]
368+ [(list item) state]
330369```
331370
332371#### Examples
333372
334373```
335− > *(quip @ _'hi')
336− [~ 'hi']
374+> *(quip @ _'hi')
375+[~ 'hi']
376+```
337377
338− > `(quip @ @ux)`[[1 2 3 4 ~] 0x10]
339− [~[1 2 3 4] 0x10]
378+```
379+> `(quip @ @ux)`[[1 2 3 4 ~] 0x10]
380+[~[1 2 3 4] 0x10]
340381```
341382
342383#### Discussion
@@ -345,7 +386,33 @@ A common pattern in Hoon code is to return a `list` of changes, along with a
345386new state. You'll often see `quip` used in Gall apps.
346387
347388---
348−### `++trap`
389+
390+## `++step`
391+
392+Atom size or offset, in [bloq](#bloq)s.
393+
394+#### Source
395+
396+```
397+++ step
398+ _`@u`1
399+```
400+
401+#### Examples
402+
403+```
404+> `step`0
405+0
406+```
407+
408+```
409+> `step`2
410+2
411+```
412+
413+---
414+
415+## `++trap`
349416
350417[`Core`](/docs/glossary/core) with one arm `$`
351418
@@ -354,26 +421,31 @@ A trap is a [`core`](/docs/glossary/core) with one arm `$`.
354421#### Source
355422
356423```hoon
357− ++ trap
358− |*(a=mold _|?(*a))
424+++ trap
425+ |$ [product]
426+ _|?($:product)
359427```
360428
361429#### Examples
362430
363431```
364− > (*trap)
365− <1?dxy 1.oeg {a/<1|rbb {* <31.ohr 1.jmk $143>}> <31.ohr 1.jmk $143>}>
366−
367− > *(*trap)
368− 0
432+> (*trap)
433+<1?ruo 1.mhl [product=<1|xpg [* * *]> <46.hgz 1.pnw %140>]>
434+```
369435
370− > (|.(42))
371− 42
436+```
437+> *(*trap)
438+0
372439```
373440
441+```
442+> (|.(42))
443+42
444+```
374445
375446---
376−### `++tree`
447+
448+## `++tree`
377449
378450Tree mold generator
379451
@@ -383,20 +455,21 @@ left/right sub `tree` of the same type. Pretty-printed with `{}`.
383455#### Source
384456
385457```hoon
386− ++ tree
387− |*(a=mold $@($~ [n=a l=(tree a) r=(tree a)]))
458+++ tree
459+ |$ [node]
460+ $@(~ [n=node l=(tree node) r=(tree node)])
388461```
389462
390463#### Examples
391464
392465```
393− > `(tree [@ tape])`[[1 "hi"] [[2 "bye"] ~ ~] ~]
394− {[2 "bye"] [1 "hi"]}
466+> `(tree [@ tape])`[[1 "hi"] [[2 "bye"] ~ ~] ~]
467+{[2 "bye"] [1 "hi"]}
395468```
396469
397−
398470---
399−### `++trel`
471+
472+## `++trel`
400473
401474Mold of three types
402475
@@ -405,49 +478,55 @@ A mold generator. A mold of the tuple of the three types passed in.
405478#### Source
406479
407480```hoon
408− ++ trel
409− |*([a=mold b=mold c=mold] [p=a q=b r=c])
481+++ trel
482+ |$ [first second third]
483+ [p=first q=second r=third]
410484```
411485
412486#### Examples
413487
414488```
415− > *(trel @ud @t @s)
416− [p=0 q='' r=--0]
489+> *(trel @ud @t @s)
490+[p=0 q='' r=--0]
491+```
417492
418− > *(trel cord bloq tape)
419− [p='' q=0 r=""]
493+```
494+> *(trel cord bloq tape)
495+[p='' q=0 r=""]
420496```
421497
422498---
423−### `++unit`
499+
500+## `++unit`
424501
425502Maybe
426503
427−A mold generator. A `unit` is either `~` or `[~ u=a]`, where `a` is the
504+A mold generator. A `unit` is either `~` or `[~ u=item]`, where `item` is the
428505type that was passed in.
429506
430−
431507#### Source
432508
433509```hoon
434− ++ unit
435− |*(a=mold $@($~ [$~ u=a]))
510+++ unit
511+ |$ [item]
512+ $@(~ [~ u=item])
436513```
437514
438515#### Examples
439516
440517```
441− > ? *(unit time)
442− ?({$~ u/@da} $~)
443− ~
518+> ? *(unit time)
519+ u(@da)
520+~
521+```
444522
445− > =a |= a=@
446− ^- (unit @)
447− ?~ a ~
448− [~ a]
449− > (a 2)
450− [~ u=2]
523+```
524+> =a |= a=@
525+ ^- (unit @)
526+ ?~ a ~
527+ [~ a]
528+> (a 2)
529+[~ 2]
451530```
452531
453532#### Discussion
content/docs/hoon/reference/stdlib/2a.md+298−131
@@ -4,7 +4,7 @@ weight = 4
44template = "doc.html"
55+++
66
7−### `++biff`
7+## `++biff`
88
99[`Unit`](/docs/hoon/reference/stdlib/1c#unit) as argument
1010
@@ -24,25 +24,27 @@ 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---
45−### `++bind`
46+
47+## `++bind`
4648
4749Non-unit function to [`unit`](/docs/hoon/reference/stdlib/1c#unit), producing [`unit`](/docs/hoon/reference/stdlib/1c#unit)
4850
@@ -63,27 +65,28 @@ 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---
86−### `++bond`
88+
89+## `++bond`
8790
8891Replace null
8992
@@ -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,14 +120,16 @@ 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---
127−### `++both`
131+
132+## `++both`
128133
129134Group [`unit`](/docs/hoon/reference/stdlib/1c#unit) values into pair
130135
@@ -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---
166−### `++clap`
167173
168−Apply function to two [`units`](/docs/hoon/reference/stdlib/1c#unit)
174+## `++clap`
175+
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,32 +195,82 @@ 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---
213−### `++drop`
272+
273+## `++drop`
214274
215275[`Unit`](/docs/hoon/reference/stdlib/1c#unit) to list
216276
@@ -227,27 +287,29 @@ 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---
250−### `++fall`
311+
312+## `++fall`
251313
252314Give [`unit`](/docs/hoon/reference/stdlib/1c#unit) a default value
253315
@@ -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---
284−### `++lift`
438+
439+## `++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,25 +457,27 @@ 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---
323−### `++mate`
479+
480+## `++mate`
324481
325482Choose
326483
@@ -343,36 +500,40 @@ 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---
375−### `++need`
535+
536+## `++need`
376537
377538Unwrap [`unit`](/docs/hoon/reference/stdlib/1c#unit)
378539
@@ -389,31 +550,36 @@ 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---
416−### `++some`
581+
582+## `++some`
417583
418584Wrap value in a [`unit`](/docs/hoon/reference/stdlib/1c#unit)
419585
@@ -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---
content/docs/hoon/reference/stdlib/2b.md+630−431
@@ -4,7 +4,53 @@ weight = 5
44template = "doc.html"
55+++
66
7−### `++fand`
7+## `++bake`
8+
9+**Note:** This function isn't specifically a list function but is included in section 2b of the standard library so is documented here for completeness.
10+
11+Convert wet gate `f` to a dry gate by specifying argument mold `a`.
12+
13+`+bake` is a wet gate that takes a wet gate and produces a dry gate.
14+
15+#### Accepts
16+
17+`f` is a `gate`.
18+
19+`a` is a `mold`.
20+
21+#### Produces
22+
23+A dry `gate` whose sample type is `a`.
24+
25+#### Source
26+
27+```hoon
28+++ bake
29+ |* [f=gate a=mold]
30+ |= arg=a
31+ (f arg)
32+```
33+
34+#### Examples
35+
36+```
37+> =wet-gate |*(a=* [a a])
38+> (wet-gate 42)
39+[42 42]
40+> (wet-gate ['foo' 'bar'])
41+[['foo' 'bar'] 'foo' 'bar']
42+> =dry-gate (bake wet-gate @ud)
43+> (dry-gate 42)
44+[42 42]
45+> (dry-gate ['foo' 'bar'])
46+-need.@ud
47+-have.[@t @t]
48+nest-fail
49+```
50+
51+---
52+
53+## `++fand`
854
955All indices in `list`
1056
@@ -24,42 +70,48 @@ A `list`.
2470#### Source
2571
2672```hoon
27− ++ fand
28− ~/ %fand
29− |= [nedl=(list) hstk=(list)]
30− =| i=@ud
31− =| fnd=(list @ud)
32− |- ^+ fnd
33− =+ [n=nedl h=hstk]
34− |-
35− ?: |(?=($~ n) ?=($~ h))
36− (flop fnd)
37− ?: =(i.n i.h)
38− ?~ t.n
39− ^$(i +(i), hstk +.hstk, fnd [i fnd])
40− $(n t.n, h t.h)
41− ^$(i +(i), hstk +.hstk)
73+++ fand
74+ ~/ %fand
75+ |= [nedl=(list) hstk=(list)]
76+ =| i=@ud
77+ =| fnd=(list @ud)
78+ |- ^+ fnd
79+ =+ [n=nedl h=hstk]
80+ |-
81+ ?: |(?=(~ n) ?=(~ h))
82+ (flop fnd)
83+ ?: =(i.n i.h)
84+ ?~ t.n
85+ ^$(i +(i), hstk +.hstk, fnd [i fnd])
86+ $(n t.n, h t.h)
87+ ^$(i +(i), hstk +.hstk)
4288```
4389
4490#### Examples
4591
4692```
47− > (fand ~[3] ~[1 2 3])
48− ~[2]
49−
50− > (fand ~[4] ~[1 2 3])
51− ~
93+> (fand ~[3] ~[1 2 3])
94+~[2]
95+```
5296
53− > (fand ~['a'] "cbabab")
54− ~[2 4]
97+```
98+> (fand ~[4] ~[1 2 3])
99+~
100+```
55101
56− > (fand "ba" "cbabab")
57− ~[1 3]
102+```
103+> (fand ~['a'] "cbabab")
104+~[2 4]
58105```
59106
107+```
108+> (fand "ba" "cbabab")
109+~[1 3]
110+```
60111
61112---
62−### `++find`
113+
114+## `++find`
63115
64116First index in `list`
65117
@@ -79,43 +131,52 @@ The `unit` of an atom.
79131#### Source
80132
81133```hoon
82− ++ find
83− ~/ %find
84− |= [nedl=(list) hstk=(list)]
85− =| i=@ud
86− |- ^- (unit @ud)
87− =+ [n=nedl h=hstk]
88− |-
89− ?: |(?=($~ n) ?=($~ h))
90− ~
91− ?: =(i.n i.h)
92− ?~ t.n
93− `i
94− $(n t.n, h t.h)
95− ^$(i +(i), hstk +.hstk)
134+++ find
135+ ~/ %find
136+ |= [nedl=(list) hstk=(list)]
137+ =| i=@ud
138+ |- ^- (unit @ud)
139+ =+ [n=nedl h=hstk]
140+ |-
141+ ?: |(?=(~ n) ?=(~ h))
142+ ~
143+ ?: =(i.n i.h)
144+ ?~ t.n
145+ `i
146+ $(n t.n, h t.h)
147+ ^$(i +(i), hstk +.hstk)
96148```
97149
98150#### Examples
99151
100152```
101− > (find [3]~ ~[1 2 3])
102− [~ u=2]
153+> (find [3]~ ~[1 2 3])
154+[~ u=2]
155+```
103156
104− > (find [4]~ ~[1 2 3])
105− ~
157+```
158+> (find [4]~ ~[1 2 3])
159+~
160+```
106161
107− > (find ['c']~ "cbabab")
108− [~ u=0]
162+```
163+> (find ['c']~ "cbabab")
164+[~ u=0]
165+```
109166
110− > (find "ab" "cbabab")
111− [~ u=1]
167+```
168+> (find "ab" "cbabab")
169+[~ u=1]
170+```
112171
113− > (find "bab" "cbabab")
114− [~ u=2]
172+```
173+> (find "bab" "cbabab")
174+[~ u=2]
115175```
116176
117177---
118−### `++flop`
178+
179+## `++flop`
119180
120181Reverse
121182
@@ -132,31 +193,33 @@ A `list`.
132193#### Source
133194
134195```hoon
135− ++ flop
136− ~/ %flop
137− |* a=(list)
138− => .(a (homo a))
139− ^+ a
140− =+ b=`_a`~
141− |-
142− ?~ a b
143− $(a t.a, b [i.a b])
196+++ flop
197+ ~/ %flop
198+ |* a=(list)
199+ => .(a (homo a))
200+ ^+ a
201+ =+ b=`_a`~
202+ |-
203+ ?~ a b
204+ $(a t.a, b [i.a b])
144205```
145206
146−
147207#### Examples
148208
149209```
150− > =a [1 2 3 ~]
151− > (flop a)
152− ~[3 2 1]
210+> =a [1 2 3 ~]
211+> (flop a)
212+~[3 2 1]
213+```
153214
154− > (flop (flop a))
155− ~[1 2 3]
215+```
216+> (flop (flop a))
217+~[1 2 3]
156218```
157219
158220---
159−### `++gulf`
221+
222+## `++gulf`
160223
161224List from range
162225
@@ -176,24 +239,28 @@ a `list`.
176239#### Source
177240
178241```hoon
179− ++ gulf
180− |= [a=@ b=@]
181− ^- (list @)
182− ?:(=(a +(b)) ~ [a $(a +(a))])
242+++ gulf
243+ |= [a=@ b=@]
244+ ?> (lte a b)
245+ |- ^- (list @)
246+ ?:(=(a +(b)) ~ [a $(a +(a))])
183247```
184248
185249#### Examples
186250
187251```
188− > (gulf 1 6)
189− ~[1 2 3 4 5 6]
252+> (gulf 1 6)
253+~[1 2 3 4 5 6]
254+```
190255
191− > `(list @t)`(gulf 99 106)
192− <|c d e f g h i j|>
256+```
257+> `(list @t)`(gulf 99 106)
258+<|c d e f g h i j|>
193259```
194260
195261---
196−### `++homo`
262+
263+## `++homo`
197264
198265Homogenize
199266
@@ -212,7 +279,7 @@ a `list`.
212279#### Source
213280
214281```hoon
215−++ homo :: homogenize
282+++ homo
216283 |* a=(list)
217284 ^+ =< $
218285 |@ ++ $ ?:(*? ~ [i=(snag 0 a) t=$])
@@ -223,23 +290,60 @@ a `list`.
223290#### Examples
224291
225292```
226− > lyst
227− [i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]]
293+> lyst
294+[i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]]
295+> (homo lyst)
296+~[1 97 2 98 [~ u=10]]
297+```
298+
299+```
300+> =a (limo [1 2 3 ~])
301+> a
302+[i=1 t=[i=2 t=[i=3 t=~]]]
303+> (homo a)
304+~[1 2 3]
305+```
306+
307+---
308+
309+## `++into`
310+
311+Insert item at index
228312
229− > (homo lyst)
230− ~[1 97 2 98 [~ u=10]]
313+Accepts a `list` `a`, an atom `b`, and a noun `c`, producing the list of `a` with the item `c` inserted at index `b`.
314+
315+#### Accepts
316+
317+`a` is a list.
318+
319+`b` is a atom.
231320
232− > =a (limo [1 2 3 ~])
233− > a
234− [i=1 t=[i=2 t=[i=3 t=~]]]
321+`c` is a noun.
235322
236− > (homo a)
237− ~[1 2 3]
323+#### Produces
324+
325+the list of `a` with the item `c` inserted at index `b`.
326+
327+#### Source
328+
329+```hoon
330+++ into
331+ ~/ %into
332+ |* [a=(list) b=@ c=*]
333+ ^+ a
334+ (weld (scag b a) [c (slag b a)])
335+```
336+
337+#### Examples
338+
339+```
340+> (into (limo ~[2 3 4]) 1 11)
341+~[2 11 3 4]
238342```
239343
240344---
241345
242−### `++join`
346+## `++join`
243347
244348Constructs a new `list`, placing `sep` between every element of `lit`.
245349
@@ -256,29 +360,32 @@ a `list`.
256360#### Source
257361
258362```hoon
259− ++ join
260− |* [sep=* lit=(list)]
261− =. sep `_?>(?=(^ lit) i.lit)`sep
262− ?~ lit ~
263− =| out=(list _?>(?=(^ lit) i.lit))
264− |- ^+ out
265− ?~ t.lit
266− (flop [i.lit out])
267− $(out [sep i.lit out], lit t.lit)
363+++ join
364+ |* [sep=* lit=(list)]
365+ =. sep `_?>(?=(^ lit) i.lit)`sep
366+ ?~ lit ~
367+ =| out=(list _?>(?=(^ lit) i.lit))
368+ |- ^+ out
369+ ?~ t.lit
370+ (flop [i.lit out])
371+ $(out [sep i.lit out], lit t.lit)
268372```
269373
270374#### Examples
271375
272376```
273− > (join ' ' "hoon")
274− "h o o n"
377+> (join ' ' "hoon")
378+"h o o n"
379+```
275380
276− > (join 0 `(list @)`~[1 2 3])
277− ~[1 0 2 0 3]
381+```
382+> (join 0 `(list @)`~[1 2 3])
383+~[1 0 2 0 3]
278384```
279385
280386---
281−### `++lent`
387+
388+## `++lent`
282389
283390List length
284391
@@ -295,29 +402,31 @@ an atom.
295402#### Source
296403
297404```hoon
298− ++ lent
299− ~/ %lent
300− |= a=(list)
301− ^- @
302− =+ b=0
303− |-
304− ?~ a b
305− $(a t.a, b +(b))
405+++ lent
406+ ~/ %lent
407+ |= a=(list)
408+ ^- @
409+ =+ b=0
410+ |-
411+ ?~ a b
412+ $(a t.a, b +(b))
306413```
307414
308415#### Examples
309416
310417```
311− > (lent [1 2 3 4 ~]))
312− 4
313−
314− > (lent [1 'a' 2 'b' (some 10) ~])
315− 5
418+> (lent [1 2 3 4 ~]))
419+4
316420```
317421
422+```
423+> (lent [1 'a' 2 'b' (some 10) ~])
424+5
425+```
318426
319427---
320−### `++levy`
428+
429+## `++levy`
321430
322431Logical "and" on list
323432
@@ -336,31 +445,32 @@ A boolean.
336445#### Source
337446
338447```hoon
339− ++ levy
340− ~/ %levy :: all of
341− |* [a=(list) b=$-(* ?)]
342− |- ^- ?
343− ?~ a &
344− ?. (b i.a) |
345− $(a t.a)
448+++ levy
449+ ~/ %levy
450+ |* [a=(list) b=$-(* ?)]
451+ |- ^- ?
452+ ?~ a &
453+ ?. (b i.a) |
454+ $(a t.a)
346455```
347456
348457#### Examples
349458
350459```
351− > =a |=(a=@ (lte a 1))
352− > (levy `(list @)`[0 1 2 1 ~] a)
353− %.n
354−
355− > =a |=(a=@ (lte a 3))
356− > (levy `(list @)`[0 1 2 1 ~] a)
357− %.y
460+> =a |=(a=@ (lte a 1))
461+> (levy `(list @)`[0 1 2 1 ~] a)
462+%.n
358463```
359464
465+```
466+> =a |=(a=@ (lte a 3))
467+> (levy `(list @)`[0 1 2 1 ~] a)
468+%.y
469+```
360470
361471---
362472
363−### `++lien`
473+## `++lien`
364474
365475Logical "or" on list
366476
@@ -376,30 +486,32 @@ every element of `++list` `a`.
376486#### Source
377487
378488```hoon
379− ++ lien
380− ~/ %lien
381− |* [a=(list) b=$-(* ?)]
382− |- ^- ?
383− ?~ a |
384− ?: (b i.a) &
385− $(a t.a)
489+++ lien
490+ ~/ %lien
491+ |* [a=(list) b=$-(* ?)]
492+ |- ^- ?
493+ ?~ a |
494+ ?: (b i.a) &
495+ $(a t.a)
386496```
387497
388498#### Examples
389499
390500```
391− > =a |=(a=@ (gte a 1))
392− > (lien `(list @)`[0 1 2 1 ~] a)
393− %.y
394−
395− > =a |=(a=@ (gte a 3))
396− > (lien `(list @)`[0 1 2 1 ~]) a)
397− %.n
501+> =a |=(a=@ (gte a 1))
502+> (lien `(list @)`[0 1 2 1 ~] a)
503+%.y
398504```
399505
506+```
507+> =a |=(a=@ (gte a 3))
508+> (lien `(list @)`[0 1 2 1 ~]) a)
509+%.n
510+```
400511
401512---
402−### `++limo`
513+
514+## `++limo`
403515
404516List Constructor
405517
@@ -416,7 +528,7 @@ A `++list`.
416528#### Source
417529
418530```hoon
419−++ limo :: listify
531+++ limo
420532 |* a=*
421533 ^+ =< $
422534 |@ ++ $ ?~(a ~ ?:(*? [i=-.a t=$] $(a +.a)))
@@ -427,18 +539,18 @@ A `++list`.
427539#### Examples
428540
429541```
430− > (limo [1 2 3 ~])
431− [i=1 t=[i=2 t=[i=3 t=~]]]
542+> (limo [1 2 3 ~])
543+[i=1 t=[i=2 t=[i=3 t=~]]]
432544```
433545
434−
435546---
436−### `++murn`
547+
548+## `++murn`
437549
438550Maybe transform
439551
440552Passes each member of `list` `a` to gate `b`, which must produce a
441−`unit`. Produces a new list with all the results that do not produce
553+`unit`. Produces a new list with all the results that do not produce
442554`~`.
443555
444556#### Accepts
@@ -454,28 +566,28 @@ A unit.
454566#### Source
455567
456568```hoon
457− ++ murn :: maybe transform
458− ~/ %murn
459− |* [a=(list) b=$-(* (unit))]
460− |-
461− ?~ a ~
462− =+ c=(b i.a)
463− ?~ c
464− $(a t.a)
465− [i=u.c t=$(a t.a)]
569+++ murn
570+ ~/ %murn
571+ |* [a=(list) b=$-(* (unit))]
572+ => .(a (homo a))
573+ |- ^- (list _?>(?=(^ a) (need (b i.a))))
574+ ?~ a ~
575+ =/ c (b i.a)
576+ ?~ c $(a t.a)
577+ [+.c $(a t.a)]
466578```
467579
468580#### Examples
469581
470582```
471− > =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
472− > (murn `(list @)`[0 1 2 3 ~] a)
473− [i=12 t=[i=13 t=~]]
583+> =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
584+> (murn `(list @)`[0 1 2 3 ~] a)
585+[i=12 t=[i=13 t=~]]
474586```
475587
476−
477588---
478−### `++oust`
589+
590+## `++oust`
479591
480592Remove
481593
@@ -493,25 +605,27 @@ A `++list`.
493605#### Source
494606
495607```hoon
496− ++ oust :: remove
497− ~/ %oust
498− |* [[a=@ b=@] c=(list)]
499− (weld (scag a c) (slag (add a b) c))
608+++ oust
609+ ~/ %oust
610+ |* [[a=@ b=@] c=(list)]
611+ (weld (scag +<-< c) (slag (add +<-< +<->) c))
500612```
501613
502614#### Examples
503615
504616```
505− > (oust [4 5] "good day, urbit!")
506− "good urbit!"
507−
508− > (oust [2 2] `(list @)`[1 2 3 4 ~])
509− ~[1 2]
617+> (oust [4 5] "good day, urbit!")
618+"good urbit!"
510619```
511620
621+```
622+> (oust [2 2] `(list @)`[1 2 3 4 ~])
623+~[1 2]
624+```
512625
513626---
514−### `++reap`
627+
628+## `++reap`
515629
516630Replicate
517631
@@ -530,30 +644,71 @@ A list.
530644#### Source
531645
532646```hoon
533− ++ reap :: replicate
534− ~/ %reap
535− |* [a=@ b=*]
536− |- ^- (list _b)
537− ?~ a ~
538− [b $(a (dec a))]
647+++ reap
648+ ~/ %reap
649+ |* [a=@ b=*]
650+ |- ^- (list _b)
651+ ?~ a ~
652+ [b $(a (dec a))]
539653```
540654
541655#### Examples
542656
543657```
544− > (reap 20 %a)
545− ~[%a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a]
658+> (reap 20 %a)
659+~[%a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a]
660+```
661+
662+```
663+> (reap 5 ~s1)
664+~[~s1 ~s1 ~s1 ~s1 ~s1]
665+> `@dr`(roll (reap 5 ~s1) add)
666+~s5
667+```
668+
669+---
670+
671+## `++rear`
672+
673+Last item of list
674+
675+Produces the last item in list `a`, crashing if `a` is null.
676+
677+#### Accepts
678+
679+`a` is a `list`.
680+
681+#### Produces
682+
683+The type of the last element in `a`.
684+
685+#### Source
686+
687+```hoon
688+++ rear
689+ ~/ %rear
690+ |* a=(list)
691+ ^- _?>(?=(^ a) i.a)
692+ ?> ?=(^ a)
693+ ?: =(~ t.a) i.a
694+ $(a t.a)
695+```
546696
547− > (reap 5 ~s1)
548− ~[~s1 ~s1 ~s1 ~s1 ~s1]
697+#### Examples
549698
550− > `@dr`(roll (reap 5 ~s1) add)
551− ~s5
699+```
700+> (rear ~[1 2 3])
701+3
552702```
553703
704+```
705+> (rear ~)
706+dojo: hoon expression failed
707+```
554708
555709---
556−### `++reel`
710+
711+## `++reel`
557712
558713Right fold
559714
@@ -582,30 +737,31 @@ The accumulator, which is a noun.
582737#### Source
583738
584739```hoon
585− ++ reel
586− ~/ %reel
587− |* [a=(list) b=_|=([* *] +<+)]
588− |- ^+ +<+.b
589− ?~ a
590− +<+.b
591− (b i.a $(a t.a))
740+++ reel
741+ ~/ %reel
742+ |* [a=(list) b=_=>(~ |=([* *] +<+))]
743+ |- ^+ ,.+<+.b
744+ ?~ a
745+ +<+.b
746+ (b i.a $(a t.a))
592747```
593748
594749#### Examples
595750
596751```
597− > (reel `(list @)`[1 2 3 4 5 ~] add)
598− 15
752+> (reel `(list @)`[1 2 3 4 5 ~] add)
753+15
599754
600− > (reel `(list @)`[6 3 1 ~] sub)
601− 4
755+> (reel `(list @)`[6 3 1 ~] sub)
756+4
602757
603− > (reel `(list @)`[3 6 1 ~] sub)
604− ! subtract-underflow
605− ! exit
758+> (reel `(list @)`[3 6 1 ~] sub)
759+! subtract-underflow
760+! exit
606761```
607762
608763`+mul`'s default sample is 1, so calling `+reel` with `+mul` yields the expected behavior:
764+
609765```
610766> *mul
6117671
@@ -613,13 +769,17 @@ The accumulator, which is a noun.
613769> (reel `(list @)`~[1 2 3 4] mul)
61477024
615771```
772+
616773However, if you build a gate that uses `+mul` like so, the sample defaults to 0
617774since that is the bunt of `@`:
775+
618776```
619777> (reel `(list @)`~[1 2 3 4] |=([a=@ b=@] (mul a b)))
6207780
621779```
780+
622781We can fix this with `|:`:
782+
623783```
624784> (reel `(list @)`~[1 2 3 4] |:([a=1 b=1] (mul a b)))
62578524
@@ -639,7 +799,8 @@ We can check explicitly what sequence of operations `+reel` performs like this:
639799
640800
641801---
642−### `++roll`
802+
803+## `++roll`
643804
644805Left fold
645806
@@ -668,13 +829,13 @@ The accumulator, which is a noun.
668829#### Source
669830
670831```hoon
671− ++ roll :: left fold
672− ~/ %roll
673− |* [a=(list) b=_|=([* *] +<+)]
674− |- ^+ +<+.b
675− ?~ a
676− +<+.b
677− $(a t.a, b b(+<+ (b i.a +<+.b)))
832+++ roll
833+ ~/ %roll
834+ |* [a=(list) b=_=>(~ |=([* *] +<+))]
835+ |- ^+ ,.+<+.b
836+ ?~ a
837+ +<+.b
838+ $(a t.a, b b(+<+ (b i.a +<+.b)))
678839```
679840
680841#### Examples
@@ -692,6 +853,7 @@ q=4
692853```
693854
694855`+mul`'s default sample is 1, so calling `+roll` with `+mul` yields the expected behavior:
856+
695857```
696858> *mul
6978591
@@ -699,13 +861,17 @@ q=4
699861> (roll `(list @)`~[1 2 3 4] mul)
70086224
701863```
864+
702865However, if you build a gate that uses `+mul` like so, the sample defaults to 0
703866since that is the bunt of `@`:
867+
704868```
705869> (roll `(list @)`~[1 2 3 4] |=([a=@ b=@] (mul a b)))
7068700
707871```
872+
708873We can fix this with `|:`:
874+
709875```
710876> (roll `(list @)`~[1 2 3 4] |:([a=1 b=1] (mul a b)))
71187724
@@ -736,7 +902,8 @@ This is in contrast to what one might expect:
736902```
737903
738904---
739−### `++scag`
905+
906+## `++scag`
740907
741908Prefix
742909
@@ -756,27 +923,29 @@ A list of the same type as `b`.
756923#### Source
757924
758925```hoon
759− ++ scag :: prefix
760− ~/ %scag
761− |* [a=@ b=(list)]
762− |- ^+ b
763− ?: |(?=(~ b) =(0 a)) ~
764− [i.b $(b t.b, a (dec a))]
926+++ scag
927+ ~/ %scag
928+ |* [a=@ b=(list)]
929+ |- ^+ b
930+ ?: |(?=(~ b) =(0 a)) ~
931+ [i.b $(b t.b, a (dec a))]
765932```
766933
767934#### Examples
768935
769936```
770− > (scag 2 `(list @)`[1 2 3 4 ~])
771− [i=1 t=~[2]]
772−
773− > (scag 10 `(list @)`[1 2 3 4 ~])
774− [i=1 t=~[2 3 4]]
937+> (scag 2 `(list @)`[1 2 3 4 ~])
938+[i=1 t=~[2]]
775939```
776940
941+```
942+> (scag 10 `(list @)`[1 2 3 4 ~])
943+[i=1 t=~[2 3 4]]
944+```
777945
778946---
779−### `++skid`
947+
948+## `++skid`
780949
781950Separate
782951
@@ -799,27 +968,26 @@ A cell of two lists.
799968#### Source
800969
801970```hoon
802− ++ skid :: separate
803− ~/ %skid
804− |* [a=(list) b=$-(* ?)]
805− |- ^+ [p=a q=a]
806− ?~ a [~ ~]
807− =+ c=$(a t.a)
808− ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
971+++ skid
972+ ~/ %skid
973+ |* [a=(list) b=$-(* ?)]
974+ |- ^+ [p=a q=a]
975+ ?~ a [~ ~]
976+ =+ c=$(a t.a)
977+ ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
809978```
810979
811−
812980#### Examples
813981
814982```
815− > =a |=(a=@ (gth a 1))
816− > (skid `(list @)`[0 1 2 3 ~] a)
817− [p=[i=2 t=~[3]] q=[i=0 t=~[1]]]
983+> =a |=(a=@ (gth a 1))
984+> (skid `(list @)`[0 1 2 3 ~] a)
985+[p=[i=2 t=~[3]] q=[i=0 t=~[1]]]
818986```
819987
820−
821988---
822−### `++skim`
989+
990+## `++skim`
823991
824992Suffix
825993
@@ -840,25 +1008,26 @@ A list.
8401008#### Source
8411009
8421010```hoon
843− ++ skim :: only
844− ~/ %skim
845− |* [a=(list) b=$-(* ?)]
846− |-
847− ^+ a
848− ?~ a ~
849− ?:((b i.a) [i.a $(a t.a)] $(a t.a))
1011+++ skim
1012+ ~/ %skim
1013+ |* [a=(list) b=$-(* ?)]
1014+ |-
1015+ ^+ a
1016+ ?~ a ~
1017+ ?:((b i.a) [i.a $(a t.a)] $(a t.a))
8501018```
8511019
8521020#### Examples
8531021
8541022```
855− > =a |=(a=@ (gth a 1))
856− > (skim `(list @)`[0 1 2 3 ~] a)
857− [i=2 t=~[3]]
1023+> =a |=(a=@ (gth a 1))
1024+> (skim `(list @)`[0 1 2 3 ~] a)
1025+[i=2 t=~[3]]
8581026```
8591027
8601028---
861−### `++skip`
1029+
1030+## `++skip`
8621031
8631032Except
8641033
@@ -879,26 +1048,26 @@ A list of the same type as `a`.
8791048#### Source
8801049
8811050```hoon
882− ++ skip :: except
883− ~/ %skip
884− |* [a=(list) b=$-(* ?)]
885− |-
886− ^+ a
887− ?~ a ~
888− ?:((b i.a) $(a t.a) [i.a $(a t.a)])
1051+++ skip
1052+ ~/ %skip
1053+ |* [a=(list) b=$-(* ?)]
1054+ |-
1055+ ^+ a
1056+ ?~ a ~
1057+ ?:((b i.a) $(a t.a) [i.a $(a t.a)])
8891058```
8901059
8911060#### Examples
8921061
8931062```
894− > =a |=(a=@ (gth a 1))
895− > (skip `(l)`[0 1 2 3 ~]) a)
896− [i=0 t=[i=1 t=~]]
1063+> =a |=(a=@ (gth a 1))
1064+> (skip `(l)`[0 1 2 3 ~]) a)
1065+[i=0 t=[i=1 t=~]]
8971066```
8981067
899−
9001068---
901−### `++slag`
1069+
1070+## `++slag`
9021071
9031072Suffix
9041073
@@ -918,27 +1087,27 @@ A list of the same type as `b`.
9181087#### Source
9191088
9201089```hoon
921− ++ slag :: suffix
922− ~/ %slag
923− |* [a=@ b=(list)]
924− |- ^+ b
925− ?: =(0 a) b
926− ?~ b ~
927− $(b t.b, a (dec a))
1090+++ slag
1091+ ~/ %slag
1092+ |* [a=@ b=(list)]
1093+ |- ^+ b
1094+ ?: =(0 a) b
1095+ ?~ b ~
1096+ $(b t.b, a (dec a))
9281097```
9291098
9301099#### Examples
9311100
9321101```
933− > (slag 2 (limo [1 2 3 4 ~]))
934− [i=3 t=[i=4 t=~]]
935− > (slag 1 (limo [1 2 3 4 ~]))
936− [i=2 t=[i=3 t=[i=4 t=~]]]
1102+> (slag 2 (limo [1 2 3 4 ~]))
1103+[i=3 t=[i=4 t=~]]
1104+> (slag 1 (limo [1 2 3 4 ~]))
1105+[i=2 t=[i=3 t=[i=4 t=~]]]
9371106```
9381107
939−
9401108---
941−### `++snag`
1109+
1110+## `++snag`
9421111
9431112Index
9441113
@@ -958,134 +1127,144 @@ Produces an element of `b`, or crashes if no element exists at that index.
9581127#### Source
9591128
9601129```hoon
961− ++ snag :: index
962− ~/ %snag
963− |* [a=@ b=(list)]
964− |-
965− ?~ b
966− ~|('snag-fail' !!)
967− ?: =(0 a) i.b
968− $(b t.b, a (dec a))
1130+++ snag
1131+ ~/ %snag
1132+ |* [a=@ b=(list)]
1133+ |- ^+ ?>(?=(^ b) i.b)
1134+ ?~ b
1135+ ~_ leaf+"snag-fail"
1136+ !!
1137+ ?: =(0 a) i.b
1138+ $(b t.b, a (dec a))
9691139```
9701140
9711141#### Examples
9721142
9731143```
974− > (snag 2 "asdf")
975− ~~d
976− > (snag 0 `(list @ud)`~[1 2 3 4])
977− 1
1144+> (snag 2 "asdf")
1145+'d'
9781146```
9791147
1148+```
1149+> (snag 0 `(list @ud)`~[1 2 3 4])
1150+1
1151+```
9801152
9811153---
982−### `++snoc`
9831154
984−Append
1155+## `++snap`
9851156
986−Accepts a `++list` `a` and a noun `b`, producing the list of `b` appended to `a`.
1157+Replace item at index
1158+
1159+Accepts a `list` `a`, an atom `b`, and a noun `c`, producing the list of `a` with the item at index `b` replaced with `c`.
9871160
9881161#### Accepts
9891162
9901163`a` is a list.
9911164
992−`b` is a noun.
1165+`b` is a atom.
1166+
1167+`c` is a noun.
9931168
9941169#### Produces
9951170
996−Produces a list of `b` appended to `a`.
1171+the list of `a` with the item at index `b` replaced with `c`.
9971172
9981173#### Source
9991174
10001175```hoon
1001− ++ snoc
1002− |* [a/(list) b/*]
1003− (weld a ^+(a [b]~))
1176+++ snap
1177+ ~/ %snap
1178+ |* [a=(list) b=@ c=*]
1179+ ^+ a
1180+ (weld (scag b a) [c (slag +(b) a)])
10041181```
10051182
10061183#### Examples
10071184
10081185```
1009− > `tape`(zing (snoc `(list tape)`~["a" "bc" "def"] "g"))
1010− "abcdefg"
1011− > (snoc `(list @ud)`~[1 2 3] 4)
1012− ~[1 2 3 4]
1186+> (snap (limo ~[2 3 4]) 1 11)
1187+~[2 11 4]
10131188```
10141189
10151190---
1016−### `++snap`
1017−
1018−Replace item at index
10191191
1020−Accepts a `list` `a`, an atom `b`, and a noun `c`, producing the list of `a` with the item at index `b` replaced with `c`.
1021−
1022−#### Accepts
1192+## `++snip`
10231193
1024−`a` is a list.
1194+Drop tail off list
10251195
1026−`b` is a atom.
1196+Removes the last element from list `a`.
10271197
1028−`c` is a noun.
1198+#### Accepts
10291199
1200+`a` is a `list`.
10301201
10311202#### Produces
10321203
1033−the list of `a` with the item at index `b` replaced with `c`.
1204+A `list`.
10341205
10351206#### Source
10361207
10371208```hoon
1038− ++ snap
1039− |* [a/(list) b/@ c/*]
1040− ^+ a
1041− (weld (scag b a) [c (slag +(b) a)])
1209+++ snip
1210+ ~/ %snip
1211+ |* a=(list)
1212+ ^+ a
1213+ ?~ a ~
1214+ ?: =(~ t.a) ~
1215+ [i.a $(a t.a)]
10421216```
10431217
10441218#### Examples
10451219
10461220```
1047− > (snap (limo ~[2 3 4]) 1 11)
1048− ~[2 11 4]
1221+> `tape`(snip "foobar")
1222+"fooba"
1223+```
1224+
1225+```
1226+> (snip ~)
1227+~
10491228```
10501229
10511230---
1052−### `++into`
10531231
1054−Insert item at index
1232+## `++snoc`
10551233
1056−Accepts a `list` `a`, an atom `b`, and a noun `c`, producing the list of `a` with the item `c` inserted at index `b`.
1234+Append
1235+
1236+Accepts a `++list` `a` and a noun `b`, producing the list of `b` appended to `a`.
10571237
10581238#### Accepts
10591239
10601240`a` is a list.
10611241
1062−`b` is a atom.
1063−
1064−`c` is a noun.
1065−
1242+`b` is a noun.
10661243
10671244#### Produces
10681245
1069−the list of `a` with the item `c` inserted at index `b`.
1246+Produces a list of `b` appended to `a`.
10701247
10711248#### Source
10721249
10731250```hoon
1074− ++ into
1075− |* [a/(list) b/@ c/*]
1076− ^+ a
1077− (weld (scag b a) [c (slag b a)])
1251+++ snoc
1252+ |* [a=(list) b=*]
1253+ (weld a ^+(a [b]~))
10781254```
10791255
10801256#### Examples
10811257
10821258```
1083− > (into (limo ~[2 3 4]) 1 11)
1084− ~[2 11 3 4]
1259+> `tape`(zing (snoc `(list tape)`~["a" "bc" "def"] "g"))
1260+"abcdefg"
1261+> (snoc `(list @ud)`~[1 2 3] 4)
1262+~[1 2 3 4]
10851263```
10861264
10871265---
1088−### `++sort`
1266+
1267+## `++sort`
10891268
10901269Quicksort
10911270
@@ -1106,28 +1285,29 @@ A list
11061285#### Source
11071286
11081287```hoon
1109− ++ sort !. :: quicksort
1110− ~/ %sort
1111− |* [a=(list) b=$-([* *] ?)]
1112− => .(a ^.(homo a))
1113− |- ^+ a
1114− ?~ a ~
1115− %+ weld
1116− $(a (skim t.a |=(c/_i.a (b c i.a))))
1117− ^+ t.a
1118− [i.a $(a (skim t.a |=(c/_i.a !(b c i.a))))]
1288+++ sort !.
1289+ ~/ %sort
1290+ |* [a=(list) b=$-([* *] ?)]
1291+ => .(a ^.(homo a))
1292+ |- ^+ a
1293+ ?~ a ~
1294+ =+ s=(skid t.a |:(c=i.a (b c i.a)))
1295+ %+ weld
1296+ $(a p.s)
1297+ ^+ t.a
1298+ [i.a $(a q.s)]
11191299```
11201300
11211301#### Examples
11221302
11231303```
1124− > (sort `(list @)`[0 1 2 3 ~] gth)
1125− ~[3 2 1 0]
1304+> (sort `(list @)`[0 1 2 3 ~] gth)
1305+~[3 2 1 0]
11261306```
11271307
1128−
11291308---
1130−### `++spin` {#spin}
1309+
1310+## `++spin` {#spin}
11311311
11321312Gate to list, with state
11331313
@@ -1152,35 +1332,39 @@ A pair of a list and a noun.
11521332#### Source
11531333
11541334```hoon
1155− ++ spin
1156− ~/ %spin
1157− |* [a=(list) b=* c=_|=(^ [** +<+])]
1158− => .(c `$-([_?>(?=(^ a) i.a) _b] [_-:(c) _b])`c)
1159− =/ acc=(list _-:(c)) ~
1160− |- ^- (pair _acc _b)
1161− ?~ a
1162− [(flop acc) b]
1163− =^ res b (c i.a b)
1164− $(acc [res acc], a t.a)
1335+++ spin
1336+ ~/ %spin
1337+ |* [a=(list) b=* c=_|=(^ [** +<+])]
1338+ => .(c `$-([_?>(?=(^ a) i.a) _b] [_-:(c) _b])`c)
1339+ =/ acc=(list _-:(c)) ~
1340+ |- ^- (pair _acc _b)
1341+ ?~ a
1342+ [(flop acc) b]
1343+ =^ res b (c i.a b)
1344+ $(acc [res acc], a t.a)
11651345```
11661346
11671347#### Examples
11681348
11691349```
1170− > %^ spin (limo ~[4 5 6]) :: Trivial example -- does nothing with the state
1171− 0
1172− |=([n=@ a=@] [n a])
1173− [p=~[4 5 6] q=0]
1350+> %^ spin (limo ~[4 5 6]) :: Trivial example -- does nothing with the state
1351+ 0
1352+ |=([n=@ a=@] [n a])
1353+[p=~[4 5 6] q=0]
1354+```
11741355
1175− > %^ spin (limo ~[4 5 6]) :: Form a pair with `p` as the index and `q` as the list element
1176− 0
1177− |=([n=@ a=@] [`(pair)`[a n] +(a)])
1178− [p=~[[p=0 q=4] [p=1 q=5] [p=2 q=6]] q=3]
1356+```
1357+> %^ spin (limo ~[4 5 6]) :: Form a pair with `p` as the index and `q` as the list element
1358+ 0
1359+ |=([n=@ a=@] [`(pair)`[a n] +(a)])
1360+[p=~[[p=0 q=4] [p=1 q=5] [p=2 q=6]] q=3]
1361+```
11791362
1180− > %^ spin (reap 10 0) :: Create 10 random numbers less than `10`
1181− ~(. og eny)
1182− |=([n=@ rng=_og] (rads:rng 10))
1183− [p=~[7 8 6 0 1 5 4 7 9 3] q=<4.rvi {a/@uvJ <51.qyl 129.pdd 41.mac 1.ane $141>}>]
1363+```
1364+> %^ spin (reap 10 0) :: Create 10 random numbers less than `10`
1365+ ~(. og eny)
1366+ |=([n=@ rng=_og] (rads:rng 10))
1367+[p=~[7 8 6 0 1 5 4 7 9 3] q=<4.rvi {a/@uvJ <51.qyl 129.pdd 41.mac 1.ane $141>}>]
11841368```
11851369
11861370#### Discussion
@@ -1189,10 +1373,9 @@ A pair of a list and a noun.
11891373with entropy (`eny`). The head of the product is the random number, the tail
11901374is the continuation of the RNG.
11911375
1192−
1193−
11941376---
1195−### `++spun` {#spun}
1377+
1378+## `++spun` {#spun}
11961379
11971380Gate to list, with state
11981381
@@ -1217,28 +1400,30 @@ A list.
12171400#### Source
12181401
12191402```hoon
1220− ++ spun
1221− ~/ %spun
1222− |* [a=(list) b=_|=(^ [** +<+])]
1223− p:(spin a +<+.b b)
1403+++ spun
1404+ ~/ %spun
1405+ |* [a=(list) b=_|=(^ [** +<+])]
1406+ p:(spin a +<+.b b)
12241407```
12251408
12261409#### Examples
12271410
12281411```
1229− > %+ spun (limo ~[4 5 6]) :: `p` as the index and `q` as the list element
1230− |=([n=@ a=@] [`(pair)`[a n] +(a)])
1231− ~[[p=0 q=4] [p=1 q=5] [p=2 q=6]]
1232−
1233− > =l (limo ~[7 8 9])
1234− > %+ spun (limo ~[4 5 6]) :: joins two lists into a list of pairs
1235− |=([n=@ a=@] [`(pair)`[(snag a l) n] +(a)])
1236− ~[[p=7 q=4] [p=8 q=5] [p=9 q=6]]
1412+> %+ spun (limo ~[4 5 6]) :: `p` as the index and `q` as the list element
1413+ |=([n=@ a=@] [`(pair)`[a n] +(a)])
1414+~[[p=0 q=4] [p=1 q=5] [p=2 q=6]]
12371415```
12381416
1417+```
1418+> =l (limo ~[7 8 9])
1419+> %+ spun (limo ~[4 5 6]) :: joins two lists into a list of pairs
1420+ |=([n=@ a=@] [`(pair)`[(snag a l) n] +(a)])
1421+~[[p=7 q=4] [p=8 q=5] [p=9 q=6]]
1422+```
12391423
12401424---
1241−### `++swag`
1425+
1426+## `++swag`
12421427
12431428Infix
12441429
@@ -1260,24 +1445,26 @@ A list of the same type as `c`.
12601445#### Source
12611446
12621447```hoon
1263− ++ swag
1264− |* [[a=@ b=@] c=(list)]
1265− (scag +<-> (slag +<-< c))
1448+++ swag
1449+ |* [[a=@ b=@] c=(list)]
1450+ (scag +<-> (slag +<-< c))
12661451```
12671452
12681453#### Examples
12691454
12701455```
1271− > (swag [2 5] "roly poly")
1272− "ly po"
1273−
1274− > (swag [2 2] (limo [1 2 3 4 ~]))
1275− [i=3 t=[i=4 t=~]]
1456+> (swag [2 5] "roly poly")
1457+"ly po"
12761458```
12771459
1460+```
1461+> (swag [2 2] (limo [1 2 3 4 ~]))
1462+[i=3 t=[i=4 t=~]]
1463+```
12781464
12791465---
1280−### `++turn`
1466+
1467+## `++turn`
12811468
12821469Gate to list
12831470
@@ -1297,23 +1484,27 @@ A list.
12971484#### Source
12981485
12991486```hoon
1300− ++ turn
1301− ~/ %turn
1302− |* [a=(list) b=gate]
1303− |-
1304− ?~ a ~
1305− [i=(b i.a) t=$(a t.a)]
1487+++ turn
1488+ ~/ %turn
1489+ |* [a=(list) b=gate]
1490+ => .(a (homo a))
1491+ ^- (list _?>(?=(^ a) (b i.a)))
1492+ |-
1493+ ?~ a ~
1494+ [i=(b i.a) t=$(a t.a)]
13061495```
13071496
13081497#### Examples
13091498
13101499```
1311− > (turn (limo [104 111 111 110 ~]) @t)
1312− <|h o o n|>
1500+> (turn (limo [104 111 111 110 ~]) @t)
1501+<|h o o n|>
1502+```
13131503
1314− > =a |=(a=@ (add a 4))
1315− > (turn (limo [1 2 3 4 ~]) a)
1316− ~[5 6 7 8]
1504+```
1505+> =a |=(a=@ (add a 4))
1506+> (turn (limo [1 2 3 4 ~]) a)
1507+~[5 6 7 8]
13171508```
13181509
13191510#### Discussion
@@ -1321,7 +1512,8 @@ A list.
13211512`turn` is Hoon's version of 'map' in Haskell.
13221513
13231514---
1324−### `++weld`
1515+
1516+## `++weld`
13251517
13261518Concatenate
13271519
@@ -1334,28 +1526,30 @@ Concatenate two `++list`s `a` and `b`.
13341526#### Source
13351527
13361528```hoon
1337− ++ weld
1338− ~/ %weld
1339− |* [a=(list) b=(list)]
1340− => .(a ^.(homo a), b ^.(homo b))
1341− |- ^+ b
1342− ?~ a b
1343− [i.a $(a t.a)]
1529+++ weld
1530+ ~/ %weld
1531+ |* [a=(list) b=(list)]
1532+ => .(a ^.(homo a), b ^.(homo b))
1533+ |- ^+ b
1534+ ?~ a b
1535+ [i.a $(a t.a)]
13441536```
13451537
13461538#### Examples
13471539
13481540```
1349− > (weld "urb" "it")
1350− "urbit"
1351−
1352− > (weld (limo [1 2 ~]) (limo [3 4 ~]))
1353− ~[1 2 3 4]
1541+> (weld "urb" "it")
1542+"urbit"
13541543```
13551544
1545+```
1546+> (weld (limo [1 2 ~]) (limo [3 4 ~]))
1547+~[1 2 3 4]
1548+```
13561549
13571550---
1358−### `++welp`
1551+
1552+## `++welp`
13591553
13601554Perfect weld
13611555
@@ -1375,7 +1569,7 @@ A list.
13751569#### Source
13761570
13771571```hoon
1378−++ welp :: faceless weld
1572+++ welp
13791573 ~/ %welp
13801574 =| [* *]
13811575 |@
@@ -1389,23 +1583,27 @@ A list.
13891583#### Examples
13901584
13911585```
1392− > (welp "foo" "bar")
1393− "foobar"
1394−
1395− > (welp ~[60 61 62] ~[%a %b %c])
1396− [60 61 62 %a %b %c ~]
1586+> (welp "foo" "bar")
1587+"foobar"
1588+```
13971589
1398− > ? (welp ~[60 61 62] ~[%a %b %c])
1399− {@ud @ud @ud $a $b $c $~}
1400− [60 61 62 %a %b %c ~]
1590+```
1591+> (welp ~[60 61 62] ~[%a %b %c])
1592+[60 61 62 %a %b %c ~]
14011593
1402− > (welp [sa+1 so+2 ~] si=3)
1403− [[%sa 1] [%so 2] si=3]
1594+> ? (welp ~[60 61 62] ~[%a %b %c])
1595+ {@ud @ud @ud $a $b $c $~}
1596+[60 61 62 %a %b %c ~]
14041597```
14051598
1599+```
1600+> (welp [sa+1 so+2 ~] si=3)
1601+[[%sa 1] [%so 2] si=3]
1602+```
14061603
14071604---
1408−### `++zing`
1605+
1606+## `++zing`
14091607
14101608Turns a `++list` of lists into a single list by promoting the elements of
14111609each sublist into the higher.
@@ -1421,7 +1619,7 @@ A list.
14211619#### Source
14221620
14231621```hoon
1424−++ zing :: promote
1622+++ zing
14251623 ~/ %zing
14261624 =| *
14271625 |@
@@ -1432,15 +1630,16 @@ A list.
14321630 --
14331631```
14341632
1435−
14361633#### Examples
14371634
14381635```
1439− > (zing (limo [(limo ['a' 'b' 'c' ~]) (limo ['e' 'f' 'g' ~]) (limo ['h' 'i' 'j' ~]) ~]))
1440− ~['a' 'b' 'c' 'e' 'f' 'g' 'h' 'i' 'j']
1636+> (zing (limo [(limo ['a' 'b' 'c' ~]) (limo ['e' 'f' 'g' ~]) (limo ['h' 'i' 'j' ~]) ~]))
1637+~['a' 'b' 'c' 'e' 'f' 'g' 'h' 'i' 'j']
1638+```
14411639
1442− > (zing (limo [(limo [1 'a' 2 'b' ~]) (limo [3 'c' 4 'd' ~]) ~]))
1443− ~[1 97 2 98 3 99 4 100]
1640+```
1641+> (zing (limo [(limo [1 'a' 2 'b' ~]) (limo [3 'c' 4 'd' ~]) ~]))
1642+~[1 97 2 98 3 99 4 100]
14441643```
14451644
14461645---
content/docs/hoon/reference/stdlib/2c.md+713−637
@@ -4,15 +4,15 @@ weight = 6
44template = "doc.html"
55+++
66
7−### `++bex`
7+## `++bex`
88
99Binary exponent
1010
11−Computes the result of `2^a`, producing an atom.
11+Computes the result of `2^a`, where `a` is a block size (see [$bloq](/docs/hoon/reference/stdlib/1c#bloq)), producing an atom.
1212
1313#### Accepts
1414
15−`a` is an atom.
15+`a` is an `bloq`.
1616
1717#### Produces
1818
@@ -21,30 +21,34 @@ An atom.
2121#### Source
2222
2323```hoon
24− ++ bex
25− ~/ %bex
26− |= a=@
27− ^- @
28− ?: =(0 a) 1
29− (mul 2 $(a (dec a)))
24+++ bex
25+ ~/ %bex
26+ |= a=bloq
27+ ^- @
28+ ?: =(0 a) 1
29+ (mul 2 $(a (dec a)))
3030```
3131
3232#### Examples
3333
3434```
35− > (bex 4)
36− 16
35+> (bex 4)
36+16
37+```
3738
38− > (bex (add 19 1))
39− 1.048.576
39+```
40+> (bex (add 19 1))
41+1.048.576
42+```
4043
41− > (bex 0)
42− 1
44+```
45+> (bex 0)
46+1
4347```
4448
4549---
4650
47−### `++can`
51+## `++can`
4852
4953Assemble
5054
@@ -54,9 +58,12 @@ value.
5458
5559#### Accepts
5660
57−`a` is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c)).
61+`a` is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq)).
5862
59−`b` is a `list` of length-value pairs, `p` and `q`.
63+`b` is a `list` of length-value pairs, `p` and `q`:
64+
65+- `p` is a [step](/docs/hoon/reference/stdlib/1c/#step).
66+- `q` is a `@`.
6067
6168#### Produces
6269
@@ -65,45 +72,59 @@ An atom.
6572#### Source
6673
6774```hoon
68− ++ can
69− ~/ %can
70− |= [a=bloq b=(list [p=@ q=@])]
71− ^- @
72− ?~ b 0
73− (add (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
75+++ can
76+ ~/ %can
77+ |= [a=bloq b=(list [p=step q=@])]
78+ ^- @
79+ ?~ b 0
80+ (add (end [a p.i.b] q.i.b) (lsh [a p.i.b] $(b t.b)))
7481```
7582
7683#### Examples
7784
7885```
79− > `@ub`21 :: @ub is the binary aura
80− 0b1.0101
86+> `@ub`21 :: @ub is the binary aura
87+0b1.0101
88+```
8189
82− > `@ub`(can 3 ~[[1 21]])
83− 0b1.0101
90+```
91+> `@ub`(can 3 ~[[1 21]])
92+0b1.0101
93+```
8494
85− > `@ub`(can 3 ~[[1 1]])
86− 0b1
95+```
96+> `@ub`(can 3 ~[[1 1]])
97+0b1
98+```
8799
88− > `@ub`(can 0 ~[[1 255]])
89− 0b1
100+```
101+> `@ub`(can 0 ~[[1 255]])
102+0b1
103+```
90104
91− > `@ux`(can 3 [3 0xc1] [1 0xa] ~) :: @ux is the hexadecimal aura
92− 0xa00.00c1
105+```
106+> `@ux`(can 3 [3 0xc1] [1 0xa] ~) :: @ux is the hexadecimal aura
107+0xa00.00c1
108+```
93109
94− > `@ux`(can 3 [3 0xc1] [1 0xa] [1 0x23] ~)
95− 0x23.0a00.00c1
110+```
111+> `@ux`(can 3 [3 0xc1] [1 0xa] [1 0x23] ~)
112+0x23.0a00.00c1
113+```
96114
97− > `@ux`(can 4 [3 0xc1] [1 0xa] [1 0x23] ~)
98− 0x23.000a.0000.0000.00c1
115+```
116+> `@ux`(can 4 [3 0xc1] [1 0xa] [1 0x23] ~)
117+0x23.000a.0000.0000.00c1
118+```
99119
100− > `@ux`(can 3 ~[[1 'a'] [2 'bc']])
101− 0x63.6261
120+```
121+> `@ux`(can 3 ~[[1 'a'] [2 'bc']])
122+0x63.6261
102123```
103124
104125---
105126
106−### `++cat`
127+## `++cat`
107128
108129Concatenate
109130
@@ -112,7 +133,7 @@ atom.
112133
113134#### Accepts
114135
115−`a` is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c)).
136+`a` is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq)).
116137
117138`b` is an atom.
118139
@@ -125,49 +146,43 @@ An atom.
125146#### Source
126147
127148```hoon
128− ++ cat
129− ~/ %cat
130− |= [a=bloq b=@ c=@]
131− (add (lsh a (met a b) c) b)
149+++ cat
150+ ~/ %cat
151+ |= [a=bloq b=@ c=@]
152+ (add (lsh [a (met a b)] c) b)
132153```
133154
134155#### Examples
135156
136157```
137− > `@ub`(cat 3 1 0) :: @ub is the binary aura
138− 0b1
139−
140− > `@ub`(cat 0 1 1)
141− 0b11
142−
143− > `@ub`(cat 0 2 1)
144− 0b110
145−
146− > `@ub`(cat 2 1 1)
147− 0b1.0001
148−
149− > `@ub`256
150− 0b1.0000.0000
151−
152− > `@ub`255
153− 0b1111.1111
154−
155− > `@ub`(cat 3 256 255)
156− 0b1111.1111.0000.0001.0000.0000
157−
158− > `@ub`(cat 2 256 255)
159− 0b1111.1111.0001.0000.0000
160−
161− > (cat 3 256 255)
162− 16.711.936
158+> `@ub`(cat 3 1 0) :: @ub is the binary aura
159+0b1
160+> `@ub`(cat 0 1 1)
161+0b11
162+> `@ub`(cat 0 2 1)
163+0b110
164+> `@ub`(cat 2 1 1)
165+0b1.0001
166+```
163167
164− > (cat 2 256 255)
165− 1.044.736
168+```
169+> `@ub`256
170+0b1.0000.0000
171+> `@ub`255
172+0b1111.1111
173+> `@ub`(cat 3 256 255)
174+0b1111.1111.0000.0001.0000.0000
175+> `@ub`(cat 2 256 255)
176+0b1111.1111.0001.0000.0000
177+> (cat 3 256 255)
178+16.711.936
179+> (cat 2 256 255)
180+1.044.736
166181```
167182
168183---
169184
170−### `++cut`
185+## `++cut`
171186
172187Slice
173188
@@ -176,11 +191,12 @@ Slices `c` blocks of size `a` that are positioned `b` blocks from the end of
176191
177192#### Accepts
178193
179−`a` is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c)).
194+`a` is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c)).
180195
181−`b` is an atom.
196+`[b c]` where:
182197
183−`c` is an atom.
198+- `b` is a [step](/docs/hoon/reference/stdlib/1c#step).
199+- `c` is a [step](/docs/hoon/reference/stdlib/1c#step).
184200
185201`d` is an atom.
186202
@@ -191,43 +207,42 @@ An atom.
191207#### Source
192208
193209```hoon
194− ++ cut
195− ~/ %cut
196− |= [a=bloq [b=@u c=@u] d=@]
197− (end a c (rsh a b d))
210+++ cut
211+ ~/ %cut
212+ |= [a=bloq [b=step c=step] d=@]
213+ (end [a c] (rsh [a b] d))
198214```
199215
200216#### Examples
201217
202218```
203− > (cut 0 [1 1] 2)
204− 1
205−
206− > (cut 0 [2 1] 4)
207− 1
208−
209− > `@t`(cut 3 [0 3] 'abcdefgh')
210− 'abc'
211−
212− > `@t`(cut 3 [1 3] 'abcdefgh') :: @t is the cord aura
213− 'bcd'
214−
215− > `@ub`(cut 0 [0 3] 0b1111.0000.1101) :: @ub is the binary aura
216− 0b101
217−
218− > `@ub`(cut 0 [0 6] 0b1111.0000.1101)
219− 0b1101
219+> (cut 0 [1 1] 2)
220+1
221+> (cut 0 [2 1] 4)
222+1
223+```
220224
221− > `@ub`(cut 0 [4 6] 0b1111.0000.1101)
222− 0b11.0000
225+```
226+> `@t`(cut 3 [0 3] 'abcdefgh') :: @t is the cord aura
227+'abc'
228+> `@t`(cut 3 [1 3] 'abcdefgh')
229+'bcd'
230+```
223231
224− > `@ub`(cut 0 [3 6] 0b1111.0000.1101)
225− 0b10.0001
232+```
233+> `@ub`(cut 0 [0 3] 0b1111.0000.1101) :: @ub is the binary aura
234+0b101
235+> `@ub`(cut 0 [0 6] 0b1111.0000.1101)
236+0b1101
237+> `@ub`(cut 0 [4 6] 0b1111.0000.1101)
238+0b11.0000
239+> `@ub`(cut 0 [3 6] 0b1111.0000.1101)
240+0b10.0001
226241```
227242
228243---
229244
230−### `++end`
245+## `++end`
231246
232247Tail
233248
@@ -235,8 +250,8 @@ Produces an atom by taking the last `step` blocks of size `bloq` from `b`.
235250
236251#### Accepts
237252
238−`a` is an atom slice specifier (see [`++bite`](/docs/hoon/reference/stdlib/1c#bite)),
239−which is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c#bloq))
253+`a` is an atom slice specifier (see [`$bite`](/docs/hoon/reference/stdlib/1c#bite)),
254+which is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq))
240255with optional block count.
241256
242257`b` is an atom.
@@ -248,56 +263,51 @@ An atom.
248263#### Source
249264
250265```hoon
251− ++ end
252− ~/ %end
253− |= [a=bite b=@]
254− =/ [=bloq =step] ?^(a a [a *step])
255− (mod b (bex (mul (bex bloq) step)))
266+++ end
267+ ~/ %end
268+ |= [a=bite b=@]
269+ =/ [=bloq =step] ?^(a a [a *step])
270+ (mod b (bex (mul (bex bloq) step)))
256271```
257272
258273#### Examples
259274
260275```
261− > (end [2 2] 255)
262− 255
263−
264− > (end [3 1] 255)
265− 255
266−
267− > (end 3 255)
268− 255
269−
270− > (end 3 256)
271− 0
272−
273− > `@ub`12 :: @ub is the binary aura
274− 0b1100
275−
276− > `@ub`(end [0 3] 12)
277− 0b100
278−
279− > (end [0 3] 12)
280− 4
281−
282− > `@ub`(end [1 3] 12)
283− 0b1100
284−
285− > (end [1 3] 12)
286− 12
287−
288− > `@ux`'abc' :: @ux is the hexademical aura
289− 0x63.6261
276+> (end [2 2] 255)
277+255
278+> (end [3 1] 255)
279+255
280+> (end 3 255)
281+255
282+> (end 3 256)
283+0
284+```
290285
291− > `@ux`(end [3 2] 'abc')
292− 0x6261
286+```
287+> `@ub`12 :: @ub is the binary aura
288+0b1100
289+> `@ub`(end [0 3] 12)
290+0b100
291+> (end [0 3] 12)
292+4
293+> `@ub`(end [1 3] 12)
294+0b1100
295+> (end [1 3] 12)
296+12
297+```
293298
294− > `@t`(end [3 2] 'abc') :: @t is the cord aura
295− 'ab'
299+```
300+> `@ux`'abc' :: @ux is the hexademical aura
301+0x63.6261
302+> `@ux`(end [3 2] 'abc')
303+0x6261
304+> `@t`(end [3 2] 'abc') :: @t is the cord aura
305+'ab'
296306```
297307
298308---
299309
300−### `++fil`
310+## `++fil`
301311
302312Fill bloqstream
303313
@@ -305,9 +315,9 @@ Produces an atom by repeating `c` for `b` blocks of size `a`.
305315
306316#### Accepts
307317
308−`a` is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c)).
318+`a` is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq)).
309319
310−`b` is an atom.
320+`b` is a [step](/docs/hoon/reference/stdlib/1c#step).
311321
312322`c` is an atom.
313323
@@ -318,38 +328,48 @@ An atom.
318328#### Source
319329
320330```hoon
321− ++ fil
322− |= [a=bloq b=@u c=@]
323− =+ n=0
324− =+ d=c
325− |- ^- @
326− ?: =(n b)
327− (rsh a 1 d)
328− $(d (add c (lsh a 1 d)), n +(n))
331+++ fil
332+ ~/ %fil
333+ |= [a=bloq b=step c=@]
334+ =| n=@ud
335+ =. c (end a c)
336+ =/ d c
337+ |- ^- @
338+ ?: =(n b)
339+ (rsh a d)
340+ $(d (add c (lsh a d)), n +(n))
329341```
330342
331343#### Examples
332344
333345```
334− > `@t`(fil 3 5 %a) :: @t is the cord (string) aura
335− 'aaaaa'
346+> `@t`(fil 3 5 %a) :: @t is the cord (string) aura
347+'aaaaa'
348+```
336349
337− > `@t`(fil 5 10 %ceeb)
338− 'ceebceebceebceebceebceebceebceebceebceeb'
350+```
351+> `@t`(fil 5 10 %ceeb)
352+'ceebceebceebceebceebceebceebceebceebceeb'
353+```
339354
340− > `@t`(fil 4 10 %eced)
341− 'ʇʇʇʇʇʇʇʇʇʇed'
355+```
356+> `@t`(fil 4 10 'eced')
357+'ecececececececececec'
358+```
342359
343− > `@tas`(fil 4 10 %bf) :: @tas is the term aura
344− %bfbfbfbfbfbfbfbfbfbf
360+```
361+> `@tas`(fil 4 10 %bf) :: @tas is the term aura
362+%bfbfbfbfbfbfbfbfbfbf
363+```
345364
346− > `@ub`(fil 2 6 1) :: @ub is the binary aura
347− 0b1.0001.0001.0001.0001.0001
365+```
366+> `@ub`(fil 2 6 1) :: @ub is the binary aura
367+0b1.0001.0001.0001.0001.0001
348368```
349369
350370---
351371
352−### `++lsh`
372+## `++lsh`
353373
354374Left-shift
355375
@@ -357,8 +377,8 @@ Produces an atom by left-shifting `b` by `step` blocks of size `bloq`.
357377
358378#### Accepts
359379
360−`a` is an atom slice specifier (see [`++bite`](/docs/hoon/reference/stdlib/1c#bite)),
361−which is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c#bloq))
380+`a` is an atom slice specifier (see [`$bite`](/docs/hoon/reference/stdlib/1c#bite)),
381+which is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq))
362382with optional block count.
363383
364384`b` is an atom.
@@ -370,41 +390,38 @@ An atom.
370390#### Source
371391
372392```hoon
373− ++ lsh
374− ~/ %lsh
375− |= [a=bite b=@]
376− =/ [=bloq =step] ?^(a a [a *step])
377− (mul b (bex (mul (bex bloq) step)))
393+++ lsh
394+ ~/ %lsh
395+ |= [a=bite b=@]
396+ =/ [=bloq =step] ?^(a a [a *step])
397+ (mul b (bex (mul (bex bloq) step)))
378398```
379399
380400#### Examples
381401
382402```
383− > `@ub`1 :: @ub is the binary aura
384− 0b1
385−
386− > `@ub`(lsh [0 1] 1)
387− 0b10
388−
389− > (lsh [0 1] 1)
390− 2
391−
392− > (lsh 0 1)
393− 2
394−
395− > `@ub`255
396− 0b1111.1111
397−
398− > `@ub`(lsh [3 1] 255)
399− 0b1111.1111.0000.0000
403+> `@ub`1 :: @ub is the binary aura
404+0b1
405+> `@ub`(lsh [0 1] 1)
406+0b10
407+> (lsh [0 1] 1)
408+2
409+> (lsh 0 1)
410+2
411+```
400412
401− > (lsh [3 1] 255)
402− 65.280
413+```
414+> `@ub`255
415+0b1111.1111
416+> `@ub`(lsh [3 1] 255)
417+0b1111.1111.0000.0000
418+> (lsh [3 1] 255)
419+65.280
403420```
404421
405422---
406423
407−### `++met`
424+## `++met`
408425
409426Measure
410427
@@ -412,45 +429,47 @@ Computes the number of blocks of size `a` in `b`, producing an atom.
412429
413430#### Accepts
414431
415−`a` is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c)).
432+`a` is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c/bloq)).
416433
417434`b` is an atom.
418435
419436#### Source
420437
421438```hoon
422− ++ met
423− ~/ %met
424− |= [a=bloq b=@]
425− ^- @
426− =+ c=0
427− |-
428− ?: =(0 b) c
429− $(b (rsh a 1 b), c +(c))
439+++ met
440+ ~/ %met
441+ |= [a=bloq b=@]
442+ ^- @
443+ =+ c=0
444+ |-
445+ ?: =(0 b) c
446+ $(b (rsh a b), c +(c))
430447```
431448
432449#### Examples
433450
434451```
435− > (met 0 1)
436− 1
437−
438− > (met 0 2)
439− 2
440−
441− > (met 3 255)
442− 1
452+> (met 0 1)
453+1
454+> (met 0 2)
455+2
456+```
443457
444− > (met 3 256)
445− 2
458+```
459+> (met 3 255)
460+1
461+> (met 3 256)
462+2
463+```
446464
447− > (met 3 'abcde')
448− 5
465+```
466+> (met 3 'abcde')
467+5
449468```
450469
451470---
452471
453−### `++rap`
472+## `++rap`
454473
455474Assemble non-zero
456475
@@ -469,41 +488,39 @@ An atom.
469488#### Source
470489
471490```hoon
472− ++ rap
473− ~/ %rap
474− |= [a=bloq b=(list @)]
475− ^- @
476− =+ ~
477− ?~ b 0
478− (cat a i.b $(b t.b))
491+++ rap
492+ ~/ %rap
493+ |= [a=bloq b=(list @)]
494+ ^- @
495+ ?~ b 0
496+ (cat a i.b $(b t.b))
479497```
480498
481499#### Examples
482500
483501```
484− > `@ub`(rap 2 [1 2 3 4 ~]) :: @ub is the binary aura
485− 0b100.0011.0010.0001
486−
487− > `@ub`(rap 1 [1 2 3 4 ~])
488− 0b1.0011.1001
489−
490− > (rap 0 [0 0 0 ~])
491− 0
492−
493− > (rap 0 [1 0 1 ~])
494− 3
495−
496− > `@ub`3
497− 0b11
498−
499− > (rap 0 [0 1 0 0 1 2 ~])
500− 11
502+> `@ub`(rap 2 [1 2 3 4 ~]) :: @ub is the binary aura
503+0b100.0011.0010.0001
504+> `@ub`(rap 1 [1 2 3 4 ~])
505+0b1.0011.1001
506+```
501507
502− > (rap 0 [1 1 2 ~])
503− 11
508+```
509+> (rap 0 [0 0 0 ~])
510+0
511+> (rap 0 [1 0 1 ~])
512+3
513+```
504514
505− > `@ub`11
506− 0b1011
515+```
516+> `@ub`3
517+0b11
518+> (rap 0 [0 1 0 0 1 2 ~])
519+11
520+> (rap 0 [1 1 2 ~])
521+11
522+> `@ub`11
523+0b1011
507524```
508525
509526#### Discussion
@@ -512,7 +529,7 @@ Any element of the value `0` is not included in concatenation.
512529
513530---
514531
515−### `++rep`
532+## `++rep`
516533
517534Assemble single
518535
@@ -533,63 +550,69 @@ An atom.
533550#### Source
534551
535552```hoon
536− ++ rep
537− ~/ %rep
538− |= [a=bite b=(list @)]
539− =/ [=bloq =step] ?^(a a [a *step])
540− =| i=@ud
541− |- ^- @
542− ?~ b 0
543− %+ add $(i +(i), b t.b)
544− (lsh [bloq (mul step i)] (end [bloq step] i.b))
553+++ rep
554+ ~/ %rep
555+ |= [a=bite b=(list @)]
556+ =/ [=bloq =step] ?^(a a [a *step])
557+ =| i=@ud
558+ |- ^- @
559+ ?~ b 0
560+ %+ add $(i +(i), b t.b)
561+ (lsh [bloq (mul step i)] (end [bloq step] i.b))
545562```
546563
547564#### Examples
548565
549566```
550− > `@ub`(rep 2 [1 2 3 4 ~]) :: @ub is the binary aura
551− 0b100.0011.0010.0001
552−
553− > (rep 0 [0 0 1 ~])
554− 4
555−
556− > (rep 0 [0 0 0 1 ~])
557− 8
558−
559− > `@ub`(rep 0 [0 0 0 1 ~])
560− 0b1000
561−
562− > `@ub`8
563− 0b1000
564−
565− > `@ub`(rep 0 [1 0 1 0 ~])
566− 0b101
567−
568− > `@ub`(rep 0 [1 2 3 4 ~])
569− 0b101
567+> `@ub`(rep 2 [1 2 3 4 ~]) :: @ub is the binary aura
568+0b100.0011.0010.0001
569+```
570570
571− > (rep 0 [0 1 0 1 ~])
572− 10
571+```
572+> (rep 0 [0 0 1 ~])
573+4
574+> (rep 0 [0 0 0 1 ~])
575+8
576+```
573577
574− > (rep 0 [1 0 1 0 1 ~])
575− 21
578+```
579+> `@ub`(rep 0 [0 0 0 1 ~])
580+0b1000
581+> `@ub`8
582+0b1000
583+```
576584
577− > `@ub`21
578− 0b10.1010
585+```
586+> `@ub`(rep 0 [1 0 1 0 ~])
587+0b101
588+> `@ub`(rep 0 [1 2 3 4 ~])
589+0b101
590+```
579591
580− > `@ub`(rep 3 [12 166 8 34 ~])
581− 0b10.0010.0000.1000.1010.0110.0000.1100
592+```
593+> (rep 0 [0 1 0 1 ~])
594+10
595+> (rep 0 [1 0 1 0 1 ~])
596+21
597+> `@ub`21
598+0b10.1010
599+```
582600
583− > `*`"abcd"
584− [97 98 99 100 0]
601+```
602+> `@ub`(rep 3 [12 166 8 34 ~])
603+0b10.0010.0000.1000.1010.0110.0000.1100
604+```
585605
586− > `@t`(rep 3 "abcd") :: @t is the text aura
587− 'abcd'
606+```
607+> `*`"abcd"
608+[97 98 99 100 0]
609+> `@t`(rep 3 "abcd") :: @t is the text aura
610+'abcd'
588611```
589612
590613---
591614
592−### `++rev`
615+## `++rev`
593616
594617Reverses block order, accounting for leading zeroes.
595618
@@ -630,35 +653,30 @@ An atom.
630653
631654```
632655> =a 0b1111.0000.1111.1010.0011
633−
634656> `@ub`(rev 0 20 a)
6356570b1100.0101.1111.0000.1111
636−
637658> `@ub`(rev 0 12 a)
6386590b1100.0101.1111
639−
640660> `@ub`(rev 2 5 a)
6416610b11.1010.1111.0000.1111
642−
643662> `@ub`(rev 2 4 a)
6446630b11.1010.1111.0000
645−
646664> `@ub`(rev 2 6 a)
6476650b11.1010.1111.0000.1111.0000
666+```
648667
668+```
649669> (rev 1 10 1.000)
650670179.200
651−
652671> (rev 2 5 1.000)
653672582.400
654−
655673> (rev 1 5 1.000)
656674175
657675```
658676
659677---
660678
661−### `++rip`
679+## `++rip`
662680
663681Disassemble
664682
@@ -679,51 +697,51 @@ A list of atoms.
679697#### Source
680698
681699```hoon
682− ++ rip
683− ~/ %rip
684− |= [a=bite b=@]
685− ^- (list @)
686− ?: =(0 b) ~
687− [(end a b) $(b (rsh a b))]
700+++ rip
701+ ~/ %rip
702+ |= [a=bite b=@]
703+ ^- (list @)
704+ ?: =(0 b) ~
705+ [(end a b) $(b (rsh a b))]
688706```
689707
690708#### Examples
691709
692710```
693− > `@ub`155 :: @ub is the binary aura
694− 0b1001.1011
695−
696− > (rip 0 155)
697− ~[1 1 0 1 1 0 0 1]
698−
699− > (rip 2 155)
700− ~[11 9]
701−
702− > (rip 0 11)
703− ~[1 1 0 1]
704−
705− > (rip 1 155)
706− ~[3 2 1 2]
707−
708− > `@ub`256
709− 0b1.0000.0000
710−
711− > (rip 0 256)
712− ~[0 0 0 0 0 0 0 0 1]
711+> `@ub`155 :: @ub is the binary aura
712+0b1001.1011
713+> (rip 0 155)
714+~[1 1 0 1 1 0 0 1]
715+> (rip 2 155)
716+~[11 9]
717+```
713718
714− > (rip 2 256)
715− ~[0 0 1]
719+```
720+> (rip 0 11)
721+~[1 1 0 1]
722+> (rip 1 155)
723+~[3 2 1 2]
724+```
716725
717− > (rip 3 256)
718− ~[0 1]
726+```
727+> `@ub`256
728+0b1.0000.0000
729+> (rip 0 256)
730+~[0 0 0 0 0 0 0 0 1]
731+> (rip 2 256)
732+~[0 0 1]
733+> (rip 3 256)
734+~[0 1]
735+```
719736
720− > `tape`(rip 3 'abcd')
721− "abcd"
737+```
738+> `tape`(rip 3 'abcd')
739+"abcd"
722740```
723741
724742---
725743
726−### `++rsh`
744+## `++rsh`
727745
728746Right-shift
729747
@@ -744,56 +762,51 @@ An atom.
744762#### Source
745763
746764```hoon
747− ++ rsh
748− ~/ %rsh
749− |= [a=bite b=@]
750− =/ [=bloq =step] ?^(a a [a *step])
751− (div b (bex (mul (bex bloq) step)))
765+++ rsh
766+ ~/ %rsh
767+ |= [a=bite b=@]
768+ =/ [=bloq =step] ?^(a a [a *step])
769+ (div b (bex (mul (bex bloq) step)))
752770```
753771
754772#### Examples
755773
756774```
757− > `@ub`145 :: @ub is the binary aura
758− 0b1001.0001
759−
760− > `@ub`(rsh [1 1] 145)
761− 0b10.0100
762−
763− > (rsh [1 1] 145)
764− 36
765−
766− > (rsh 1 145)
767− 36
768−
769− > `@ub`(rsh [2 1] 145)
770− 0b1001
771−
772− > (rsh [2 1] 145)
773− 9
774−
775− > `@ub`10
776− 0b1010
777−
778− > `@ub`(rsh [0 1] 10)
779− 0b101
780−
781− > (rsh [0 1] 10)
782− 5
783−
784− > `@ux`'abc'
785− 0x63.6261
775+> `@ub`145 :: @ub is the binary aura
776+0b1001.0001
777+> `@ub`(rsh [1 1] 145)
778+0b10.0100
779+> (rsh [1 1] 145)
780+36
781+> (rsh 1 145)
782+36
783+> `@ub`(rsh [2 1] 145)
784+0b1001
785+> (rsh [2 1] 145)
786+9
787+```
786788
787− > `@t`(rsh [3 1] 'abc')
788− 'bc'
789+```
790+> `@ub`10
791+0b1010
792+> `@ub`(rsh [0 1] 10)
793+0b101
794+> (rsh [0 1] 10)
795+5
796+```
789797
790− > `@ux`(rsh [3 1] 'abc')
791− 0x6362
798+```
799+> `@ux`'abc'
800+0x63.6261
801+> `@t`(rsh [3 1] 'abc')
802+'bc'
803+> `@ux`(rsh [3 1] 'abc')
804+0x6362
792805```
793806
794807---
795808
796−### `++run`
809+## `++run`
797810
798811`++turn` into atom.
799812
@@ -817,25 +830,24 @@ An atom.
817830#### Source
818831
819832```hoon
820− ++ run
821− ~/ %run
822− |= [a=bite b=@ c=$-(@ @)]
823− (rep a (turn (rip a b) c))
833+++ run
834+ ~/ %run
835+ |= [a=bite b=@ c=$-(@ @)]
836+ (rep a (turn (rip a b) c))
824837```
825838
826839#### Examples
827840
828841```
829− > `@ux`65.535 :: @ux is the hexadecimal aura
842+ > `@ux`65.535 :: @ux is the hexadecimal aura
830843 0xffff
831−
832− > `@ux`(run 2 65.535 dec) :: dec is the decrement gate
844+ > `@ux`(run 2 65.535 dec) :: dec is the decrement gate
833845 0xeeee
834846```
835847
836848---
837849
838−### `++rut`
850+## `++rut`
839851
840852`++turn` into list.
841853
@@ -859,25 +871,80 @@ A list.
859871#### Source
860872
861873```hoon
862− ++ rut
863− ~/ %rut
864− |* [a=bite b=@ c=$-(@ *)]
865− (turn (rip a b) c)
874+++ rut
875+ ~/ %rut
876+ |* [a=bite b=@ c=$-(@ *)]
877+ (turn (rip a b) c)
866878```
867879
868880#### Examples
869881
870882```
871− > `@ux`65.535 :: @ux is the hexadecimal aura
872− 0xffff
883+> `@ux`65.535 :: @ux is the hexadecimal aura
884+0xffff
885+> `(list @ux)`(rut 2 65.535 dec) :: dec is the decrement gate
886+~[0xe 0xe 0xe 0xe]
887+```
888+
889+---
890+
891+## `++sew`
892+
893+Stitch one atom into another
894+
895+Replace `c` blocks of size `a` at offset `b` of atom `e` with `c` blocks of size `a` from atom `d`.
896+
897+That is, take `(end [a c] d)` from `d` and overwrite the `(cut a [b c] e)` part of `e`.
898+
899+Or in simpler terms, take from the start of `d` and replace some part of `e` with it.
900+
901+#### Accepts
873902
874− > `(list @ux)`(rut 2 65.535 dec) :: dec is the decrement gate
875− ~[0xe 0xe 0xe 0xe]
903+`a` is a [$bloq](/docs/hoon/reference/stdlib/1c#bite) (block size).
904+
905+`[b c d]` where:
906+
907+- `b` is a [step](/docs/hoon/reference/stdlib/1c#step) specifying the number of `bloq`s to offset.
908+- `b` is a [step](/docs/hoon/reference/stdlib/1c#step) specifying the number of `bloq`s to replace.
909+- `d` is the donor atom.
910+
911+`e` is the recipient atom.
912+
913+#### Produces
914+
915+An atom.
916+
917+#### Source
918+
919+```hoon
920+++ sew
921+ ~/ %sew
922+ |= [a=bloq [b=step c=step d=@] e=@]
923+ ^- @
924+ %+ add
925+ (can a b^e c^d ~)
926+ =/ f [a (add b c)]
927+ (lsh f (rsh f e))
928+```
929+
930+#### Examples
931+
932+```
933+> `@t`(sew 3 [0 0 'XXXX'] 'OOOO')
934+'OOOO'
935+> `@t`(sew 3 [0 1 'XXXX'] 'OOOO')
936+'XOOO'
937+> `@t`(sew 3 [2 1 'XXXX'] 'OOOO')
938+'OOXO'
939+> `@t`(sew 3 [2 2 'XXXX'] 'OOOO')
940+'OOXX'
941+> `@t`(sew 3 [0 4 'XXXX'] 'OOOO')
942+'XXXX'
876943```
877944
878945---
879946
880−### `++swp`
947+## `++swp`
881948
882949Reverse block order
883950
@@ -886,7 +953,7 @@ reversing the block order of `b` using block size `a`.
886953
887954#### Accepts
888955
889−`a` is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c)).
956+`a` is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq)).
890957
891958`b` is an atom.
892959
@@ -897,31 +964,33 @@ An atom
897964#### Source
898965
899966```hoon
900− ++ swp |=([a=bloq b=@] (rep a (flop (rip a b))))
967+++ swp
968+ ~/ %swp
969+ |= [a=bloq b=@]
970+ (rep a (flop (rip a b)))
901971```
902972
903973#### Examples
904974
905975```
906− > `@ub`24 :: @ub is the binary aura
907− 0b1.1000
908−
909− > (swp 0 24)
910− 3
911−
912− > `@ub`3
913− 0b11
914−
915− > (swp 0 0)
916− 0
976+> `@ub`24 :: @ub is the binary aura
977+0b1.1000
978+> (swp 0 24)
979+3
980+> `@ub`3
981+0b11
982+```
917983
918− > (swp 0 128)
919− 1
984+```
985+> (swp 0 0)
986+0
987+> (swp 0 128)
988+1
920989```
921990
922991---
923992
924−### `++xeb`
993+## `++xeb`
925994
926995Binary logarithm
927996
@@ -938,38 +1007,48 @@ An atom.
9381007#### Source
9391008
9401009```hoon
941− ++ xeb
942− ~/ %xeb
943− |= a=@
944− ^- @
945− (met 0 a)
1010+++ xeb
1011+ ~/ %xeb
1012+ |= a=@
1013+ ^- @
1014+ (met 0 a)
9461015```
9471016
9481017#### Examples
9491018
9501019```
951− > (xeb 31)
952− 5
1020+> (xeb 31)
1021+5
1022+```
9531023
954− > (xeb 32)
955− 6
1024+```
1025+> (xeb 32)
1026+6
1027+```
9561028
957− > (xeb 49)
958− 6
1029+```
1030+> (xeb 49)
1031+6
1032+```
9591033
960− > (xeb 0)
961− 0
1034+```
1035+> (xeb 0)
1036+0
1037+```
9621038
963− > (xeb 1)
964− 1
1039+```
1040+> (xeb 1)
1041+1
1042+```
9651043
966− > (xeb 2)
967− 2
1044+```
1045+> (xeb 2)
1046+2
9681047```
9691048
9701049---
9711050
972−### `++fe`
1051+## `++fe`
9731052
9741053Modulo bloq
9751054
@@ -994,7 +1073,7 @@ representation.
9941073
9951074#### Accepts
9961075
997−`a` is a `bloq`.
1076+`a` is a `bloq` (and is the sample of the parent core).
9981077
9991078`b` is an atom.
10001079
@@ -1002,40 +1081,40 @@ representation.
10021081
10031082#### Produces
10041083
1005−A `@s`
1084+A `@s`.
10061085
10071086#### Source
10081087
10091088```hoon
1010− ++ dif |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c))))
1089+ ++ dif
1090+ |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c))))
10111091```
10121092
10131093#### Examples
10141094
10151095```
1016− > (~(dif fe 3) 63 64)
1017− 255
1018−
1019− > (~(dif fe 3) 5 10)
1020− 251
1021−
1022− > (~(dif fe 3) 0 1)
1023− 255
1024−
1025− > (~(dif fe 0) 9 10)
1026− 1
1027−
1028− > (~(dif fe 0) 9 11)
1029− 0
1030−
1031− > (~(dif fe 0) 9 12)
1032− 1
1096+> (~(dif fe 3) 63 64)
1097+255
1098+> (~(dif fe 3) 5 10)
1099+251
1100+> (~(dif fe 3) 0 1)
1101+255
1102+```
10331103
1034− > (~(dif fe 2) 9 12)
1035− 13
1104+```
1105+> (~(dif fe 0) 9 10)
1106+1
1107+> (~(dif fe 0) 9 11)
1108+0
1109+> (~(dif fe 0) 9 12)
1110+1
1111+```
10361112
1037− > (~(dif fe 2) 63 64)
1038− 15
1113+```
1114+> (~(dif fe 2) 9 12)
1115+13
1116+> (~(dif fe 2) 63 64)
1117+15
10391118```
10401119
10411120---
@@ -1048,7 +1127,9 @@ Inverts the order of the modular field.
10481127
10491128#### Accepts
10501129
1051−`b` is a `bloq`. (see [`++bloq`](/docs/hoon/reference/stdlib/1c))
1130+`a` is a `bloq` (and is the sample of the parent core).
1131+
1132+`b` is a `bloq`. (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq))
10521133
10531134#### Produces
10541135
@@ -1057,29 +1138,30 @@ An atom.
10571138#### Source
10581139
10591140```hoon
1060− ++ inv |=(b=@ (sub (dec out) (sit b)))
1141+++ inv |=(b=@ (sub (dec out) (sit b)))
10611142```
10621143
10631144#### Examples
10641145
10651146```
1066− > (~(inv fe 3) 255)
1067− 0
1068−
1069− > (~(inv fe 3) 256)
1070− 255
1071−
1072− > (~(inv fe 3) 0)
1073− 255
1074−
1075− > (~(inv fe 3) 1)
1076− 254
1147+> (~(inv fe 3) 255)
1148+0
1149+> (~(inv fe 3) 256)
1150+255
1151+```
10771152
1078− > (~(inv fe 3) 2)
1079− 253
1153+```
1154+> (~(inv fe 3) 0)
1155+255
1156+> (~(inv fe 3) 1)
1157+254
1158+> (~(inv fe 3) 2)
1159+253
1160+```
10801161
1081− > (~(inv fe 3) 55)
1082− 200
1162+```
1163+> (~(inv fe 3) 55)
1164+200
10831165```
10841166
10851167---
@@ -1092,7 +1174,9 @@ Reverses bytes within a block.
10921174
10931175#### Accepts
10941176
1095−`b` is a `bloq`. (see [`++bloq`](/docs/hoon/reference/stdlib/1c))
1177+`a` is a `bloq` (and the sample of the parent core).
1178+
1179+`b` is a `bloq`. (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq))
10961180
10971181#### Produces
10981182
@@ -1101,75 +1185,66 @@ An atom.
11011185#### Source
11021186
11031187```hoon
1104− ++ net |= b=@ ^- @
1105− => .(b (sit b))
1106− ?: (lte a 3)
1107− b
1108− =+ c=(dec a)
1109− %+ con
1110− (lsh c 1 $(a c, b (cut c [0 1] b)))
1111− $(a c, b (cut c [1 1] b))
1188+++ net |= b=@ ^- @
1189+ => .(b (sit b))
1190+ ?: (lte a 3)
1191+ b
1192+ =+ c=(dec a)
1193+ %+ con
1194+ (lsh c $(a c, b (cut c [0 1] b)))
1195+ $(a c, b (cut c [1 1] b))
11121196```
11131197
11141198#### Examples
11151199
11161200```
1117− > (~(net fe 3) 64)
1118− 64
1119−
1120− > (~(net fe 3) 128)
1121− 128
1122−
1123− > (~(net fe 3) 255)
1124− 255
1125−
1126− > (~(net fe 3) 256)
1127− 0
1128−
1129− > (~(net fe 3) 257)
1130− 1
1131−
1132− > (~(net fe 3) 500)
1133− 244
1134−
1135− > (~(net fe 3) 511)
1136− 255
1137−
1138− > (~(net fe 3) 512)
1139− 0
1140−
1141− > (~(net fe 3) 513)
1142− 1
1143−
1144− > (~(net fe 3) 0)
1145− 0
1146−
1147− > (~(net fe 3) 1)
1148− 1
1149−
1150− > (~(net fe 0) 1)
1151− 1
1152−
1153− > (~(net fe 0) 2)
1154− 0
1155−
1156− > (~(net fe 0) 3)
1157− 1
1158−
1159− > (~(net fe 6) 1)
1160− 72.057.594.037.927.936
1161−
1162− > (~(net fe 6) 2)
1163− 144.115.188.075.855.872
1201+> (~(net fe 3) 64)
1202+64
1203+> (~(net fe 3) 128)
1204+128
1205+> (~(net fe 3) 255)
1206+255
1207+> (~(net fe 3) 256)
1208+0
1209+> (~(net fe 3) 257)
1210+1
1211+```
11641212
1165− > (~(net fe 6) 3)
1166− 216.172.782.113.783.808
1213+```
1214+> (~(net fe 3) 500)
1215+244
1216+> (~(net fe 3) 511)
1217+255
1218+> (~(net fe 3) 512)
1219+0
1220+> (~(net fe 3) 513)
1221+1
1222+```
11671223
1168− > (~(net fe 6) 4)
1169− 288.230.376.151.711.744
1224+```
1225+> (~(net fe 3) 0)
1226+0
1227+> (~(net fe 3) 1)
1228+1
1229+> (~(net fe 0) 1)
1230+1
1231+> (~(net fe 0) 2)
1232+0
1233+> (~(net fe 0) 3)
1234+1
1235+```
11701236
1171− > (~(net fe 6) 5)
1172− 360.287.970.189.639.680
1237+```
1238+> (~(net fe 6) 1)
1239+72.057.594.037.927.936
1240+> (~(net fe 6) 2)
1241+144.115.188.075.855.872
1242+> (~(net fe 6) 3)
1243+216.172.782.113.783.808
1244+> (~(net fe 6) 4)
1245+288.230.376.151.711.744
1246+> (~(net fe 6) 5)
1247+360.287.970.189.639.680
11731248```
11741249
11751250---
@@ -1182,7 +1257,7 @@ Produces the maximum integer value that the current block can store; `2^a^a`.
11821257
11831258#### Accepts
11841259
1185−`a` is a `bloq`.
1260+`a` is a `bloq` (and is the sample of the parent core).
11861261
11871262#### Produces
11881263
@@ -1191,35 +1266,33 @@ An atom.
11911266#### Source
11921267
11931268```hoon
1194− ++ out (bex (bex a))
1269+++ out (bex (bex a))
11951270```
11961271
11971272#### Examples
11981273
11991274```
1200− > ~(out fe 0)
1201− 2
1202−
1203− > ~(out fe 1)
1204− 4
1205−
1206− > ~(out fe 2)
1207− 16
1208−
1209− > ~(out fe 3)
1210− 256
1211−
1212− > ~(out fe 4)
1213− 65.536
1275+> ~(out fe 0)
1276+2
1277+> ~(out fe 1)
1278+4
1279+> ~(out fe 2)
1280+16
1281+> ~(out fe 3)
1282+256
1283+> ~(out fe 4)
1284+65.536
1285+```
12141286
1215− > ~(out fe 10)
1216− \/179.769.313.486.231.590.772.930.519.078.902.473.361.797.697.894.230.657.273\/
1217− .430.081.157.732.675.805.500.963.132.708.477.322.407.536.021.120.113.879.87
1218− 1.393.357.658.789.768.814.416.622.492.847.430.639.474.124.377.767.893.424.8
1219− 65.485.276.302.219.601.246.094.119.453.082.952.085.005.768.838.150.682.342.
1220− 462.881.473.913.110.540.827.237.163.350.510.684.586.298.239.947.245.938.479
1221− .716.304.835.356.329.624.224.137.216
1222− \/ \/
1287+```
1288+> ~(out fe 10)
1289+\/179.769.313.486.231.590.772.930.519.078.902.473.361.797.697.894.230.657.273\/
1290+ .430.081.157.732.675.805.500.963.132.708.477.322.407.536.021.120.113.879.87
1291+ 1.393.357.658.789.768.814.416.622.492.847.430.639.474.124.377.767.893.424.8
1292+ 65.485.276.302.219.601.246.094.119.453.082.952.085.005.768.838.150.682.342.
1293+ 462.881.473.913.110.540.827.237.163.350.510.684.586.298.239.947.245.938.479
1294+ .716.304.835.356.329.624.224.137.216
1295+\/ \/
12231296```
12241297
12251298---
@@ -1232,7 +1305,7 @@ Rolls `d` to the left by `c` `b`-sized blocks.
12321305
12331306#### Accepts
12341307
1235−`a` is a `bloq`.
1308+`a` is a `bloq` (and is the sample of the parent core).
12361309
12371310`b` is a `bloq`.
12381311
@@ -1247,30 +1320,32 @@ An atom.
12471320#### Source
12481321
12491322```hoon
1250− ++ rol |= [b=bloq c=@ d=@] ^- @
1251− =+ e=(sit d)
1252− =+ f=(bex (sub a b))
1253− =+ g=(mod c f)
1254− (sit (con (lsh b g e) (rsh b (sub f g) e)))
1323+++ rol |= [b=bloq c=@ d=@] ^- @
1324+ =+ e=(sit d)
1325+ =+ f=(bex (sub a b))
1326+ =+ g=(mod c f)
1327+ (sit (con (lsh [b g] e) (rsh [b (sub f g)] e)))
12551328```
12561329
12571330#### Examples
12581331
12591332```
1260− > `@ux`(~(rol fe 6) 4 3 0xabac.dedf.1213)
1261− 0x1213.0000.abac.dedf
1333+> `@ux`(~(rol fe 6) 4 3 0xabac.dedf.1213)
1334+0x1213.0000.abac.dedf
12621335
1263− > `@ux`(~(rol fe 6) 4 2 0xabac.dedf.1213)
1264− 0xdedf.1213.0000.abac
1336+> `@ux`(~(rol fe 6) 4 2 0xabac.dedf.1213)
1337+0xdedf.1213.0000.abac
1338+```
12651339
1266− > `@t`(~(rol fe 5) 3 1 'dfgh')
1267− 'hdfg'
1340+```
1341+> `@t`(~(rol fe 5) 3 1 'dfgh')
1342+'hdfg'
12681343
1269− > `@t`(~(rol fe 5) 3 2 'dfgh')
1270− 'ghdf'
1344+> `@t`(~(rol fe 5) 3 2 'dfgh')
1345+'ghdf'
12711346
1272− > `@t`(~(rol fe 5) 3 0 'dfgh')
1273− 'dfgh'
1347+> `@t`(~(rol fe 5) 3 0 'dfgh')
1348+'dfgh'
12741349```
12751350
12761351---
@@ -1283,7 +1358,7 @@ Rolls `d` to the right by `c` `b`-sized blocks.
12831358
12841359#### Accepts
12851360
1286−`a` is a `bloq`.
1361+`a` is a `bloq` (and is the sample of the parent core).
12871362
12881363`b` is a `bloq`.
12891364
@@ -1298,49 +1373,53 @@ An atom.
12981373#### Source
12991374
13001375```hoon
1301− ++ ror |= [b=bloq c=@ d=@] ^- @
1302− =+ e=(sit d)
1303− =+ f=(bex (sub a b))
1304− =+ g=(mod c f)
1305− (sit (con (rsh b g e) (lsh b (sub f g) e)))
1376+++ ror |= [b=bloq c=@ d=@] ^- @
1377+ =+ e=(sit d)
1378+ =+ f=(bex (sub a b))
1379+ =+ g=(mod c f)
1380+ (sit (con (rsh [b g] e) (lsh [b (sub f g)] e)))
13061381```
13071382
13081383#### Examples
13091384
13101385```
1311− > `@ux`(~(ror fe 6) 4 1 0xabac.dedf.1213)
1312− 0x1213.0000.abac.dedf
1386+> `@ux`(~(ror fe 6) 4 1 0xabac.dedf.1213)
1387+0x1213.0000.abac.dedf
13131388
1314− > `@ux`(~(ror fe 6) 3 5 0xabac.dedf.1213)
1315− 0xacde.df12.1300.00ab
1389+> `@ux`(~(ror fe 6) 3 5 0xabac.dedf.1213)
1390+0xacde.df12.1300.00ab
13161391
1317− > `@ux`(~(ror fe 6) 3 3 0xabac.dedf.1213)
1318− 0xdf12.1300.00ab.acde
1392+> `@ux`(~(ror fe 6) 3 3 0xabac.dedf.1213)
1393+0xdf12.1300.00ab.acde
1394+```
13191395
1320− > `@t`(~(rol fe 5) 3 0 'hijk')
1321− 'hijk'
1396+```
1397+> `@t`(~(rol fe 5) 3 0 'hijk')
1398+'hijk'
13221399
1323− > `@t`(~(rol fe 5) 3 1 'hijk')
1324− 'khij'
1400+> `@t`(~(rol fe 5) 3 1 'hijk')
1401+'khij'
13251402
1326− > `@t`(~(rol fe 5) 3 2 'hijk')
1327− 'jkhi'
1403+> `@t`(~(rol fe 5) 3 2 'hijk')
1404+'jkhi'
13281405```
13291406
13301407---
13311408
1332−### `++sit:fe`
1409+### `++sum:fe`
13331410
1334−Enforce modulo
1411+Sum
13351412
1336−Produces an atom in the current modular block representation.
1413+Sums two numbers in this modular field.
13371414
13381415#### Accepts
13391416
1340−`a` is a `bloq`.
1417+`a` is a `bloq` (and is the sample of the parent core).
13411418
13421419`b` is an atom.
13431420
1421+`c` is an atom.
1422+
13441423#### Produces
13451424
13461425An atom.
@@ -1348,62 +1427,51 @@ An atom.
13481427#### Source
13491428
13501429```hoon
1351− ++ sit |=(b=@ (end a 1 b))
1430+++ sum |=([b=@ c=@] (sit (add b c)))
13521431```
13531432
13541433#### Examples
13551434
13561435```
1357− > (~(sit fe 3) 255)
1358− 255
1359−
1360− > (~(sit fe 3) 256)
1361− 0
1362−
1363− > (~(sit fe 3) 257)
1364− 1
1365−
1366− > (~(sit fe 2) 257)
1367− 1
1368−
1369− > (~(sit fe 2) 10.000)
1370− 0
1371−
1372− > (~(sit fe 2) 100)
1373− 4
1374−
1375− > (~(sit fe 2) 19)
1376− 3
1377−
1378− > (~(sit fe 2) 17)
1379− 1
1436+> (~(sum fe 3) 10 250)
1437+4
1438+```
13801439
1381− > (~(sit fe 0) 17)
1382− 1
1440+```
1441+> (~(sum fe 0) 0 1)
1442+1
1443+> (~(sum fe 0) 0 2)
1444+0
1445+```
13831446
1384− > (~(sit fe 0) 0)
1385− 0
1447+```
1448+> (~(sum fe 2) 14 2)
1449+0
1450+> (~(sum fe 2) 14 3)
1451+1
1452+```
13861453
1387− > (~(sit fe 0) 1)
1388− 1
1454+```
1455+> (~(sum fe 4) 10.000 256)
1456+10.256
1457+> (~(sum fe 4) 10.000 100.000)
1458+44.464
13891459```
13901460
13911461---
13921462
1393−### `++sum:fe`
1463+### `++sit:fe`
13941464
1395−Sum
1465+Enforce modulo
13961466
1397−Sums two numbers in this modular field.
1467+Produces an atom in the current modular block representation.
13981468
13991469#### Accepts
14001470
1401−`a` is a `bloq`.
1471+`a` is a `bloq` (and is the sample of the parent core).
14021472
14031473`b` is an atom.
14041474
1405−`c` is an atom.
1406−
14071475#### Produces
14081476
14091477An atom.
@@ -1411,32 +1479,40 @@ An atom.
14111479#### Source
14121480
14131481```hoon
1414− ++ sum |=([b=@ c=@] (sit (add b c)))
1482+++ sit |=(b=@ (end a b))
14151483```
14161484
14171485#### Examples
14181486
14191487```
1420− > (~(sum fe 3) 10 250)
1421− 4
1422−
1423− > (~(sum fe 0) 0 1)
1424− 1
1425−
1426− > (~(sum fe 0) 0 2)
1427− 0
1428−
1429− > (~(sum fe 2) 14 2)
1430− 0
1431−
1432− > (~(sum fe 2) 14 3)
1433− 1
1488+> (~(sit fe 3) 255)
1489+255
1490+> (~(sit fe 3) 256)
1491+0
1492+> (~(sit fe 3) 257)
1493+1
1494+```
14341495
1435− > (~(sum fe 4) 10.000 256)
1436− 10.256
1496+```
1497+> (~(sit fe 2) 257)
1498+1
1499+> (~(sit fe 2) 10.000)
1500+0
1501+> (~(sit fe 2) 100)
1502+4
1503+> (~(sit fe 2) 19)
1504+3
1505+> (~(sit fe 2) 17)
1506+1
1507+```
14371508
1438− > (~(sum fe 4) 10.000 100.000)
1439− 44.464
1509+```
1510+> (~(sit fe 0) 17)
1511+1
1512+> (~(sit fe 0) 0)
1513+0
1514+> (~(sit fe 0) 1)
1515+1
14401516```
14411517
14421518---
content/docs/hoon/reference/stdlib/2d.md+55−54
@@ -4,7 +4,7 @@ weight = 7
44template = "doc.html"
55+++
66
7−### `++con`
7+## `++con`
88
99Binary OR
1010
@@ -23,22 +23,22 @@ An atom.
2323#### Source
2424
2525```hoon
26− ++ con
27− ~/ %con
28− |= [a=@ b=@]
29− =+ [c=0 d=0]
30− |- ^- @
31− ?: ?&(=(0 a) =(0 b)) d
32− %= $
33− a (rsh 0 1 a)
34− b (rsh 0 1 b)
35− c +(c)
36− d %+ add d
37− %^ lsh 0 c
38− ?& =(0 (end 0 1 a))
39− =(0 (end 0 1 b))
40− ==
41− ==
26+++ con
27+ ~/ %con
28+ |= [a=@ b=@]
29+ =+ [c=0 d=0]
30+ |- ^- @
31+ ?: ?&(=(0 a) =(0 b)) d
32+ %= $
33+ a (rsh 0 a)
34+ b (rsh 0 b)
35+ c +(c)
36+ d %+ add d
37+ %+ lsh [0 c]
38+ ?& =(0 (end 0 a))
39+ =(0 (end 0 b))
40+ ==
41+ ==
4242```
4343
4444#### Examples
@@ -97,9 +97,9 @@ contexts. That's because `0` is true in Hoon and `1` is false. Outside of Hoon,
9797where `0` is false and `1` is true, bitwise OR is the logical disjunction and
9898bitwise AND is the logical conjunction.
9999
100−
101100---
102−### `++dis`
101+
102+## `++dis`
103103
104104Binary AND
105105
@@ -118,22 +118,22 @@ An atom.
118118#### Source
119119
120120```hoon
121− ++ dis
122− ~/ %dis
123− |= [a=@ b=@]
124− =| [c=@ d=@]
125− |- ^- @
126− ?: ?|(=(0 a) =(0 b)) d
127− %= $
128− a (rsh 0 1 a)
129− b (rsh 0 1 b)
130− c +(c)
131− d %+ add d
132− %^ lsh 0 c
133− ?| =(0 (end 0 1 a))
134− =(0 (end 0 1 b))
135− ==
136− ==
121+++ dis
122+ ~/ %dis
123+ |= [a=@ b=@]
124+ =| [c=@ d=@]
125+ |- ^- @
126+ ?: ?|(=(0 a) =(0 b)) d
127+ %= $
128+ a (rsh 0 a)
129+ b (rsh 0 b)
130+ c +(c)
131+ d %+ add d
132+ %+ lsh [0 c]
133+ ?| =(0 (end 0 a))
134+ =(0 (end 0 b))
135+ ==
136+ ==
137137```
138138
139139#### Examples
@@ -187,7 +187,8 @@ where `0` is false and `1` is true, bitwise OR is the logical disjunction and
187187bitwise AND is the logical conjunction.
188188
189189---
190−### `++mix`
190+
191+## `++mix`
191192
192193Binary XOR
193194
@@ -206,19 +207,19 @@ An atom.
206207#### Source
207208
208209```hoon
209− ++ mix
210− ~/ %mix
211− |= [a=@ b=@]
212− ^- @
213− =+ [c=0 d=0]
214− |-
215− ?: ?&(=(0 a) =(0 b)) d
216− %= $
217− a (rsh 0 1 a)
218− b (rsh 0 1 b)
219− c +(c)
220− d (add d (lsh 0 c =((end 0 1 a) (end 0 1 b))))
221− ==
210+++ mix
211+ ~/ %mix
212+ |= [a=@ b=@]
213+ ^- @
214+ =+ [c=0 d=0]
215+ |-
216+ ?: ?&(=(0 a) =(0 b)) d
217+ %= $
218+ a (rsh 0 a)
219+ b (rsh 0 b)
220+ c +(c)
221+ d (add d (lsh [0 c] =((end 0 a) (end 0 b))))
222+ ==
222223```
223224
224225#### Examples
@@ -272,7 +273,8 @@ its samples and its product are stacked.
272273```
273274
274275---
275−### `++not`
276+
277+## `++not`
276278
277279Binary NOT
278280
@@ -294,8 +296,8 @@ An atom.
294296#### Source
295297
296298```hoon
297− ++ not |= [a=bloq b=@ c=@]
298− (mix c (dec (bex (mul b (bex a)))))
299+++ not |= [a=bloq b=@ c=@]
300+ (mix c (dec (bex (mul b (bex a)))))
299301```
300302
301303#### Examples
@@ -369,5 +371,4 @@ What's happening here may not be readily apparent. But we're only flipping the
369371last block of size `1` (bitwidth 2) of the binary `0b111`. That is, we leave
370372the "0b1" piece just the same and manipulate the "11" that the number ends with.
371373
372−
373−---
374+---
content/docs/hoon/reference/stdlib/2e.md+98−178
@@ -4,44 +4,7 @@ weight = 8
44template = "doc.html"
55+++
66
7−### `++fnv`
8−
9−FNV scrambler
10−
11−Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm. Multiplies
12−`a` by the prime number 16,777,619 and then takes the [block](/docs/hoon/reference/stdlib/2c) of size
13−5 off the product's end, producing an atom.
14−
15−#### Accepts
16−
17−`a` is an atom.
18−
19−#### Produces
20−
21−An atom.
22−
23−#### Source
24−
25−```hoon
26− ++ fnv |=(a=@ (end 5 1 (mul 16.777.619 a)))
27−```
28−
29−#### Examples
30−
31−```
32− > (fnv 10.000)
33− 272.465.456
34−
35− > (fnv 10.001)
36− 289.243.075
37−
38− > (fnv 1)
39− 16.777.619
40−```
41−
42−
43−---
44−### `++mug` {#mug}
7+## `++mug` {#mug}
458
469murmur3 scrambler
4710
@@ -59,57 +22,70 @@ An atom.
5922#### Source
6023
6124```hoon
62−++ mug :: mug with murmur3
25+++ mug
6326 ~/ %mug
64− |= a/*
65− |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
66− ++ trim :: 31-bit nonzero
67− |= key/@
68− =+ syd=0xcafe.babe
69− |- ^- @
70− =+ haz=(muk syd (met 3 key) key)
71− =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
72− ?.(=(0 ham) ham $(syd +(syd)))
27+ |= a=*
28+ |^ ?@ a (mum 0xcafe.babe 0x7fff a)
29+ =/ b (cat 5 $(a -.a) $(a +.a))
30+ (mum 0xdead.beef 0xfffe b)
31+ ::
32+ ++ mum
33+ |= [syd=@uxF fal=@F key=@]
34+ =/ wyd (met 3 key)
35+ =| i=@ud
36+ |- ^- @F
37+ ?: =(8 i) fal
38+ =/ haz=@F (muk syd wyd key)
39+ =/ ham=@F (mix (rsh [0 31] haz) (end [0 31] haz))
40+ ?.(=(0 ham) ham $(i +(i), syd +(syd)))
7341 --
7442```
7543
7644#### Examples
7745
7846```
79− > (mug 10.000)
80− 795.713.195
81−
82− > (mug 10.001)
83− 420.521.697
47+> (mug 10.000)
48+795.713.195
49+```
8450
85− > (mug 1)
86− 1.901.865.568
51+```
52+> (mug 10.001)
53+420.521.697
54+```
8755
88− > (mug (some 10))
89− 2.099.076.946
56+```
57+> (mug 1)
58+1.901.865.568
59+```
9060
91− > (mug [1 2 3 4 5 ~])
92− 1.719.833.228
61+```
62+> (mug (some 10))
63+750.200.080
9364```
9465
66+```
67+> (mug [1 2 3 4 5 ~])
68+1.565.443.491
69+```
9570
9671---
97−### `++muk`
72+
73+## `++muk`
9874
9975Standard MurmurHash3
10076
10177Implementation of the 32-bit
10278[MurmurHash3](https://en.wikipedia.org/wiki/MurmurHash#Algorithm)
103−non-cryptographic hash algorithm. Takes `a` as the seed, `b` as the key length
104−in [blocks](/docs/hoon/reference/stdlib/2c) of size 3, and `c` as the key, producing an atom.
79+non-cryptographic hash algorithm. Takes `syd` as the seed, `len` as the key length
80+in [blocks](/docs/hoon/reference/stdlib/2c) of size 3, and `key` as the key, producing an atom.
10581
10682#### Accepts
10783
108−`a` is an atom.
84+`syd` is an atom.
10985
110−`b` is an atom.
86+`len` is an atom.
11187
112−`c` is an atom.
88+`key` is an atom.
11389
11490#### Produces
11591
@@ -118,63 +94,63 @@ An atom.
11894#### Source
11995
12096```hoon
121− ++ muk
122− ~% %muk ..muk ~
123− =+ ~(. fe 5)
124− |= [syd=@ len=@ key=@]
125− ?> &((lte (met 5 syd) 1) (lte (met 0 len) 31))
126− =/ pad (sub len (met 3 key))
127− =/ data (weld (rip 3 key) (reap pad 0))
128− =/ nblocks (div len 4) :: intentionally off-by-one
129− =/ h1 syd
130− =+ [c1=0xcc9e.2d51 c2=0x1b87.3593]
131− =/ blocks (rip 5 key)
132− =/ i nblocks
133− =. h1 =/ hi h1 |-
134− ?: =(0 i) hi :: negative array index
135− =/ k1 (snag (sub nblocks i) blocks)
136− =. k1 (sit (mul k1 c1))
137− =. k1 (rol 0 15 k1)
138− =. k1 (sit (mul k1 c2))
139− =. hi (mix hi k1)
140− =. hi (rol 0 13 hi)
141− =. hi (sum (sit (mul hi 5)) 0xe654.6b64)
142− $(i (dec i))
143− =/ tail (slag (mul 4 nblocks) data)
144− =/ k1 0
145− =/ tlen (dis len 3)
146− =. h1
147− ?+ tlen h1 :: fallthrough switch
148− $3 =. k1 (mix k1 (lsh 0 16 (snag 2 tail)))
149− =. k1 (mix k1 (lsh 0 8 (snag 1 tail)))
150− =. k1 (mix k1 (snag 0 tail))
151− =. k1 (sit (mul k1 c1))
152− =. k1 (rol 0 15 k1)
153− =. k1 (sit (mul k1 c2))
154− (mix h1 k1)
155− $2 =. k1 (mix k1 (lsh 0 8 (snag 1 tail)))
156− =. k1 (mix k1 (snag 0 tail))
157− =. k1 (sit (mul k1 c1))
158− =. k1 (rol 0 15 k1)
159− =. k1 (sit (mul k1 c2))
160− (mix h1 k1)
161− $1 =. k1 (mix k1 (snag 0 tail))
162− =. k1 (sit (mul k1 c1))
163− =. k1 (rol 0 15 k1)
164− =. k1 (sit (mul k1 c2))
165− (mix h1 k1)
166− ==
167− =. h1 (mix h1 len)
168− |^ (fmix32 h1)
169− ++ fmix32
170− |= h=@
171− =. h (mix h (rsh 0 16 h))
172− =. h (sit (mul h 0x85eb.ca6b))
173− =. h (mix h (rsh 0 13 h))
174− =. h (sit (mul h 0xc2b2.ae35))
175− =. h (mix h (rsh 0 16 h))
176− h
177− --
97+++ muk :: standard murmur3
98+ ~% %muk ..muk ~
99+ =+ ~(. fe 5)
100+ |= [syd=@ len=@ key=@]
101+ =. syd (end 5 syd)
102+ =/ pad (sub len (met 3 key))
103+ =/ data (weld (rip 3 key) (reap pad 0))
104+ =/ nblocks (div len 4) :: intentionally off-by-one
105+ =/ h1 syd
106+ =+ [c1=0xcc9e.2d51 c2=0x1b87.3593]
107+ =/ blocks (rip 5 key)
108+ =/ i nblocks
109+ =. h1 =/ hi h1 |-
110+ ?: =(0 i) hi
111+ =/ k1 (snag (sub nblocks i) blocks) :: negative array index
112+ =. k1 (sit (mul k1 c1))
113+ =. k1 (rol 0 15 k1)
114+ =. k1 (sit (mul k1 c2))
115+ =. hi (mix hi k1)
116+ =. hi (rol 0 13 hi)
117+ =. hi (sum (sit (mul hi 5)) 0xe654.6b64)
118+ $(i (dec i))
119+ =/ tail (slag (mul 4 nblocks) data)
120+ =/ k1 0
121+ =/ tlen (dis len 3)
122+ =. h1
123+ ?+ tlen h1 :: fallthrough switch
124+ %3 =. k1 (mix k1 (lsh [0 16] (snag 2 tail)))
125+ =. k1 (mix k1 (lsh [0 8] (snag 1 tail)))
126+ =. k1 (mix k1 (snag 0 tail))
127+ =. k1 (sit (mul k1 c1))
128+ =. k1 (rol 0 15 k1)
129+ =. k1 (sit (mul k1 c2))
130+ (mix h1 k1)
131+ %2 =. k1 (mix k1 (lsh [0 8] (snag 1 tail)))
132+ =. k1 (mix k1 (snag 0 tail))
133+ =. k1 (sit (mul k1 c1))
134+ =. k1 (rol 0 15 k1)
135+ =. k1 (sit (mul k1 c2))
136+ (mix h1 k1)
137+ %1 =. k1 (mix k1 (snag 0 tail))
138+ =. k1 (sit (mul k1 c1))
139+ =. k1 (rol 0 15 k1)
140+ =. k1 (sit (mul k1 c2))
141+ (mix h1 k1)
142+ ==
143+ =. h1 (mix h1 len)
144+ |^ (fmix32 h1)
145+ ++ fmix32
146+ |= h=@
147+ =. h (mix h (rsh [0 16] h))
148+ =. h (sit (mul h 0x85eb.ca6b))
149+ =. h (mix h (rsh [0 13] h))
150+ =. h (sit (mul h 0xc2b2.ae35))
151+ =. h (mix h (rsh [0 16] h))
152+ h
153+ --
178154```
179155
180156#### Examples
@@ -209,60 +185,4 @@ An atom.
209185 246.077.549
210186```
211187
212−
213−---
214−### `++mum`
215−
216−31-bit MurmurHash3 scrambler
217−
218−Hashes `a` with the 31-bit MurmurHash3 non-cryptographic hash algorithm,
219−producing an atom.
220−
221−#### Accepts
222−
223−`a` is a noun.
224−
225−#### Produces
226−
227−An atom.
228−
229−#### Source
230−
231−```hoon
232− ++ mum
233− ~/ %mum
234− |= a=*
235− |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
236− ++ trim
237− |= key=@
238− =+ syd=0xcafe.babe
239− |- ^- @
240− =+ haz=(muk syd (met 3 key) key)
241− =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
242− ?.(=(0 ham) ham $(syd +(syd)))
243−```
244−
245−#### Examples
246−
247−```
248− > (mum 10.000)
249− 795.713.195
250−
251− > (mum 10.001)
252− 420.521.697
253−
254− > (mum 'jerry')
255− 1.540.161.753
256−
257− > (mum 1)
258− 1.901.865.568
259−
260− > (mum (some 10))
261− 2.099.076.946
262−
263− > (mum [1 2 3 4 5 ~])
264− 1.719.833.228
265−```
266−
267−
268188---
content/docs/hoon/reference/stdlib/2f.md+163−285
@@ -4,11 +4,11 @@ weight = 9
44template = "doc.html"
55+++
66
7−### `++aor`
7+## `++aor`
88
99Alphabetical order
1010
11−Computes whether `a` and `b` are in alphabetical order, producing a flag.
11+Computes whether `a` and `b` are in alphabetical order, producing a flag. Orders atoms before cells, and atoms in ascending LSB order.
1212
1313#### Accepts
1414
@@ -23,62 +23,85 @@ A flag.
2323#### Source
2424
2525```hoon
26− ++ aor
27− ~/ %aor
28− |= [a=* b=*]
29− ^- ?
30− ?: =(a b) &
31− ?. ?=(@ a)
32− ?: ?=(@ b) |
33− ?: =(-.a -.b)
34− $(a +.a, b +.b)
35− $(a -.a, b -.b)
36− ?. ?=(@ b) &
37− |-
38− =+ [c=(end 3 1 a) d=(end 3 1 b)]
39− ?: =(c d)
40− $(a (rsh 3 1 a), b (rsh 3 1 b))
41− (lth c d)
26+++ aor
27+ ~/ %aor
28+ |= [a=* b=*]
29+ ^- ?
30+ ?: =(a b) &
31+ ?. ?=(@ a)
32+ ?: ?=(@ b) |
33+ ?: =(-.a -.b)
34+ $(a +.a, b +.b)
35+ $(a -.a, b -.b)
36+ ?. ?=(@ b) &
37+ |-
38+ =+ [c=(end 3 a) d=(end 3 b)]
39+ ?: =(c d)
40+ $(a (rsh 3 a), b (rsh 3 b))
41+ (lth c d)
4242```
4343
4444#### Examples
4545
4646```
47− > (aor 'a' 'b')
48− %.y
49−
50− > (aor 'b' 'a')
51− %.n
52−
53− > (aor 'a' 'a')
54− %.y
55−
56− > (aor "foo" "bar")
57− %.n
58−
59− > (aor "bar" "foo")
60− %.y
47+> (aor 'a' 'b')
48+%.y
49+> (aor 'b' 'a')
50+%.n
51+> (aor 'a' 'a')
52+%.y
53+
54+> (aor 1 2)
55+%.y
56+> (aor 2 1)
57+%.n
58+
59+> (aor ['a' ~] 'b')
60+%.n
61+> (aor 'b' ['a' ~])
62+%.y
63+
64+> (aor ['a' ~] ['b' ~])
65+%.y
66+> (aor ['b' ~] ['a' ~])
67+%.n
68+
69+> (aor "abca" "abcz")
70+%.y
71+> (aor "abcz" "abca")
72+%.n
73+
74+> (aor 0b1011 0b1010)
75+%.n
76+> (aor 0b1010 0b1011)
77+%.y
78+
79+> (aor [1 2] [2 1])
80+%.y
81+> (aor [2 1] [1 2])
82+%.n
83+```
6184
62− > (aor "abcdefz" "abcdefa")
63− %.n
85+Note the possible differences with `+dor` due to comparing one byte at a time:
6486
65− > (aor "abcdefa" "abcdefz")
66− %.y
67−
68− > (aor 10.000 17.000)
69− %.y
70−
71− > (aor 10 9)
72− %.n
7387```
88+> (aor 0b1001.0000.0000 0b1000.1000.0000)
89+%.y
90+> (dor 0b1001.0000.0000 0b1000.1000.0000)
91+%.n
92+```
93+
94+#### Discussion
7495
96+This is different than [+dor](#dor) in that it compares atoms one byte at a time, while `+dor` compares whole atoms at once. Note that because it simply compares bytes, it doesn't account for multi-byte UTF-8 characters and the like.
7597
7698---
77−### `++dor`
7899
79−Numeric order
100+## `++dor`
101+
102+Depth order
80103
81−Computes whether `a` and `b` are in ascending numeric order, producing a flag.
104+Computes whether `a` and `b` are in ascending tree depth order, producing a flag. Orders atoms before cells, and atoms in ascending numerical order.
82105
83106#### Accepts
84107
@@ -93,62 +116,71 @@ A flag.
93116#### Source
94117
95118```hoon
96− ++ dor
97− ~/ %dor
98− |= [a=* b=*]
99− ^- ?
100− ?: =(a b) &
101− ?. ?=(@ a)
102− ?: ?=(@ b) |
103− ?: =(-.a -.b)
104− $(a +.a, b +.b)
105− $(a -.a, b -.b)
106− ?. ?=(@ b) &
107− (lth a b)
119+++ dor
120+ ~/ %dor
121+ |= [a=* b=*]
122+ ^- ?
123+ ?: =(a b) &
124+ ?. ?=(@ a)
125+ ?: ?=(@ b) |
126+ ?: =(-.a -.b)
127+ $(a +.a, b +.b)
128+ $(a -.a, b -.b)
129+ ?. ?=(@ b) &
130+ (lth a b)
108131```
109132
110133#### Examples
111134
112135```
113− > (dor 1 2)
114− %.y
136+> (dor 1 2)
137+%.y
115138
116− > (dor 2 1)
117− %.n
139+> (dor 2 1)
140+%.n
118141
119− > (dor ~[1 2 3] ~[1 2 4])
120− %.y
142+> (dor ~[1 2 3] ~[1 2 4])
143+%.y
121144
122− > (dor ~[1 2 4] ~[1 2 3])
123− %.n
145+> (dor ~[1 2 4] ~[1 2 3])
146+%.n
124147
125− > (dor `(list @)`~[99 100 10.000] ~[99 101 10.000])
126− %.y
148+> (dor `(list @)`~[99 100 10.000] ~[99 101 10.000])
149+%.y
127150
128− > (dor ~[99 101 10.999] `(list @)`~[99 100 10.000])
129− %.n
151+> (dor ~[99 101 10.999] `(list @)`~[99 100 10.000])
152+%.n
153+```
154+
155+Note the possible difference with [+aor](#aor) due to comparing whole atoms rather than one byte at a time:
156+
157+```
158+> (aor 0b1001.0000.0000 0b1000.1000.0000)
159+%.y
160+> (dor 0b1001.0000.0000 0b1000.1000.0000)
161+%.n
130162```
131163
132164#### Discussion
133165
134−If `a` and `b` are both atoms, `dor` is equivalent to [`lte`](/docs/hoon/reference/stdlib/1a). If they're
166+If `a` and `b` are both atoms, `dor` is equivalent to [`lte`](/docs/hoon/reference/stdlib/1a#lte). If they're
135167cells, `dor` recurses on the heads, and then if the heads are the same it checks
136168the tails.
137169
138170If one sample is a cell and the other is an atom, the cell sample is treated as
139171"greater."
140172
141−
142173---
143−### `++gor`
144174
145−Hash order
175+## `++gor`
176+
177+Mug order
146178
147179Computes whether of `(mug a)` and `(mug b)` are in ascending numeric order,
148180producing a flag. If the `mug` hashes are equal, `a` and `b` are compared by
149181`dor` instead.
150182
151−[`mug`](/docs/hoon/reference/stdlib/2e) is the the 31-bit nonzero FNV-1a hash algorithm.
183+[`mug`](/docs/hoon/reference/stdlib/2e#mug) is the the 31-bit nonzero FNV-1a hash algorithm.
152184
153185#### Accepts
154186
@@ -163,223 +195,70 @@ A flag.
163195#### Source
164196
165197```hoon
166− ++ gor
167− ~/ %gor
168− |= [a=* b=*]
169− ^- ?
170− =+ [c=(mug a) d=(mug b)]
171− ?: =(c d)
172− (dor a b)
173− (lth c d)
198+++ gor
199+ ~/ %gor
200+ |= [a=* b=*]
201+ ^- ?
202+ =+ [c=(mug a) d=(mug b)]
203+ ?: =(c d)
204+ (dor a b)
205+ (lth c d)
174206```
175207
176208#### Examples
177209
178210```
179− > (gor 'd' 'c')
180− %.y
181−
182− > 'd'
183− 'd'
184−
185− > 'c'
186− 'c'
187−
188− > `@ud`'d'
189− 100
190−
191− > `@ud`'c'
192− 99
193−
194− > (mug 'd')
195− 1.628.185.714
196−
197− > (mug 'c')
198− 1.712.073.811
199−
200− > (gor 'd' 'c')
201− %.y
202−
203− > (gor 'c' 'd')
204− %.n
205−
206− > (gor "foo" "bar")
207− %.n
208−
209− > (gor (some 10) `(list @)`[1 2 3 ~])
210− %.n
211−```
212−
213−#### Discussion
214−
215−`map`s use `gor` on the key for horizontal ordering and `vor` for
216−vertical order. `map`s only look at the keys (the head of the key-value pair
217−elements) for ordering.
218−
219−---
220−### `++hor`
221−
222−Horizontal hash order
223−
224−If `a` and `b` are atoms, they are computed as samples of `gor`, producing a
225−flag.
226−
227−If `a` and `b` are cells, `hor` checks to see if their heads are equal. If their
228−heads are equal, `gor` is computed on their tails, producing a flag. If their
229−heads are not equal, `gor` is computed on their heads, producing a flag.
230−
231−If `a` is an atom and `b` is not, then `%.y` is produced. If `b` is an atom and
232−`a` is not, `%.n` is produced.
233−
234−#### Accepts
235−
236−`a` is a noun.
237−
238−`b` is a noun.
239−
240−#### Produces
241−
242−A flag.
243−
244−#### Source
245−
246−```hoon
247− ++ hor
248− ~/ %hor
249− |= [a=* b=*]
250− ^- ?
251− ?: ?=(@ a)
252− ?. ?=(@ b) &
253− (gor a b)
254− ?: ?=(@ b) |
255− ?: =(-.a -.b)
256− (gor +.a +.b)
257− (gor -.a -.b)
258−```
259−
260−#### Examples
261−
211+> (gor 'd' 'c')
212+%.y
213+
214+> 'd'
215+'d'
216+> 'c'
217+'c'
218+
219+> `@ud`'d'
220+100
221+> `@ud`'c'
222+99
223+
224+> (mug 'd')
225+1.628.185.714
226+> (mug 'c')
227+1.712.073.811
228+
229+> (gor 'd' 'c')
230+%.y
231+> (gor 'c' 'd')
232+%.n
262233```
263− > (hor . 1)
264− %.n
265−
266− > (hor 1 2)
267− %.y
268−
269− > (hor "abc" "cba")
270− %.y
271−
272− > (hor 'c' 'd')
273− %.n
274−
275− > (hor 100 [1 1])
276− %.y
277−
278− > (hor [1 1] 100)
279− %.n
280−
281− > (hor 500.000.000 "foo")
282− %.y
283−
284− > (hor "foo" 500.000.000)
285− %.n
286−
287− > (hor 0 "foo")
288− %.y
289234
290− > (gor `(list @)`[0 ~] 1)
291− %.n
292−
293− > (hor `(list @)`[50 500 5.000 ~] 1)
294− %.n
295235```
296−
297−#### Discussion
298−
299−Sets (+set, +in) use `hor` for their horizontal order and `vor` for their
300−vertical order. See [`apt:in`](/docs/hoon/reference/stdlib/2h) to see how a set verifies its correctness.
301−`vor` is used to verify.
302−
303−---
304−### `++lor`
305−
306−Leg order
307−
308−Computes whether the corresponding legs of `a` and `b` are in ascending
309−numeric order, producing a flag.
310−
311−#### Accepts
312−
313−`a` is a noun.
314−
315−`b` is a noun.
316−
317−#### Accepts
318−
319−A flag.
320−
321−#### Source
322−
323−```hoon
324− ++ lor
325− ~/ %lor
326− |= [a=* b=*]
327− ^- ?
328− ?: =(a b) &
329− ?@ a
330− ?^ b &
331− (lth a b)
332− ?: =(-.a -.b)
333− $(a +.a, b +.b)
334− $(a -.a, b -.b)
236+> (gor "foo" "bar")
237+%.n
335238```
336239
337−#### Examples
338−
339240```
340− > (lor 1 2)
341− %.y
342−
343− > (lor 2 1)
344− %.n
345−
346− > (lor 9 [1 2])
347− %.y
348−
349− > (lor `(list @)`[1 2 3 ~] `(list @)`[1 2 3 4 ~])
350− %.y
351−
352− > (lor `(list @)`[1 2 3 ~] `(list @)`[1 2 2 ~])
353− %.n
354−
355− > (lor `(list @)`[1 2 3 ~] `(list @)`[2 2 ~])
356− %.y
357−
358− > (lor [2 2 5] [1 5 9 8])
359− %.n
360−
361− > (lor [1 5 8] [1 5 9 8])
362− %.y
363−
364− > (lor [1 2 3] [1 2])
365− !! exit
241+> (gor (some 10) `(list @)`[1 2 3 ~])
242+%.n
366243```
367244
368245#### Discussion
369246
370−`lor` is no longer used internally.
247+`map`s use `gor` on the key for horizontal ordering and `mor` for
248+vertical order. `map`s only look at the keys (the head of the key-value pair
249+elements) for ordering.
371250
372251---
373−### `++vor`
374252
375−Vertical order
253+## `++mor`
254+
255+(more) mug order
376256
377257Computes whether the double-hashes `(mug (mug a))` and `(mug (mug b))` are in
378258ascending numeric order, producing a flag. If the double-`mug` hashes are
379259equal, `a` and `b` are compared by `dor` instead.
380260
381−[`mug`](/docs/hoon/reference/stdlib/2e) is the the 31-bit nonzero FNV-1a hash algorithm.
382−
261+[`mug`](/docs/hoon/reference/stdlib/2e#mug) is the the 31-bit nonzero FNV-1a hash algorithm.
383262
384263#### Accepts
385264
@@ -394,20 +273,20 @@ A flag.
394273#### Source
395274
396275```hoon
397− ++ vor
398− ~/ %vor
399− |= [a=* b=*]
400− ^- ?
401− =+ [c=(mug (mug a)) d=(mug (mug b))]
402− ?: =(c d)
403− (dor a b)
404− (lth c d)
276+++ mor
277+ ~/ %mor
278+ |= [a=* b=*]
279+ ^- ?
280+ =+ [c=(mug (mug a)) d=(mug (mug b))]
281+ ?: =(c d)
282+ (dor a b)
283+ (lth c d)
405284```
406285
407286#### Examples
408287
409288```
410− > (vor 'f' 'g')
289+ > (mor 'f' 'g')
411290 %.y
412291
413292 > [(mug 'f') (mug 'g')]
@@ -416,22 +295,21 @@ A flag.
416295 > [(mug (mug 'f')) (mug (mug 'g'))]
417296 [261.421.509 1.861.258.547]
418297
419− > (vor 'a' 'z')
298+ > (mor 'a' 'z')
420299 %.n
421300
422− > (vor 43.326 41.106)
301+ > (mor 43.326 41.106)
423302 %.n
424303```
425304
426305#### Discussion
427306
428−Maps, sets, and queues all use `vor` to check for vertical ordering. Maps and
429−sets also use `gor` and `hor` for horizontal order, respectively, but queues use
307+Maps, sets, and queues all use `mor` to check for vertical ordering. Maps and
308+sets also use `gor` for horizontal order, but queues use
430309vertical ordering alone.
431310
432−Since hashing removes correlation, double-`mug`ging with `vor` removes
433−correlation with single-`mug`ged `hor`. Vertical order becomes uncorrelated
311+Since hashing removes correlation, double-`mug`ging with `mor` removes
312+correlation with single-`mug`ged `gor`. Vertical order becomes uncorrelated
434313with horizontal order.
435314
436−
437−---
315+---
content/docs/hoon/reference/stdlib/2g.md+26−26
@@ -4,7 +4,7 @@ weight = 10
44template = "doc.html"
55+++
66
7−### `++pow`
7+## `++pow`
88
99Computes `a` raised to the power of `b`, producing an atom.
1010
@@ -21,14 +21,14 @@ An atom.
2121#### Source
2222
2323```hoon
24− ++ pow
25− ~/ %pow
26− |= [a=@ b=@]
27− ?: =(b 0) 1
28− |- ?: =(b 1) a
29− =+ c=$(b (div b 2))
30− =+ d=(mul c c)
31− ?~ (dis b 1) d (mul d a)
24+++ pow
25+ ~/ %pow
26+ |= [a=@ b=@]
27+ ?: =(b 0) 1
28+ |- ?: =(b 1) a
29+ =+ c=$(b (div b 2))
30+ =+ d=(mul c c)
31+ ?~ (dis b 1) d (mul d a)
3232```
3333
3434#### Examples
@@ -51,7 +51,8 @@ An atom.
5151```
5252
5353---
54−### `++sqt`
54+
55+## `++sqt`
5556
5657Computes the square root of `a` and its remainder.
5758
@@ -66,20 +67,20 @@ A cell of atoms.
6667#### Source
6768
6869```hoon
69− ++ sqt
70− ~/ %sqt
71− |= a=@ ^- [p=@ q=@]
72− ?~ a [0 0]
73− =+ [q=(div (dec (xeb a)) 2) r=0]
74− =- [-.b (sub a +.b)]
75− ^= b |-
76− =+ s=(add r (bex q))
77− =+ t=(mul s s)
78− ?: =(q 0)
79− ?:((lte t a) [s t] [r (mul r r)])
80− ?: (lte t a)
81− $(r s, q (dec q))
82− $(q (dec q))
70+++ sqt
71+ ~/ %sqt
72+ |= a=@ ^- [p=@ q=@]
73+ ?~ a [0 0]
74+ =+ [q=(div (dec (xeb a)) 2) r=0]
75+ =- [-.b (sub a +.b)]
76+ ^= b |-
77+ =+ s=(add r (bex q))
78+ =+ t=(mul s s)
79+ ?: =(q 0)
80+ ?:((lte t a) [s t] [r (mul r r)])
81+ ?: (lte t a)
82+ $(r s, q (dec q))
83+ $(q (dec q))
8384```
8485
8586#### Examples
@@ -101,5 +102,4 @@ A cell of atoms.
101102 ! exit
102103```
103104
104−
105−---
105+---
content/docs/hoon/reference/stdlib/2h.md+345−345
@@ -4,7 +4,7 @@ weight = 11
44template = "doc.html"
55+++
66
7−### `++in`
7+## `++in`
88
99Set operations
1010
@@ -18,16 +18,16 @@ A `set`.
1818#### Source
1919
2020```hoon
21− ++ in
22− ~/ %in
23− |_ a=(set)
21+ ~/ %in
22+ =| a=(tree)
23+ |@
2424```
2525
2626#### Examples
2727
2828```
29− > ~(. in (sy "asd"))
30− <13.evb [nlr(^$1{@tD $1}) <414.fvk 101.jzo 1.ypj %164>]>
29+> ~(. in (sy "asd"))
30+<16.ufw [a=?(%~ [?(n=@tD n=#1) l=nlr(?(@tD #1)) r=nlr(?(@tD ^#1.?(@tD #1)))]) <123.zao 46.hgz 1.pnw %140>]>
3131```
3232
3333### `++all:in`
@@ -39,9 +39,9 @@ flag.
3939
4040#### Accepts
4141
42−`a` is a `set`.
42+`a` is a `set`, and is the sample of `+in`.
4343
44−`b` is a wet gate that accepts a noun and produces a flag.
44+`b` is a gate that accepts a noun and produces a flag.
4545
4646#### Produces
4747
@@ -50,28 +50,27 @@ A flag.
5050#### Source
5151
5252```hoon
53− ++ all :: logical AND
54− ~/ %all
55− |* b=$-(* ?)
56− |- ^- ?
57− ?~ a
58− &
59− ?&((b n.a) $(a l.a) $(a r.a))
53+++ all
54+ ~/ %all
55+ |* b=$-(* ?)
56+ |- ^- ?
57+ ?~ a
58+ &
59+ ?&((b n.a) $(a l.a) $(a r.a))
6060```
6161
6262#### Examples
6363
6464```
65− > =b (sy `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
66− > (~(all in b) |=(a=* ?@(+.a & |)))
67− %.n
65+> (~(all in (silt ~[1 2 3 4])) |=(a=@ (lth a 5)))
66+%.y
6867
69− > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
70− > (~(all in b) |=(a=@t (gte a 100)))
71− %.y
68+> (~(all in (silt ~[1 2 3 4 5])) |=(a=@ (lth a 5)))
69+%.n
7270```
7371
7472---
73+
7574### `++any:in`
7675
7776Logical OR
@@ -81,7 +80,7 @@ flag.
8180
8281#### Accepts
8382
84−`a` is a `set`.
83+`a` is a `set`, and is the sample of `+in`.
8584
8685`b` is a gate that accepts a noun and produces a flag.
8786
@@ -92,28 +91,27 @@ A flag.
9291#### Source
9392
9493```hoon
95− ++ any :: logical OR
96− ~/ %any
97− |* b=$-(* ?)
98− |- ^- ?
99− ?~ a
100− |
101− ?|((b n.a) $(a l.a) $(a r.a))
94+++ any
95+ ~/ %any
96+ |* b=$-(* ?)
97+ |- ^- ?
98+ ?~ a
99+ |
100+ ?|((b n.a) $(a l.a) $(a r.a))
102101```
103102
104103#### Examples
105104
106105```
107− > =b (sy `(list [@t *])`[['a' 1] ['b' [2 3]] ~])
108− > (~(any in b) |=(a/* ?@(+.a & |)))
109− %.y
106+> (~(any in (silt ~[2 3 4 5])) |=(a=@ (lth a 3)))
107+%.y
110108
111− > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
112− > (~(any in b) |=(a=@t (lte a 100)))
113− %.n
109+> (~(any in (silt ~[3 4 5])) |=(a=@ (lth a 3)))
110+%.n
114111```
115112
116113---
114+
117115### `++apt:in`
118116
119117Check correctness
@@ -132,36 +130,38 @@ A flag.
132130#### Source
133131
134132```hoon
135− ++ apt :: check correctness
136− =< $
137− ~/ %apt
138− =| [l=(unit) r=(unit)]
139− |. ^- ?
140− ?~ a &
141− ?& ?~(l & (gor n.a u.l))
142− ?~(r & (gor u.r n.a))
143− ?~(l.a & ?&((mor n.a n.l.a) $(a l.a, l `n.a)))
144− ?~(r.a & ?&((mor n.a n.r.a) $(a r.a, r `n.a)))
145− ==
133+++ apt
134+ =< $
135+ ~/ %apt
136+ =| [l=(unit) r=(unit)]
137+ |. ^- ?
138+ ?~ a &
139+ ?& ?~(l & (gor n.a u.l))
140+ ?~(r & (gor u.r n.a))
141+ ?~(l.a & ?&((mor n.a n.l.a) $(a l.a, l `n.a)))
142+ ?~(r.a & ?&((mor n.a n.r.a) $(a r.a, r `n.a)))
143+ ==
146144```
147145
148146#### Examples
149147
150148```
151− > ~(apt in ~)
152− %.y
149+> ~(apt in ~)
150+%.y
151+```
153152
154− > =a (sy [1 2 3 4 5 6 ~])
155− > a
156− [n=6 l={5 4} r={1 3 2}]
157− > ~(apt in a)
158− %.y
153+```
154+> =a (silt ~[1 2 3])
155+> a
156+[n=2 l={1} r={3}]
157+> ~(apt in a)
158+%.y
159159
160− > =z ?~ a ~ a(n 7)
161− > z
162− [n=7 l={5 4} r={1 3 2}]
163− > ~(apt in z)
164− %.n
160+> =z ?~(a ~ a(n 10))
161+> z
162+[n=10 l={1} r={3}]
163+> ~(apt in z)
164+%.n
165165```
166166
167167#### Discussion
@@ -169,15 +169,16 @@ A flag.
169169See section [`2f`](/docs/hoon/reference/stdlib/2f) for more information on noun ordering.
170170
171171---
172+
172173### `++bif:in`
173174
174175Bifurcate
175176
176−Splits set `a` into two sets `l` and `r`, with any noun `b` removed.
177+Splits set `a` into sets `l` and `r`, which contain the items either side of `b` but not including `b`.
177178
178179#### Accepts
179180
180−`a` is a set.
181+`a` is a set, and is the sample of `+in`.
181182
182183`b` is a noun.
183184
@@ -188,40 +189,45 @@ A cell of two sets.
188189#### Source
189190
190191```hoon
191− ++ bif :: splits a by b
192− ~/ %bif
193− |* b=*
194− ^+ [l=a r=a]
195− =< +
196− |- ^+ a
197− ?~ a
198− [b ~ ~]
199− ?: =(b n.a)
200− a
201− ?: (gor b n.a)
202− =+ c=$(a l.a)
203− ?> ?=(^ c)
204− c(r a(l r.c))
205− =+ c=$(a r.a)
192+++ bif
193+ ~/ %bif
194+ |* b=*
195+ ^+ [l=a r=a]
196+ =< +
197+ |- ^+ a
198+ ?~ a
199+ [b ~ ~]
200+ ?: =(b n.a)
201+ a
202+ ?: (gor b n.a)
203+ =+ c=$(a l.a)
206204 ?> ?=(^ c)
207− c(l a(r l.c))
205+ c(r a(l r.c))
206+ =+ c=$(a r.a)
207+ ?> ?=(^ c)
208+ c(l a(r l.c))
208209```
209210
210211#### Examples
211212
212213```
213− > =a (sy `(list @)`[1 2 3 4 5 6 ~])
214− > a
215− [n=6 l={5 4} r={1 3 2}]
214+> =a `(set @)`(silt (gulf 1 20))
215+> a
216+{17 8 20 13 11 5 19 7 15 10 18 14 6 12 9 1 2 3 16 4}
216217
217− > (~(bif in a) 6)
218− [l=[n=4 l=[n=5 l={} r={}] r=~] r=[n=2 l=[n=1 l={} r={3}] r=~]]
218+> (~(bif in a) 10)
219+[l=[n=11 l={17 8 20 13} r={5 19 7 15}] r=[n=12 l={18 14 6} r={9 1 2 3 16 4}]]
219220
220− > (~(bif in a) 100)
221− [l=[n=6 l=[n=4 l={5} r={}] r=[n=2 l={1 3} r={}]] r=~]
221+> `[(set @) (set @)]`(~(bif in a) 10)
222+[{17 8 20 13 11 5 19 7 15} {18 14 6 12 9 1 2 3 16 4}]
222223```
223224
225+#### Discussion
226+
227+Note that `set`s are horizontally ordered by the [mug](/docs/hoon/reference/stdlib/2e#mug) hash of their items and vertically ordered by the double-`mug` hash of their items. This means bifurcating the set of numbers `(silt ~[10 20 30 40 50])` at `30` will not produce `[{10 20} {40 50}]`, but rather `[{20} {10 40 50}]` due to the tree structure resulting from their `mug` hashes.
228+
224229---
230+
225231### `++del:in`
226232
227233Remove noun
@@ -230,7 +236,7 @@ Removes `b` from the `set` `a`.
230236
231237#### Accepts
232238
233−`a` is a set.
239+`a` is a set, and is the sample of `+in`.
234240
235241`b` is a noun.
236242
@@ -241,41 +247,48 @@ A set.
241247#### Source
242248
243249```hoon
244− ++ del :: b without any a
245− ~/ %del
246− |* b=*
247− |- ^+ a
248− ?~ a
249− ~
250− ?. =(b n.a)
251− ?: (gor b n.a)
252− a(l $(a l.a))
253− a(r $(a r.a))
254− |- ^- [$?(~ _a)]
255− ?~ l.a r.a
256− ?~ r.a l.a
257− ?: (mor n.l.a n.r.a)
258− l.a(r $(l.a r.l.a))
259− r.a(l $(r.a l.r.a))
250+++ del
251+ ~/ %del
252+ |* b=*
253+ |- ^+ a
254+ ?~ a
255+ ~
256+ ?. =(b n.a)
257+ ?: (gor b n.a)
258+ a(l $(a l.a))
259+ a(r $(a r.a))
260+ |- ^- [$?(~ _a)]
261+ ?~ l.a r.a
262+ ?~ r.a l.a
263+ ?: (mor n.l.a n.r.a)
264+ l.a(r $(l.a r.l.a))
265+ r.a(l $(r.a l.r.a))
260266```
261267
262−
263268#### Examples
264269
265270```
266− > =b (sy `(list @t)`['a' 'b' 'c' ~])
267− > (~(del in b) 'a')
268− [n='b' l=[n='c' l={} r={}] r=~]
271+> `(set @)`(~(del in (silt ~[1 2 3 4 5])) 3)
272+{5 1 2 4}
273+```
269274
270− > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
271− > (~(del in b) 'john')
272− [n='madeleine' l=[n='daniel' l={} r={'bonita'}] r=~]
275+```
276+> `(set @t)`(~(del in (silt ~['foo' 'bar' 'baz'])) 'bar')
277+{'baz' 'foo'}
278+```
273279
274− > (~(del in b) 'susan')
275− [n='madeleine' l=[n='daniel' l={} r={'bonita'}] r=[n='john' l={} r={}]]
280+```
281+> `(set @)`(~(del in (silt ~[1 2 3 4 5])) 10)
282+{5 1 2 3 4}
283+```
284+
285+```
286+> `(set @)`(~(del in ~) 10)
287+{}
276288```
277289
278290---
291+
279292### `++dif:in`
280293
281294Difference
@@ -285,7 +298,7 @@ that are not in `b`.
285298
286299#### Accepts
287300
288−`a` is a set.
301+`a` is a set, and is the sample of `+in`.
289302
290303`b` is a set.
291304
@@ -296,46 +309,39 @@ A set.
296309#### Source
297310
298311```hoon
299− ++ dif :: difference
300− ~/ %dif
301− =+ b=a
302− |@
303− ++ $
304− |- ^+ a
305− ?~ b
306− a
307− =+ c=(bif n.b)
308− ?> ?=(^ c)
309− =+ d=$(a l.c, b l.b)
310− =+ e=$(a r.c, b r.b)
311− |- ^- [$?(~ _a)]
312− ?~ d e
313− ?~ e d
314− ?: (mor n.d n.e)
315− d(r $(d r.d))
316− e(l $(e l.e))
317− --
312+++ dif
313+ ~/ %dif
314+ =+ b=a
315+ |@
316+ ++ $
317+ |- ^+ a
318+ ?~ b
319+ a
320+ =+ c=(bif n.b)
321+ ?> ?=(^ c)
322+ =+ d=$(a l.c, b l.b)
323+ =+ e=$(a r.c, b r.b)
324+ |- ^- [$?(~ _a)]
325+ ?~ d e
326+ ?~ e d
327+ ?: (mor n.d n.e)
328+ d(r $(d r.d))
329+ e(l $(e l.e))
330+ --
318331```
319332
320333#### Examples
321334
322335```
323− > =c (sy 1 2 3 ~)
324− > =d (sy 2 3 4 ~)
325− > (~(dif in c) d)
326− [n=1 l=~ r=~]
336+> =a (silt ~[1 2 3 4 5])
337+> =b (silt ~[3 4])
327338
328− > (~(dif in d) c)
329− [n=4 l=~ r=~]
330−
331− > `(set @ud)`(~(dif in c) d)
332− {1}
333−
334− > `(set @ud)`(~(dif in d) c)
335− {4}
339+> `(set @)`(~(dif in a) b)
340+{5 1 2}
336341```
337342
338343---
344+
339345### `++dig:in`
340346
341347Address b in a
@@ -344,7 +350,7 @@ Produce the tree address of `b` within `a`.
344350
345351#### Accepts
346352
347−`a` is a set.
353+`a` is a set, and is the sample of `+in`.
348354
349355`b` is a noun.
350356
@@ -355,36 +361,36 @@ The `unit` of an atom.
355361#### Source
356362
357363```hoon
358− ++ dig :: axis of a in b
359− |= b=*
360− =+ c=1
361− |- ^- (unit @)
362− ?~ a ~
363− ?: =(b n.a) [~ u=(peg c 2)]
364− ?: (gor b n.a)
365− $(a l.a, c (peg c 6))
366− $(a r.a, c (peg c 7))
364+++ dig
365+ |= b=*
366+ =+ c=1
367+ |- ^- (unit @)
368+ ?~ a ~
369+ ?: =(b n.a) [~ u=(peg c 2)]
370+ ?: (gor b n.a)
371+ $(a l.a, c (peg c 6))
372+ $(a r.a, c (peg c 7))
367373```
368374
369−
370375#### Examples
371376
372377```
373− > =a (sy `(list @)`[1 2 3 4 5 6 7 ~])
374− > `(set @)`a
375− {5 4 7 6 1 3 2}
378+> =a (silt ~[1 2 3 4 5 6 7])
376379
377− > -.a
378− n=6
380+> -.a
381+n=6
379382
380− > (~(dig in a) 7)
381− [~ u=12]
383+> (~(dig in a) 7)
384+[~ 12]
382385
383− > (~(dig in a) 2)
384− [~ u=14]
386+> (~(dig in a) 2)
387+[~ 60]
385388
386− > (~(dig in a) 6)
387− [~ u=2]
389+> (~(dig in a) 6)
390+[~ 2]
391+
392+> (~(dig in a) 10)
393+~
388394```
389395
390396#### Discussion
@@ -392,6 +398,7 @@ The `unit` of an atom.
392398For more on the tree addressing system, see section [1b](/docs/hoon/reference/stdlib/1b).
393399
394400---
401+
395402### `++gas:in`
396403
397404Concatenate
@@ -400,7 +407,7 @@ Insert the elements of a `list` `b` into a `set` `a`.
400407
401408#### Accepts
402409
403−`a` is a set.
410+`a` is a set, and is the sample of `+in`.
404411
405412`b` is a list.
406413
@@ -411,31 +418,31 @@ A `set`.
411418#### Source
412419
413420```hoon
414− ++ gas :: concatenate
415− ~/ %gas
416− |= b=(list _?>(?=(^ a) n.a))
417− |- ^+ a
418− ?~ b
419− a
420− $(b t.b, a (put i.b))
421+++ gas
422+ ~/ %gas
423+ |= b=(list _?>(?=(^ a) n.a))
424+ |- ^+ a
425+ ?~ b
426+ a
427+ $(b t.b, a (put i.b))
421428```
422429
423430#### Examples
424431
425432```
426− > =b `(set @t)`(sy `(list @t)`['bonita' 'madeleine' 'rudolf' 'john' ~])
427− > b
428− {'bonita' 'madeleine' 'rudolf' 'john'}
433+> =a (silt ~['foo' 'bar' 'baz'])
434+> `(set @t)`a
435+{'bar' 'baz' 'foo'}
429436
430− > (~(gas in b) `(list @t)`['14' 'things' 'number' '1.337' ~])
431− [n='number' l={'1.337' '14'} r={'things' 'bonita' 'madeleine' 'rudolf' 'john'}]
437+> `(set @t)`(~(gas in a) ~['foo' 'foo' 'foo' 'foo'])
438+{'bar' 'baz' 'foo'}
432439
433− > =s (sy `(list @t)`['a' 'b' 'c' 'd' 'e' ~])
434− > (~(gas in s) `(list @t)`['1' '2' '3' ~])
435− [n='e' l=[n='1' l={} r={'3' '2'}] r=[n='b' l={'d' 'a' 'c'} r={}]]
440+> `(set @t)`(~(gas in a) ~['abc' 'xyz' '123'])
441+{'xyz' 'bar' 'baz' 'foo' 'abc' '123'}
436442```
437443
438444---
445+
439446### `++has:in`
440447
441448b in a?
@@ -444,7 +451,7 @@ Checks if `b` is an element of `a`, producing a flag.
444451
445452#### Accepts
446453
447−`a` is a set.
454+`a` is a set, and is the sample of `+in`.
448455
449456`b` is a noun.
450457
@@ -455,46 +462,37 @@ A flag.
455462#### Source
456463
457464```hoon
458− ++ has
459− ~/ %has
460− |* b=*
461− ^- ?
462− :: wrap extracted item type in a unit because bunting fails
463− ::
464− :: If we used the real item type of _?^(a n.a !!) as the sample type,
465− :: then hoon would bunt it to create the default sample for the gate.
466− ::
467− :: However, bunting that expression fails if :a is ~. If we wrap it
468− :: in a unit, the bunted unit doesn't include the bunted item type.
469− ::
470− :: This way we can ensure type safety of :b without needing to perform
471− :: this failing bunt. It's a hack.
472− ::
473− %. [~ b]
474− |= b=(unit _?>(?=(^ a) n.a))
475− => .(b ?>(?=(^ b) u.b))
476− |- ^- ?
477− ?~ a
478− |
479− ?: =(b n.a)
480− &
481− ?: (gor b n.a)
482− $(a l.a)
483− $(a r.a)
465+++ has
466+ ~/ %has
467+ |* b=*
468+ ^- ?
469+ %. [~ b]
470+ |= b=(unit _?>(?=(^ a) n.a))
471+ => .(b ?>(?=(^ b) u.b))
472+ |- ^- ?
473+ ?~ a
474+ |
475+ ?: =(b n.a)
476+ &
477+ ?: (gor b n.a)
478+ $(a l.a)
479+ $(a r.a)
484480```
485481
486482#### Examples
487483
488484```
489− > =a (~(gas in `(set @t)`~) `(list @t)`['a' 'b' 'c' ~])
490− > (~(has in a) 'a')
491− %.y
485+> =a (silt ~[1 2 3 4 5])
492486
493− > (~(has in a) 'z')
494− %.n
487+> (~(has in a) 2)
488+%.y
489+
490+> (~(has in a) 6)
491+%.n
495492```
496493
497494---
495+
498496### `++int:in`
499497
500498Intersection
@@ -504,7 +502,7 @@ Produces a set of the intersection between two sets of the same type,
504502
505503#### Accepts
506504
507−`a` is a set.
505+`a` is a set, and is the sample of `+in`.
508506
509507`b` is a set.
510508
@@ -515,41 +513,41 @@ A `set`.
515513#### Source
516514
517515```hoon
518− ++ int :: intersection
519− ~/ %int
520− =+ b=a
521− |@
522− ++ $
523− |- ^+ a
524− ?~ b
525− ~
526− ?~ a
527− ~
528− ?. (mor n.a n.b)
529− $(a b, b a)
530− ?: =(n.b n.a)
531− a(l $(a l.a, b l.b), r $(a r.a, b r.b))
532− ?: (gor n.b n.a)
533− %- uni(a $(a l.a, r.b ~)) $(b r.b)
534− %- uni(a $(a r.a, l.b ~)) $(b l.b)
535− --
516+++ int
517+ ~/ %int
518+ =+ b=a
519+ |@
520+ ++ $
521+ |- ^+ a
522+ ?~ b
523+ ~
524+ ?~ a
525+ ~
526+ ?. (mor n.a n.b)
527+ $(a b, b a)
528+ ?: =(n.b n.a)
529+ a(l $(a l.a, b l.b), r $(a r.a, b r.b))
530+ ?: (gor n.b n.a)
531+ %- uni(a $(a l.a, r.b ~)) $(b r.b)
532+ %- uni(a $(a r.a, l.b ~)) $(b l.b)
533+ --
536534```
537535
538−
539536#### Examples
540537
541538```
542− > (~(int in `(set @t)`(sy "acmo")) `(set @t)`(sy "ham"))
543− [n='m' l={'a'} r={}]
539+> `(set @tD)`(~(int in (silt "foobar")) (silt "bar"))
540+{'r' 'b' 'a'}
544541
545− > (~(int in (sy "acmo")) ~)
546− ~
542+> `(set @tD)`(~(int in (silt "foobar")) ~)
543+{}
547544
548− > (~(int in `(set @t)`(sy "ac")) `(set @t)`(sy "ha"))
549− [n='a' l={} r={}]
545+> `(set @tD)`(~(int in (silt "foobar")) (silt "baz"))
546+{'b' 'a'}
550547```
551548
552549---
550+
553551### `++put:in`
554552
555553Put b in a
@@ -558,7 +556,7 @@ Add an element `b` to the set `a`, producing a set.
558556
559557#### Accepts
560558
561−`a` is a set.
559+`a` is a set, and is the sample of `+in`.
562560
563561`b` is a noun.
564562
@@ -569,49 +567,48 @@ A `set`.
569567#### Source
570568
571569```hoon
572− ++ put :: puts b in a, sorted
573− ~/ %put
574− |* b=*
575− |- ^+ a
576− ?~ a
577− [b ~ ~]
578− ?: =(b n.a)
579− a
580− ?: (gor b n.a)
581− =+ c=$(a l.a)
582− ?> ?=(^ c)
583− ?: (mor n.a n.c)
584− a(l c)
585− c(r a(l r.c))
586− =+ c=$(a r.a)
570+++ put
571+ ~/ %put
572+ |* b=*
573+ |- ^+ a
574+ ?~ a
575+ [b ~ ~]
576+ ?: =(b n.a)
577+ a
578+ ?: (gor b n.a)
579+ =+ c=$(a l.a)
587580 ?> ?=(^ c)
588581 ?: (mor n.a n.c)
589− a(r c)
590− c(l a(r l.c))
582+ a(l c)
583+ c(r a(l r.c))
584+ =+ c=$(a r.a)
585+ ?> ?=(^ c)
586+ ?: (mor n.a n.c)
587+ a(r c)
588+ c(l a(r l.c))
591589```
592590
593591#### Examples
594592
595593```
596− > =a (~(gas in `(set @t)`~) `(list @t)`['a' 'b' 'c' ~])
597− > =b (~(put in a) 'd')
598− > `(set @t)`b
599− {'d' 'a' 'c' 'b'}
594+> `(set @)`(~(put in (silt ~[1 2 3])) 4)
595+{1 2 3 4}
600596
601− > -.l.+.b
602− n='d'
597+> `(set @)`(~(put in `(set @)`~) 42)
598+{42}
603599```
604600
605601---
602+
606603### `++rep:in`
607604
608605Accumulate
609606
610−Accumulate the elements of `a` using a gate `b`.
607+Accumulate the elements of `a` using binary gate `b`.
611608
612609#### Accepts
613610
614−`a` is a `set`.
611+`a` is a `set`, and is the sample of `+in`.
615612
616613`b` is a gate.
617614
@@ -622,26 +619,28 @@ A noun.
622619#### Source
623620
624621```hoon
625− ++ rep :: reduce to product
626− ~/ %rep
627− |* b=_=>(~ |=([* *] +<+))
628− |-
629− ?~ a +<+.b
630− $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
622+++ rep
623+ ~/ %rep
624+ |* b=_=>(~ |=([* *] +<+))
625+ |-
626+ ?~ a +<+.b
627+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
631628```
632629
633630#### Examples
634631
635632```
636− > =a (~(gas in *(set @)) [1 2 3 ~])
637− > `(set @)`a
638− {1 3 2}
633+> (~(rep in (silt ~[1 2 3 4 5])) add)
634+b=15
635+```
639636
640− > (~(rep in a) |=([a=@ b=@] (add a b)))
641− b=6
637+```
638+> `@t`(~(rep in (silt ~['foo' 'bar' 'baz'])) |=(a=[@ @] (cat 3 a)))
639+'foobarbaz'
642640```
643641
644642---
643+
645644### `++run:in`
646645
647646Apply gate to set
@@ -662,28 +661,29 @@ A set.
662661#### Source
663662
664663```hoon
665− ++ run :: apply gate to values
666− ~/ %run
667− |* b=gate
668− =+ c=`(set _?>(?=(^ a) (b n.a)))`~
669− |- ?~ a c
670− =. c (~(put in c) (b n.a))
671− =. c $(a l.a, c c)
672− $(a r.a, c c)
664+++ run
665+ ~/ %run
666+ |* b=gate
667+ =+ c=`(set _?>(?=(^ a) (b n.a)))`~
668+ |- ?~ a c
669+ =. c (~(put in c) (b n.a))
670+ =. c $(a l.a, c c)
671+ $(a r.a, c c)
673672```
674673
675674#### Examples
676675
677676```
678− > =s (sy ~["a" "A" "b" "c"])
679− > `(set tape)`s
680− {"A" "a" "c" "b"}
677+> =s (silt ~["a" "A" "b" "c"])
678+> `(set tape)`s
679+{"A" "a" "c" "b"}
681680
682− > (~(run in s) cuss)
683− {"A" "C" "B"}
681+> (~(run in s) cuss)
682+{"A" "C" "B"}
684683```
685684
686685---
686+
687687### `++tap:in`
688688
689689Set to list
@@ -701,29 +701,30 @@ A list.
701701#### Source
702702
703703```hoon
704− ++ tap :: convert to list
705− =< $
706− ~/ %tap
707− =+ b=`(list _?>(?=(^ a) n.a))`~
708− |. ^+ b
709− ?~ a
710− b
711− $(a r.a, b [n.a $(a l.a)])
704+++ tap
705+ =< $
706+ ~/ %tap
707+ =+ b=`(list _?>(?=(^ a) n.a))`~
708+ |. ^+ b
709+ ?~ a
710+ b
711+ $(a r.a, b [n.a $(a l.a)])
712712```
713713
714−
715714#### Examples
716715
717716```
718− > =s (sy `(list @t)`['a' 'b' 'c' 'd' 'e' ~])
719− > s
720− [n='e' l={} r={'d' 'a' 'c' 'b'}]
717+> ~(tap in (silt "foobar"))
718+"oafbr"
719+```
721720
722− > ~(tap in s)
723− ~['b' 'c' 'a' 'd' 'e']
721+```
722+> ~(tap in (silt ~[1 2 3 4 5]))
723+~[4 3 2 1 5]
724724```
725725
726726---
727+
727728### `++uni:in`
728729
729730Union
@@ -733,7 +734,7 @@ Produces a set of the union between two sets of the same type, `a` and
733734
734735#### Accepts
735736
736−`a` is a set.
737+`a` is a set, and is the sample of `+in`.
737738
738739`b` is a set.
739740
@@ -744,47 +745,47 @@ A set.
744745#### Source
745746
746747```hoon
747− ++ uni :: union
748− ~/ %uni
749− =+ b=a
750− |@
751− ++ $
752− ?: =(a b) a
753− |- ^+ a
754− ?~ b
755− a
756− ?~ a
757− b
758− ?: =(n.b n.a)
759− b(l $(a l.a, b l.b), r $(a r.a, b r.b))
760− ?: (mor n.a n.b)
761− ?: (gor n.b n.a)
762− $(l.a $(a l.a, r.b ~), b r.b)
763− $(r.a $(a r.a, l.b ~), b l.b)
764− ?: (gor n.a n.b)
765− $(l.b $(b l.b, r.a ~), a r.a)
766− $(r.b $(b r.b, l.a ~), a l.a)
767− --
748+++ uni
749+ ~/ %uni
750+ =+ b=a
751+ |@
752+ ++ $
753+ ?: =(a b) a
754+ |- ^+ a
755+ ?~ b
756+ a
757+ ?~ a
758+ b
759+ ?: =(n.b n.a)
760+ b(l $(a l.a, b l.b), r $(a r.a, b r.b))
761+ ?: (mor n.a n.b)
762+ ?: (gor n.b n.a)
763+ $(l.a $(a l.a, r.b ~), b r.b)
764+ $(r.a $(a r.a, l.b ~), b l.b)
765+ ?: (gor n.a n.b)
766+ $(l.b $(b l.b, r.a ~), a r.a)
767+ $(r.b $(b r.b, l.a ~), a l.a)
768+ --
768769```
769770
770−
771771#### Examples
772772
773773```
774− > (~(uni in `(set @t)`(sy "ac")) `(set @)`(sy "ha"))
775− [n='c' l={'a'} r={'h'}]
774+> =a (silt ~[1 2 3 4 5])
775+> =b (silt ~[4 5 6 7 8])
776776
777− > (~(uni in `(set @t)`(sy "acmo")) ~)
778− [n='c' l={'a'} r={'m' 'o'}]
777+> `(set @)`(~(uni in a) b)
778+{8 5 7 6 1 2 3 4}
779779
780− > (~(uni in `(set @t)`(sy "acmo")) `(set @t)`(sy "ham"))
781− [n='c' l={'a'} r={'m' 'o' 'h'}]
780+> `(set @)`(~(uni in a) ~)
781+{5 1 2 3 4}
782782
783− > (~(uni in `(set @t)`(sy "acmo")) `(set @t)`(sy "lep"))
784− [n='e' l={} r={'a' 'c' 'm' 'l' 'o' 'p'}]
783+> `(set @)`(~(uni in `(set @)`~) b)
784+{8 5 7 6 4}
785785```
786786
787787---
788+
788789### `++wyt:in`
789790
790791Set size
@@ -802,25 +803,24 @@ An atom.
802803#### Source
803804
804805```hoon
805− ++ wyt :: size of set
806− =< $
807− ~% %wyt + ~
808− |. ^- @
809− ?~(a 0 +((add $(a l.a) $(a r.a))))
810− --
806+++ wyt
807+ =< $
808+ ~% %wyt + ~
809+ |. ^- @
810+ ?~(a 0 +((add $(a l.a) $(a r.a))))
811+--
811812```
812813
813−
814814#### Examples
815815
816816```
817− > =a (~(put in (~(put in (sy)) 'a')) 'b')
818− > ~(wyt in a)
819− 2
817+> ~(wyt in (silt ~[1 2 3 4]))
818+4
819+```
820820
821− > =b (sy `(list @t)`['john' 'bonita' 'daniel' 'madeleine' ~])
822− > ~(wyt in b)
823− 4
821+```
822+> ~(wyt in `(set @)`~)
823+0
824824```
825825
826826---
content/docs/hoon/reference/stdlib/2i.md+720−436
@@ -4,44 +4,47 @@ weight = 12
44template = "doc.html"
55+++
66
7−### `++by`
7+## `++by`
88
99Map operations
1010
1111Container arm for map operation arms. A map is a set of key-value pairs. The
1212contained arms inherit its sample map, `a`.
1313
14−### Accepts
14+#### Accepts
1515
1616`a` is a map.
1717
1818#### Source
1919
2020```hoon
21− ++ by
22− ~/ %by
23− =| a=(tree (pair))
24− =* node ?>(?=(^ a) n.a)
21+++ by
22+ ~/ %by
23+ =| a=(tree (pair)) :: (map)
24+ =* node ?>(?=(^ a) n.a)
25+ |@
2526```
2627
2728#### Examples
2829
2930```
30− > ~(. by (my [%a 1] [%b 2] ~))
31− < 27.zjr
32− { a
33− ?(
34− { n/{?(p/$a p/$b) q/@ud}
35− l/nlr({p/?($b $a) q/@ud})
36− r/nlr({p/?($b $a) q/@ud})
37− }
38− $~
39− )
40− <119.wim 31.ohr 1.jmk $143>
41− }
31+> ~(. by (malt (limo ~[a+1 b+2 c+3])))
32+< 27.jus
33+ [ a
34+ ?(
35+ %~
36+ [ n=[?(p=%a p=%b p=%c) q=@ud]
37+ l=nlr([p=?(%a %b %c) q=@ud])
38+ r=nlr([p=?(%a %b %c) q=@ud])
39+ ]
40+ )
41+ <123.zao 46.hgz 1.pnw %140>
42+ ]
43+>
4244```
4345
4446---
47+
4548### `++all:by`
4649
4750Logical AND
@@ -51,9 +54,9 @@ with gate `b`.
5154
5255#### Accepts
5356
54−`a` is a map.
57+`a` is a map, and is the sample of `+by`.
5558
56−`b` is a wet gate.
59+`b` is a gate.
5760
5861#### Produces
5962
@@ -62,31 +65,36 @@ A flag.
6265#### Source
6366
6467```hoon
65− ++ all :: logical AND
66− ~/ %all
67− |* b=$-(* ?)
68− |- ^- ?
69− ?~ a
70− &
71− ?&((b n.a) $(a l.a) $(a r.a))
68+++ all
69+ ~/ %all
70+ |* b=$-(* ?)
71+ |- ^- ?
72+ ?~ a
73+ &
74+ ?&((b q.n.a) $(a l.a) $(a r.a))
7275```
7376
7477#### Examples
7578
7679```
77− > =b (my [['a' 1] ['b' [2 3]] ~])
78− > (~(all by b) |=(a=* ?@(a & |)))
79− %.n
80+> =a (malt (limo ~[a+1 b+[2 3]]))
8081
81− > =a (my [['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
82− > (~(all by a) |=(a=@ (lte a 6)))
83− %.y
82+> (~(all by a) |=(a=* ?@(a & |)))
83+%.n
84+```
8485
85− > (~(all by a) |=(a=@ (lte a 4)))
86− %.n
86+```
87+> =a (malt (limo ~[a+1 b+2 c+3 d+4 e+5]))
88+
89+> (~(all by a) |=(a=@ (lte a 6)))
90+%.y
91+
92+> (~(all by a) |=(a=@ (lte a 4)))
93+%.n
8794```
8895
8996---
97+
9098### `++any:by`
9199
92100Logical OR
@@ -96,7 +104,7 @@ gate `b`.
96104
97105#### Accepts
98106
99−`a` is a map.
107+`a` is a map, and is the sample of `+by`.
100108
101109`b` is a wet gate.
102110
@@ -107,28 +115,33 @@ A flag.
107115#### Source
108116
109117```hoon
110− ++ any :: logical OR
111− ~/ %any
112− |* b=$-(* ?)
113− |- ^- ?
114− ?~ a
115− |
116− ?|((b q.n.a) $(a l.a) $(a r.a))
118+++ any
119+ ~/ %any
120+ |* b=$-(* ?)
121+ |- ^- ?
122+ ?~ a
123+ |
124+ ?|((b q.n.a) $(a l.a) $(a r.a))
117125```
118126
119127#### Examples
120128
121129```
122− > =b (my [['a' 1] ['b' [2 3]] ~])
123− > (~(any by b) |=(a=* ?@(a & |)))
124− %.y
130+> =a (malt (limo ~[a+1 b+[2 3]]))
125131
126− > =a (my [['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
127− > (~(any by a) |=(a=@ (lte a 4)))
128− %.y
132+> (~(any by a) |=(a=* ?@(a & |)))
133+%.y
134+```
135+
136+```
137+> =a (malt (limo ~[a+1 b+2 c+3 d+4 e+5]))
138+
139+> (~(any by a) |=(a=@ (lte a 4)))
140+%.y
129141```
130142
131143---
144+
132145### `++apt:by`
133146
134147Check correctness
@@ -147,35 +160,36 @@ A flag.
147160#### Source
148161
149162```hoon
150− ++ apt :: check correctness
151− =< $
152− ~/ %apt
153− =| [l=(unit) r=(unit)]
154− |. ^- ?
155− ?~ a &
156− ?& ?~(l & &((gor p.n.a u.l) !=(p.n.a u.l)))
157− ?~(r & &((gor u.r p.n.a) !=(u.r p.n.a)))
158− ?~ l.a &
159− &((mor p.n.a p.n.l.a) !=(p.n.a p.n.l.a) $(a l.a, l `p.n.a))
160− ?~ r.a &
161− &((mor p.n.a p.n.r.a) !=(p.n.a p.n.r.a) $(a r.a, r `p.n.a))
162− ==
163+++ apt
164+ =< $
165+ ~/ %apt
166+ =| [l=(unit) r=(unit)]
167+ |. ^- ?
168+ ?~ a &
169+ ?& ?~(l & &((gor p.n.a u.l) !=(p.n.a u.l)))
170+ ?~(r & &((gor u.r p.n.a) !=(u.r p.n.a)))
171+ ?~ l.a &
172+ &((mor p.n.a p.n.l.a) !=(p.n.a p.n.l.a) $(a l.a, l `p.n.a))
173+ ?~ r.a &
174+ &((mor p.n.a p.n.r.a) !=(p.n.a p.n.r.a) $(a r.a, r `p.n.a))
175+ ==
163176```
164177
165178#### Examples
166179
167180```
168− > =a (my [['a' 1] ['b' [2 3]] ~])
169− > ~(apt by a)
170− %.y
181+> =a (malt `(list [@tas @])`~[a+1 b+2 c+3 d+4 e+5])
182+
183+> ~(apt by a)
184+%.y
185+
186+> =z ?~(a ~ a(p.n `@tas`%z))
171187
172− > =s (my [[1 2] [3 4] ~])
173− > =z ?~ s ~ s(p.n 10)
174− > z
175− [n=[p=10 q=2] l={} r={[p=3 q=4]}]
188+> z
189+[n=[p=%z q=2] l={[p=%e q=5]} r={[p=%d q=4] [p=%a q=1] [p=%c q=3]}]
176190
177− > ~(apt by z)
178− %.n
191+> ~(apt by z)
192+%.n
179193```
180194
181195#### Discussion
@@ -186,11 +200,11 @@ See section [`2f`](/docs/hoon/reference/stdlib/2f) for more information on noun
186200
187201Bifurcate
188202
189−Splits map `a` into two maps `l` and `r`, with the head at `b` discarded.
203+Splits map `a` into two maps `l` and `r`, which contain the items either side of key `b` with value `c` but not including `b`-`c`.
190204
191205#### Accepts
192206
193−`a` is a map.
207+`a` is a map, and is the sample of `+by`.
194208
195209`b` is a noun.
196210
@@ -203,38 +217,45 @@ A cell of two maps.
203217#### Source
204218
205219```hoon
206− ++ bif :: splits a by b
207− ~/ %bif
208− |* [b=* c=*]
209− ^+ [l=a r=a]
210− =< +
211− |- ^+ a
212− ?~ a
213− [[b c] ~ ~]
214− ?: =(b p.n.a)
215− ?: =(c q.n.a)
216− a
217− a(n [b c])
218− ?: (gor b p.n.a)
219− =+ d=$(a l.a)
220− ?> ?=(^ d)
221− d(r a(l r.d))
222− =+ d=$(a r.a)
220+++ bif
221+ ~/ %bif
222+ |* [b=* c=*]
223+ ^+ [l=a r=a]
224+ =< +
225+ |- ^+ a
226+ ?~ a
227+ [[b c] ~ ~]
228+ ?: =(b p.n.a)
229+ ?: =(c q.n.a)
230+ a
231+ a(n [b c])
232+ ?: (gor b p.n.a)
233+ =+ d=$(a l.a)
223234 ?> ?=(^ d)
224− d(l a(r l.d))
235+ d(r a(l r.d))
236+ =+ d=$(a r.a)
237+ ?> ?=(^ d)
238+ d(l a(r l.d))
225239```
226240
227241#### Examples
228242
229243```
230− > =a (my [['a' 1] ['b' 2] ['c' 3] ~])
244+> =a (malt `(list [@tas @])`~[a+1 b+2 c+3 d+4 e+5])
231245
232− > (~(bif by a) ['b' 2])
233− [l=[n=[p='c' q=3] l=[n=[p='a' q=1] l={} r={}] r=~] r=~]
246+> (~(bif by a) b+2)
247+[l=[n=[p=%e q=5] l=~ r=~] r=[n=[p=%d q=4] l=~ r=[n=[p=%c q=3] l={[p=%a q=1]} r={}]]]
248+
249+> `[(map @tas @) (map @tas @)]`(~(bif by a) b+2)
250+[{[p=%e q=5]} {[p=%d q=4] [p=%a q=1] [p=%c q=3]}]
234251```
235252
253+#### Discussion
254+
255+Note that `map`s are horizontally ordered by the [mug](/docs/hoon/reference/stdlib/2e#mug) hash of their keys and vertically ordered by the double-`mug` hash of their keys. This means bifurcating the map `(malt ~[10^10 20^20 30^30 40^40 50^50])` at `30^30` will not produce `[{10^10 20^20} {40^40 50^50}]`, but rather `[{20^20} {10^10 40^40 50^50}]` due to the tree structure resulting from their `mug` hashes.
236256
237257---
258+
238259### `++del:by`
239260
240261Delete
@@ -243,7 +264,7 @@ Produces map `a` with the element located at key `b` removed.
243264
244265#### Accepts
245266
246−`a` is a map.
267+`a` is a map, and is the sample of `+by`.
247268
248269`b` is a key as a noun.
249270
@@ -254,33 +275,112 @@ A map.
254275#### Source
255276
256277```hoon
257− ++ del :: delete at key b
258− ~/ %del
259− |* b=*
278+++ del
279+ ~/ %del
280+ |* b=*
281+ |- ^+ a
282+ ?~ a
283+ ~
284+ ?. =(b p.n.a)
285+ ?: (gor b p.n.a)
286+ a(l $(a l.a))
287+ a(r $(a r.a))
288+ |- ^- [$?(~ _a)]
289+ ?~ l.a r.a
290+ ?~ r.a l.a
291+ ?: (mor p.n.l.a p.n.r.a)
292+ l.a(r $(l.a r.l.a))
293+ r.a(l $(r.a l.r.a))
294+```
295+
296+#### Examples
297+
298+```
299+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
300+> a
301+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
302+
303+> `(map @tas @)`(~(del by a) %z)
304+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
305+
306+> `(map @tas @)`(~(del by a) %b)
307+{[p=%d q=4] [p=%a q=1] [p=%c q=3]}
308+```
309+
310+---
311+
312+### `++dif:by`
313+
314+Difference
315+
316+Computes the difference between `a` and `b`, producing the map of key-value pairs in `a` whose keys are not in `b`.
317+
318+#### Accepts
319+
320+`a` is a `map`, and is the sample of `+by`.
321+
322+`b` is a `map`.
323+
324+#### Produces
325+
326+A `map`.
327+
328+#### Source
329+
330+```hoon
331+++ dif
332+ ~/ %dif
333+ =+ b=a
334+ |@
335+ ++ $
260336 |- ^+ a
261− ?~ a
262− ~
263− ?. =(b p.n.a)
264− ?: (gor b p.n.a)
265− a(l $(a l.a))
266− a(r $(a r.a))
337+ ?~ b
338+ a
339+ =+ c=(bif p.n.b q.n.b)
340+ ?> ?=(^ c)
341+ =+ d=$(a l.c, b l.b)
342+ =+ e=$(a r.c, b r.b)
267343 |- ^- [$?(~ _a)]
268− ?~ l.a r.a
269− ?~ r.a l.a
270− ?: (mor p.n.l.a p.n.r.a)
271− l.a(r $(l.a r.l.a))
272− r.a(l $(r.a l.r.a))
344+ ?~ d e
345+ ?~ e d
346+ ?: (mor p.n.d p.n.e)
347+ d(r $(d r.d))
348+ e(l $(e l.e))
349+ --
273350```
274351
275352#### Examples
276353
277354```
278− > =b (my [['a' 1] ['b' [2 3]] ~])
279− > (~(del by b) 'a')
280− [n=[p='b' q=[2 3]] l=~ r=~]
355+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
356+> =b `(map @tas @)`(malt (limo ~[c+3 d+4 e+5 f+6]))
357+> a
358+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
359+> b
360+{[p=%e q=5] [p=%d q=4] [p=%f q=6] [p=%c q=3]}
361+
362+> `(map @tas @)`(~(dif by a) b)
363+{[p=%b q=2] [p=%a q=1]}
364+```
365+
366+```
367+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
368+> =b `(map @tas @)`(malt (limo ~[a+2 e+4 f+5]))
369+> a
370+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
371+> b
372+{[p=%e q=4] [p=%f q=5] [p=%a q=2]}
373+
374+> `(map @tas @)`(~(dif by a) b)
375+{[p=%b q=2] [p=%d q=4] [p=%c q=3]}
281376```
282377
378+#### Discussion
379+
380+This only compares keys, so if both maps contain the same key with different values, that key-value pair is not considered a difference and will not be included in the resulting map.
381+
283382---
383+
284384### `++dig:by`
285385
286386Address of key
@@ -289,7 +389,7 @@ Produce the address of key `b` within map `a`.
289389
290390#### Accepts
291391
292−`a` is a map.
392+`a` is a map, and is the sample of `+by`.
293393
294394`b` is a key as a noun.
295395
@@ -300,35 +400,43 @@ A unit.
300400#### Source
301401
302402```hoon
303− ++ dig :: axis of b key
304− |= b=*
305− =+ c=1
306− |- ^- (unit @)
307− ?~ a ~
308− ?: =(b p.n.a) [~ u=(peg c 2)]
309− ?: (gor b p.n.a)
310− $(a l.a, c (peg c 6))
311− $(a r.a, c (peg c 7))
403+++ dig
404+ |= b=*
405+ =+ c=1
406+ |- ^- (unit @)
407+ ?~ a ~
408+ ?: =(b p.n.a) [~ u=(peg c 2)]
409+ ?: (gor b p.n.a)
410+ $(a l.a, c (peg c 6))
411+ $(a r.a, c (peg c 7))
312412```
313413
314414#### Examples
315415
316416```
317− > =b (my [['a' 1] ['b' [2 3]] ~])
318− > (~(dig by b) 'b')
319− [~ u=2]
417+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
418+
419+> (~(dig by a) %a)
420+[~ 252]
421+
422+> (~(dig by a) %b)
423+[~ 2]
424+
425+> (~(dig by a) %e)
426+~
320427```
321428
322429---
430+
323431### `++gas:by`
324432
325433Concatenate
326434
327−Insert a list of key-value pairs `b` into map `a`.
435+Insert a list of key-value pairs `b` into map `a`. For a key which exists in both `a` and `b`, the value is replaced with the value in `b`.
328436
329437#### Accepts
330438
331−`a` is a map.
439+`a` is a map, and is the sample of `+by`.
332440
333441`b` is a list of cells of key-value nouns `p` and `q`.
334442
@@ -339,27 +447,43 @@ A map.
339447#### Source
340448
341449```hoon
342− ++ gas :: concatenate
343− ~/ %gas
344− |* b=(list [p=* q=*])
345− => .(b `(list _?>(?=(^ a) n.a))`b)
346− |- ^+ a
347− ?~ b
348− a
349− $(b t.b, a (put p.i.b q.i.b))
450+++ gas
451+ ~/ %gas
452+ |* b=(list [p=* q=*])
453+ => .(b `(list _?>(?=(^ a) n.a))`b)
454+ |- ^+ a
455+ ?~ b
456+ a
457+ $(b t.b, a (put p.i.b q.i.b))
350458```
351459
352460#### Examples
353461
354462```
355− > =a (my [['a' 1] ['b' 2] ~])
356− > =b [['c' 3] ['d' 4] ~]
463+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
464+> a
465+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
357466
358− > (~(gas by a) b)
359− [n=[p='b' q=2] l=[n=[p='d' q=4] l={} r={[p='a' q=1] [p='c' q=3]}] r=~]
467+> `(map @tas @)`(~(gas by a) ~[e+5 f+6 g+7])
468+{[p=%e q=5] [p=%b q=2] [p=%d q=4] [p=%f q=6] [p=%g q=7] [p=%a q=1] [p=%c q=3]}
469+```
470+
471+```
472+> =a `(map @tas @)`(malt (limo ~[a+1 b+2]))
473+> a
474+{[p=%b q=2] [p=%a q=1]}
475+
476+> `(map @tas @)`(~(gas by a) ~[a+100 b+200])
477+{[p=%b q=200] [p=%a q=100]}
478+```
479+
480+```
481+> `(map @tas @)`(~(gas by `(map @tas @)`~) ~[a+100 b+200])
482+{[p=%b q=200] [p=%a q=100]}
360483```
361484
362485---
486+
363487### `++get:by`
364488
365489Grab unit value
@@ -368,7 +492,7 @@ Produce the unit value of the value located at key `b` within map `a`.
368492
369493#### Accepts
370494
371−`a` is a map.
495+`a` is a map, and is the sample of `+by`.
372496
373497`b` is a key as a noun.
374498
@@ -379,34 +503,38 @@ A unit.
379503#### Source
380504
381505```hoon
382− ++ get :: grab value by key
383− ~/ %get
384− |* b=*
385− => .(b `_?>(?=(^ a) p.n.a)`b)
386− |- ^- (unit _?>(?=(^ a) q.n.a))
387− ?~ a
388− ~
389− ?: =(b p.n.a)
390− (some q.n.a)
391− ?: (gor b p.n.a)
392− $(a l.a)
393− $(a r.a)
506+++ get
507+ ~/ %get
508+ |* b=*
509+ => .(b `_?>(?=(^ a) p.n.a)`b)
510+ |- ^- (unit _?>(?=(^ a) q.n.a))
511+ ?~ a
512+ ~
513+ ?: =(b p.n.a)
514+ (some q.n.a)
515+ ?: (gor b p.n.a)
516+ $(a l.a)
517+ $(a r.a)
394518```
395519
396520#### Examples
397521
398522```
399− > =b (my [['a' 1] ['b' [2 3]] ~])
400− > (~(get by b) 'b')
401− [~ u=[2 3]]
523+> a
524+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
525+
526+> (~(get by a) %a)
527+[~ 1]
402528
529+> (~(get by a) %b)
530+[~ 2]
403531
404− > =m (my [['a' 1] ['b' 2] ~])
405− > (~(get by m) 'a')
406− [~ u=1]
532+> (~(get by a) %z)
533+~
407534```
408535
409536---
537+
410538### `++got:by`
411539
412540Assert
@@ -416,7 +544,7 @@ exist.
416544
417545#### Accepts
418546
419−`a` is a map.
547+`a` is a map, and is the sample of `+by`.
420548
421549`b` is a key as a noun.
422550
@@ -424,29 +552,33 @@ exist.
424552
425553A noun.
426554
427−#### Source
555+#### Source
428556
429557```hoon
430− ++ got :: need value by key
431− |* b=*
432− (need (get b))
558+++ got
559+ |* b=*
560+ (need (get b))
433561```
434562
435563#### Examples
436564
437565```
438− > =m (my [['a' 1] ['b' 2] ~])
439− > m
440− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
566+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
567+> a
568+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
569+
570+> (~(got by a) %a)
571+1
441572
442− > (~(got by m) 'a')
443− 1
573+> (~(got by a) %b)
574+2
444575
445− > (~(got by m) 'c')
446− ! exit
576+> (~(got by a) %z)
577+dojo: hoon expression failed
447578```
448579
449580---
581+
450582### `++gut:by`
451583
452584Grab value with default
@@ -456,7 +588,7 @@ key does not exist.
456588
457589#### Accepts
458590
459−`a` is a map.
591+`a` is a map, and is the sample of `+by`.
460592
461593`b` is a key as a noun.
462594
@@ -469,27 +601,30 @@ A noun.
469601#### Source
470602
471603```hoon
472− ++ gut :: fall value by key
473− |* [b=* c=*]
474− (fall (get b) c)
475−
604+++ gut
605+ |* [b=* c=*]
606+ (fall (get b) c)
476607```
477608
478609#### Examples
479610
480611```
481− > =m (my [['a' 1] ['b' 2] ~])
482− > m
483− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
612+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
613+> a
614+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
484615
485− > (~(gut by m) 'a' 0)
486− 1
616+> (~(gut by a) %a 9.999)
617+1
487618
488− > (~(gut by m) 'c' 0)
489− 0
619+> (~(gut by a) %b 9.999)
620+2
621+
622+> (~(gut by a) %z 9.999)
623+9.999
490624```
491625
492626---
627+
493628### `++has:by`
494629
495630Key existence check
@@ -498,7 +633,7 @@ Checks whether map `a` contains an element with key `b`, producing a flag.
498633
499634#### Accepts
500635
501−`a` is a map.
636+`a` is a map, and is the sample of `+by`.
502637
503638`b` is a key as a noun.
504639
@@ -509,24 +644,27 @@ A flag.
509644#### Source
510645
511646```hoon
512− ++ has :: key existence check
513− ~/ %has
514− |* b=*
515− !=(~ (get b))
647+++ has
648+ ~/ %has
649+ |* b=*
650+ !=(~ (get b))
516651```
517652
518653#### Examples
519654
520655```
521− > =b (my [['a' 1] ['b' [2 3]] ~])
522− > (~(has by b) 'b')
523− %.y
656+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
657+> a
658+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
524659
525− > (~(has by b) 'c')
526− %.n
660+> (~(has by a) %a)
661+%.y
662+> (~(has by a) %z)
663+%.n
527664```
528665
529666---
667+
530668### `++int:by`
531669
532670Intersection
@@ -537,7 +675,7 @@ element from map `b` is used.
537675
538676#### Accepts
539677
540−`a` is a map.
678+`a` is a map, and is the sample of `+by`.
541679
542680`b` is a map.
543681
@@ -548,54 +686,113 @@ A map.
548686#### Source
549687
550688```hoon
551− ++ int :: intersection
552− ~/ %int
553− =+ b=a
554− |@
555− ++ $
556− |- ^+ a
557− ?~ b
558− ~
559− ?~ a
560− ~
561− ?: (mor p.n.a p.n.b)
562− ?: =(p.n.b p.n.a)
563− b(l $(a l.a, b l.b), r $(a r.a, b r.b))
564− ?: (gor p.n.b p.n.a)
565− %- uni(a $(a l.a, r.b ~)) $(b r.b)
566− %- uni(a $(a r.a, l.b ~)) $(b l.b)
567− ?: =(p.n.a p.n.b)
568− b(l $(b l.b, a l.a), r $(b r.b, a r.a))
569− ?: (gor p.n.a p.n.b)
570− %- uni(a $(b l.b, r.a ~)) $(a r.a)
571− %- uni(a $(b r.b, l.a ~)) $(a l.a)
572− --
689+++ int
690+ ~/ %int
691+ =+ b=a
692+ |@
693+ ++ $
694+ |- ^+ a
695+ ?~ b
696+ ~
697+ ?~ a
698+ ~
699+ ?: (mor p.n.a p.n.b)
700+ ?: =(p.n.b p.n.a)
701+ b(l $(a l.a, b l.b), r $(a r.a, b r.b))
702+ ?: (gor p.n.b p.n.a)
703+ %- uni(a $(a l.a, r.b ~)) $(b r.b)
704+ %- uni(a $(a r.a, l.b ~)) $(b l.b)
705+ ?: =(p.n.a p.n.b)
706+ b(l $(b l.b, a l.a), r $(b r.b, a r.a))
707+ ?: (gor p.n.a p.n.b)
708+ %- uni(a $(b l.b, r.a ~)) $(a r.a)
709+ %- uni(a $(b r.b, l.a ~)) $(a l.a)
710+ --
573711```
574712
575713#### Examples
576714
577715```
578− > =n (my [['a' 1] ['c' 3] ~])
579− > =m (my [['a' 1] ['b' 2] ~])
716+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
717+> =b `(map @tas @)`(malt (limo ~[c+3 d+4 e+5 f+6]))
718+> a
719+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
720+> b
721+{[p=%e q=5] [p=%d q=4] [p=%f q=6] [p=%c q=3]}
722+
723+> `(map @tas @)`(~(int by a) b)
724+{[p=%d q=4] [p=%c q=3]}
725+```
580726
581− > (~(int by m) n)
582− [n=[p='a' q=1] l=~ r=~]
727+```
728+> =a `(map @tas @)`(malt (limo ~[a+1 b+2]))
729+> =b `(map @tas @)`(malt (limo ~[a+100 b+200]))
730+> a
731+{[p=%b q=2] [p=%a q=1]}
732+> b
733+{[p=%b q=200] [p=%a q=100]}
583734
584− > =p (my [['a' 2] ['b' 2] ~])
585− > p
586− [n=[p='b' q=2] l={[p='a' q=2]} r={}]
587− > (~(int by p) n)
588− [n=[p='a' q=1] l=~ r=~]
735+> `(map @tas @)`(~(int by a) b)
736+{[p=%b q=200] [p=%a q=100]}
737+```
589738
590− > =q (my [['a' 2] ['c' 2] ~])
591− > q
592− [n=[p='c' q=2] l={[p='a' q=2]} r={}]
593− > (~(int by p) q)
594− [n=[p='a' q=2] l=~ r=~]
739+---
740+
741+### `++jab:by`
742+
743+Transform value
744+
745+Produce map `a` with the value at key `b` transformed by gate `c`.
746+
747+#### Accepts
748+
749+`a` is a `map`, and is the sample of `+by`.
750+
751+`b` is a noun, and a key in `a`.
752+
753+`c` is a `gate`.
754+
755+#### Produces
756+
757+A `map`.
758+
759+#### Source
760+
761+```hoon
762+++ jab
763+ ~/ %jab
764+ |* [key=_?>(?=(^ a) p.n.a) fun=$-(_?>(?=(^ a) q.n.a) _?>(?=(^ a) q.n.a))]
765+ ^+ a
766+ ::
767+ ?~ a !!
768+ ::
769+ ?: =(key p.n.a)
770+ a(q.n (fun q.n.a))
771+ ::
772+ ?: (gor key p.n.a)
773+ a(l $(a l.a))
774+ ::
775+ a(r $(a r.a))
776+```
777+
778+#### Examples
595779
596− > =o (my [['c' 3] ['d' 4] ~])
597− > (~(int by m) o)
598− ~
780+```
781+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
782+> a
783+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
784+
785+> `(map @tas @)`(~(jab by a) %d |=(x=@ (pow x 2)))
786+{[p=%b q=2] [p=%d q=16] [p=%a q=1] [p=%c q=3]}
787+
788+> (~(jab by a) %z |=(x=@ (pow x 2)))
789+dojo: hoon expression failed
790+
791+> (~(jab by a) %d |=(a=@ [a a]))
792+-need.?(%~ [n=[p=@tas q=@] l=nlr([p=@tas q=@]) r=nlr([p=@tas q=@])])
793+-have.[n=[p=@tas q=[@ @]] l=nlr([p=@tas q=@]) r=nlr([p=@tas q=@])]
794+nest-fail
795+dojo: hoon expression failed
599796```
600797
601798---
@@ -604,14 +801,11 @@ A map.
604801
605802Set of keys
606803
607−Produces a set of all keys in map `a` that is prepended to set `b`,
608−which is empty by default.
804+Produces a set of all keys in map `a`.
609805
610806#### Accepts
611807
612−`a` is a map.
613−
614−`b` is a set.
808+`a` is a map, and is the sample of `+by`.
615809
616810#### Produces
617811
@@ -621,8 +815,10 @@ A set.
621815
622816```hoon
623817++ key
818+ =< $
819+ ~/ %key
624820 =+ b=`(set _?>(?=(^ a) p.n.a))`~
625− |- ^+ b
821+ |. ^+ b
626822 ?~ a b
627823 $(a r.a, b $(a l.a, b (~(put in b) p.n.a)))
628824```
@@ -630,20 +826,19 @@ A set.
630826#### Examples
631827
632828```
633− > =m (my [['a' 1] ['b' 2] ~])
634− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
829+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
635830
636− > ~(key by m)
637− {'b' 'a'}
831+> ~(key by a)
832+{%b %d %a %c}
638833```
639834
640835---
641836
642837### `++mar:by`
643838
644−Assert and add
839+Add with validation
645840
646−Produces map `a` with the addition of a key-value pair, where the value is a
841+Produces map `a` with the addition of key-value pair `b` and `c`, where the value is a
647842nonempty unit.
648843
649844Accept a noun and a unit of a noun of the type of the map's keys and values,
@@ -652,39 +847,45 @@ If the value is null, delete the key.
652847
653848#### Accepts
654849
655−`a` is a map.
850+`a` is a `map`, and is the sample of `+by`.
851+
852+`b` is a noun.
656853
657−`b` is a unit.
854+`c` is a `unit`.
658855
659856#### Produces
660857
661858A map.
662859
663−#### Assert and Add
860+#### Source
664861
665862```hoon
666− ++ mar :: add with validation
667− |* [b=* c=(unit *)]
668− ?~ c
669− (del b)
670− (put b u.c)
863+++ mar
864+ |* [b=* c=(unit *)]
865+ ?~ c
866+ (del b)
867+ (put b u.c)
671868```
672869
673870#### Examples
674871
675872```
676− > =m (my [['a' 1] ['b' 2] ~])
677− > (~(mar by m) 'c' (some 3))
678− [n=[p='b' q=2] l=[n=[p='c' q=3] l=[n=[p='a' q=1] l={} r={}] r=~] r=~]
873+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
874+> a
875+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
679876
680− > (~(mar by m) 'c' ~)
681− [n=[p='b' q=2] l=[n=[p='a' q=1] l=~ r=~] r=~]
877+> `(map @tas @)`(~(mar by a) %e (some 5))
878+{[p=%e q=5] [p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
682879
683− > (~(mar by m) 'b' ~)
684− [n=[p='a' q=1] l=~ r=~]
880+> `(map @tas @)`(~(mar by a) %a (some 10))
881+{[p=%b q=2] [p=%d q=4] [p=%a q=10] [p=%c q=3]}
882+
883+> `(map @tas @)`(~(mar by a) %a ~)
884+{[p=%b q=2] [p=%d q=4] [p=%c q=3]}
685885```
686886
687887---
888+
688889### `++put:by`
689890
690891Add key-value pair
@@ -693,7 +894,7 @@ Produces `a` with the addition of the key-value pair of `b` and `c`.
693894
694895#### Accepts
695896
696−`a` is a map.
897+`a` is a map, and is the sample of `+by`.
697898
698899`b` is a key of the same type as the keys in `a`.
699900
@@ -706,51 +907,56 @@ A map.
706907#### Source
707908
708909```hoon
709− ++ put :: adds key-value pair
710− ~/ %put
711− |* [b=* c=*]
712− |- ^+ a
713− ?~ a
714− [[b c] ~ ~]
715− ?: =(b p.n.a)
716− ?: =(c q.n.a)
717− a
718− a(n [b c])
719− ?: (gor b p.n.a)
720− =+ d=$(a l.a)
721− ?> ?=(^ d)
722− ?: (mor p.n.a p.n.d)
723− a(l d)
724− d(r a(l r.d))
725− =+ d=$(a r.a)
910+++ put
911+ ~/ %put
912+ |* [b=* c=*]
913+ |- ^+ a
914+ ?~ a
915+ [[b c] ~ ~]
916+ ?: =(b p.n.a)
917+ ?: =(c q.n.a)
918+ a
919+ a(n [b c])
920+ ?: (gor b p.n.a)
921+ =+ d=$(a l.a)
726922 ?> ?=(^ d)
727923 ?: (mor p.n.a p.n.d)
728− a(r d)
729− d(l a(r l.d))
924+ a(l d)
925+ d(r a(l r.d))
926+ =+ d=$(a r.a)
927+ ?> ?=(^ d)
928+ ?: (mor p.n.a p.n.d)
929+ a(r d)
930+ d(l a(r l.d))
730931```
731932
732933#### Examples
733934
734935```
735− > =m (my [['a' 1] ['b' 2] ~])
736− > (~(put by ~) 'c' 3)
737− [n=[p='b' q=2] l=[n=[p='c' q=3] l={[p='a' q=1]} r={}] r=~]
936+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3]))
937+> a
938+{[p=%b q=2] [p=%a q=1] [p=%c q=3]}
738939
739− > (~(put by m) "zod" 26)
740− ! nest-fail
741− ! exit
940+> `(map @tas @)`(~(put by a) %d 4)
941+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
742942
743− > (~(put by m) 'a' 2)
744− [n=[p='b' q=2] l=[n=[p='a' q=2] l={} r={}] r=~]
943+> `(map @tas @)`(~(put by a) %a 10)
944+{[p=%b q=2] [p=%a q=10] [p=%c q=3]}
745945
746− > (put:by m 'a' 2)
747− {[p=[[98 2] [[97 1] 0 0] 0] q=[97 2]]}
946+> (~(put by a) 42 'foo')
947+mull-grow
948+mull-nice
949+-need.?(%~ [n=[p=@tas q=@] l=nlr([p=@tas q=@]) r=nlr([p=@tas q=@])])
950+-have.[[@ud @t] %~ %~]
951+nest-fail
952+dojo: hoon expression failed
748953```
749954
750955---
956+
751957### `++rep:by`
752958
753−Replace by product
959+Reduce to product
754960
755961Accumulate elements of map `a` using gate `b`, producing a noun.
756962
@@ -758,7 +964,7 @@ Accumulate elements of map `a` using gate `b`, producing a noun.
758964
759965`a` is a map.
760966
761−`b` is a wet gate.
967+`b` is a gate.
762968
763969#### Produces
764970
@@ -767,63 +973,91 @@ A noun.
767973#### Source
768974
769975```hoon
770− ++ rep :: reduce to product
771− ~/ %rep
772− |* b=_=>(~ |=([* *] +<+))
773− |-
774− ?~ a +<+.b
775− $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
976+++ rep
977+ ~/ %rep
978+ |* b=_=>(~ |=([* *] +<+))
979+ |-
980+ ?~ a +<+.b
981+ $(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
776982```
777983
778984#### Examples
779985
780986```
781− > =m (my [['a' 1] ['b' 2] ~])
782− > (~(rep by m) |=(a=(pair * *) p.a))
783− q=[97 1]
987+> =a `(map @tas @)`(malt (limo ~[a+1 b+2 c+3 d+4]))
988+> a
989+{[p=%b q=2] [p=%d q=4] [p=%a q=1] [p=%c q=3]}
990+
991+> (~(rep by a) |=([p=[@tas @] q=@] ~&([p q] (add +.p q))))
992+[[%b 2] 0]
993+[[%d 4] 2]
994+[[%c 3] 6]
995+[[%a 1] 9]
996+q=10
784997```
785998
999+#### Discussion
1000+
1001+The gate will iteratively be fed a cell whose head is a key-value pair from the map and whose tail is an accumulator, producing the final value of the accumulator.
1002+
7861003---
1004+
7871005### `++rib:by`
7881006
789−Replace values with accumulator
1007+Transform + product
1008+
1009+`c` is a gate with a sample like `[[key value] accumulator]` and a product like `[accumulator [key value]]`. Each key-value pair in map `a` is passed to `c` and replaced with the key-value pair `c` produced. The final value of the accumulator and the modified map are returned. `b` is the initial value of the accumulator.
7901010
7911011#### Accepts
7921012
793−`a` is a map.
1013+`a` is a map, and is the sample of `+by`.
7941014
795−`b` is a noun.
1015+`b` is a noun, and is the initial value of the accumulator.
7961016
797−`c` is a wet gate.
1017+`c` is a gate.
7981018
799−####
1019+#### Produces
8001020
801−A cell of nouns.
1021+A cell of a noun and a map.
8021022
8031023#### Source
8041024
8051025```hoon
806− ++ rib :: transform + product
807− |* [b=* c=gate]
808− |- ^+ [b a]
809− ?~ a [b ~]
810− =+ d=(c n.a b)
811− =. n.a +.d
812− =+ e=$(a l.a, b -.d)
813− =+ f=$(a r.a, b -.e)
814− [-.f a(l +.e, r +.f)]
1026+++ rib
1027+ |* [b=* c=gate]
1028+ |- ^+ [b a]
1029+ ?~ a [b ~]
1030+ =+ d=(c n.a b)
1031+ =. n.a +.d
1032+ =+ e=$(a l.a, b -.d)
1033+ =+ f=$(a r.a, b -.e)
1034+ [-.f a(l +.e, r +.f)]
8151035```
8161036
8171037#### Examples
8181038
1039+In this example, all values less than three are changed to zero, and a list of their keys are produced along with the modified map.
1040+
8191041```
820− > =m (my [['a' 1] ['b' 2] ~])
821− > (~(rib by m) [1 2] (con by m))
1042+> =a `(map @t @)`(malt ~[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5]])
1043+> a
1044+{[p='e' q=5] [p='b' q=2] [p='d' q=4] [p='a' q=1] [p='c' q=3]}
8221045
823− > (~(rep by m) [1 2] |=(a=(pair * *) p.a))
1046+> =c |= [[k=@t v=@] acc=(list @t)]
1047+ ?: (lth v 3)
1048+ [[k acc] [k 0]]
1049+ [acc [k v]]
1050+
1051+> `[(list @t) (map @t @)]`(~(rib by a) *(list @t) c)
1052+[<|a b|> {[p='e' q=5] [p='b' q=0] [p='d' q=4] [p='a' q=0] [p='c' q=3]}]
8241053```
8251054
1055+#### Discussion
1056+
1057+Key-value pairs in the map are transformed in their existing tree location. This means if you change the key, you'd likely produce a map with an incorrect order, so typically you should only change the value.
1058+
8261059---
1060+
8271061### `++run:by`
8281062
8291063Transform values
@@ -832,9 +1066,9 @@ Iterates over every value in map `a` using gate `b`, producing a map.
8321066
8331067#### Accepts
8341068
835−`a` is a map.
1069+`a` is a map, and is the sample of `+by`.
8361070
837−`b` is a wet gate.
1071+`b` is a gate.
8381072
8391073#### Produces
8401074
@@ -843,38 +1077,36 @@ A map.
8431077#### Source
8441078
8451079```hoon
846− ++ run :: apply gate to values
847− ~/ %run
848− |* b=gate
849− |-
850− ?~ a a
851− [n=[p=p.n.a q=(b q.n.a)] l=$(a l.a) r=$(a r.a)]
1080+++ run
1081+ ~/ %run
1082+ |* b=gate
1083+ |-
1084+ ?~ a a
1085+ [n=[p=p.n.a q=(b q.n.a)] l=$(a l.a) r=$(a r.a)]
8521086```
8531087
8541088#### Examples
8551089
8561090```
857− > =m (my [['a' 1] ['b' 2] ~])
1091+> =a `(map @t @)`(malt ~[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5]])
8581092
859− > ^+(m (~(run by m) dec))
860− [n=[p='b' q=1] l={[p='a' q=0]} r={}]
861−
862− > `(map @tas @t)`(~(run by m) (cury scot %ux))
863− {[p=%a q='0x1'] [p=%b q='0x2']}
1093+> `(map @t @)`(~(run by a) dec)
1094+{[p='e' q=4] [p='b' q=1] [p='d' q=3] [p='a' q=0] [p='c' q=2]}
8641095```
8651096
8661097---
1098+
8671099### `++rut:by`
8681100
8691101Transform nodes
8701102
871−Applies a gate `b` to nodes in map `a`.
1103+Applies a gate `b` to nodes in map `a`. The sample of gate `b` is a key-value pair, and it produces a new value.
8721104
8731105#### Accepts
8741106
875−`a` is a map.
1107+`a` is a map, and is the sample of `+by`.
8761108
877−`b` is a wet gate.
1109+`b` is a gate.
8781110
8791111#### Produces
8801112
@@ -883,32 +1115,38 @@ A map.
8831115#### Source
8841116
8851117```hoon
886− ++ rut :: apply gate to nodes
887− |* b=gate
888− |-
889− ?~ a a
890− [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
1118+++ rut
1119+ |* b=gate
1120+ |-
1121+ ?~ a a
1122+ [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
8911123```
8921124
8931125#### Examples
8941126
8951127```
896− > =m (my [['a' 1] ['b' 2] ~])
1128+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3] [4 4] [5 5]])
1129+
1130+> =b |= [k=@ v=@]
1131+ ?: (gth v 2)
1132+ (mul k v)
1133+ v
1134+
1135+> `(map @ @)`(~(rut by a) b)
1136+{[p=5 q=25] [p=1 q=1] [p=2 q=2] [p=3 q=9] [p=4 q=16]}
8971137```
8981138
8991139---
1140+
9001141### `++tap:by`
9011142
9021143Listify pairs
9031144
904−Produces the list of all elements in map `a` that is prepended to list `b`,
905−which is empty by default.
1145+Produces the list of all elements in map `a`.
9061146
9071147#### Accepts
9081148
909−`a` is a map.
910−
911−`b` is a list.
1149+`a` is a map, and is the sample of `+by`.
9121150
9131151#### Produces
9141152
@@ -917,41 +1155,37 @@ A list.
9171155#### Source
9181156
9191157```hoon
920− ++ tap :: listify pairs
921− =< $
922− ~/ %tap
923− =+ b=`(list _?>(?=(^ a) n.a))`~
924− |. ^+ b
925− ?~ a
926− b
927− $(a r.a, b [n.a $(a l.a)])
1158+++ tap
1159+ =< $
1160+ ~/ %tap
1161+ =+ b=`(list _?>(?=(^ a) n.a))`~
1162+ |. ^+ b
1163+ ?~ a
1164+ b
1165+ $(a r.a, b [n.a $(a l.a)])
9281166```
9291167
9301168#### Examples
9311169
9321170```
933− > =m (my [['a' 1] ['b' 2] ~])
934− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
935− > `*`m
936− [[98 2] [[97 1] 0 0] 0]
1171+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3] [4 4] [5 5]])
9371172
938− > ~(tap by m)
939− ~[[p='b' q=2] [p='a' q=1]]
940− > `*`~(tap by m)
941− [[98 2] [97 1] 0]
1173+> ~(tap by a)
1174+~[[p=4 q=4] [p=3 q=3] [p=2 q=2] [p=1 q=1] [p=5 q=5]]
9421175```
9431176
9441177---
1178+
9451179### `++uni:by`
9461180
947−Union
1181+Union, merge
9481182
9491183Produces a map of the union between the keys of `a` and `b`. If `b` shares a
9501184key with `a`, the tuple from `b` is preserved.
9511185
9521186#### Accepts
9531187
954−`a` is a map.
1188+`a` is a map, and is the sample `+by`.
9551189
9561190`b` is a map.
9571191
@@ -962,48 +1196,105 @@ A map.
9621196#### Source
9631197
9641198```hoon
965− ++ uni :: union, merge
966− ~/ %uni
967− =+ b=a
968− |@
969− ++ $
970− |- ^+ a
971− ?~ b
972− a
973− ?~ a
974− b
975− ?: =(p.n.b p.n.a)
976− b(l $(a l.a, b l.b), r $(a r.a, b r.b))
977− ?: (mor p.n.a p.n.b)
978− ?: (gor p.n.b p.n.a)
979− $(l.a $(a l.a, r.b ~), b r.b)
980− $(r.a $(a r.a, l.b ~), b l.b)
981− ?: (gor p.n.a p.n.b)
982− $(l.b $(b l.b, r.a ~), a r.a)
983− $(r.b $(b r.b, l.a ~), a l.a)
984− --
1199+++ uni
1200+ ~/ %uni
1201+ =+ b=a
1202+ |@
1203+ ++ $
1204+ |- ^+ a
1205+ ?~ b
1206+ a
1207+ ?~ a
1208+ b
1209+ ?: =(p.n.b p.n.a)
1210+ b(l $(a l.a, b l.b), r $(a r.a, b r.b))
1211+ ?: (mor p.n.a p.n.b)
1212+ ?: (gor p.n.b p.n.a)
1213+ $(l.a $(a l.a, r.b ~), b r.b)
1214+ $(r.a $(a r.a, l.b ~), b l.b)
1215+ ?: (gor p.n.a p.n.b)
1216+ $(l.b $(b l.b, r.a ~), a r.a)
1217+ $(r.b $(b r.b, l.a ~), a l.a)
1218+ --
9851219```
9861220
9871221#### Examples
9881222
9891223```
990− > =m (my [['a' 1] ['b' 2] ~])
1224+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3]])
1225+> =b `(map @ @)`(malt ~[[3 300] [4 400] [5 500]])
1226+> a
1227+{[p=1 q=1] [p=2 q=2] [p=3 q=3]}
1228+> b
1229+{[p=5 q=500] [p=3 q=300] [p=4 q=400]}
1230+
1231+> `(map @ @)`(~(uni by a) b)
1232+{[p=5 q=500] [p=1 q=1] [p=2 q=2] [p=3 q=300] [p=4 q=400]}
1233+```
1234+
1235+---
1236+
1237+### `++uno:by`
1238+
1239+General union
9911240
992− > =o (my [['c' 3] ['d' 4] ~])
1241+Produces a map of the union between the keys of `a` and `b`. If `b` shares a key with `a`, gate `meg` is applied to both and its product is used as the new value of the key in question.
9931242
994− > (~(uni by m) o)
995− [n=[p='b' q=2] l=[n=[p='d' q=4] l={} r={[p='a' q=1] [p='c' q=3]}] r=~]
1243+#### Accepts
1244+
1245+`a` is a `map`, and is the sample of `+by`.
1246+
1247+`b` is a `map`, and is the sample of `~(uno by a)`.
1248+
1249+`meg` is a gate, and is the sample of `(~(uno by a) b)`.
1250+
1251+#### Produces
1252+
1253+A `map`.
1254+
1255+#### Source
1256+
1257+```hoon
1258+++ uno
1259+ =+ b=a
1260+ |@
1261+ ++ $
1262+ |= meg=$-([_p:node _q:node _q:node] _q:node)
1263+ |- ^+ a
1264+ ?~ b
1265+ a
1266+ ?~ a
1267+ b
1268+ ?: =(p.n.b p.n.a)
1269+ :+ [p.n.a (meg p.n.a q.n.a q.n.b)]
1270+ $(b l.b, a l.a)
1271+ $(b r.b, a r.a)
1272+ ?: (mor p.n.a p.n.b)
1273+ ?: (gor p.n.b p.n.a)
1274+ $(l.a $(a l.a, r.b ~), b r.b)
1275+ $(r.a $(a r.a, l.b ~), b l.b)
1276+ ?: (gor p.n.a p.n.b)
1277+ $(l.b $(b l.b, r.a ~), a r.a)
1278+ $(r.b $(b r.b, l.a ~), a l.a)
1279+ --
1280+```
9961281
997− > (~(uni by m) ~)
998− {[p='a' q=1] [p='b' q=2]}
1282+#### Examples
9991283
1000− > n
1001− {[p='a' q=1] [p='c' q=3]}
1002− > (~(uni by o) n)
1003− {[p='d' q=4] [p='a' q=1] [p='c' q=3]}
1284+```
1285+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3]])
1286+> =b `(map @ @)`(malt ~[[3 3] [4 4] [5 5]])
1287+> a
1288+{[p=1 q=1] [p=2 q=2] [p=3 q=3]}
1289+> b
1290+{[p=5 q=5] [p=3 q=3] [p=4 q=4]}
1291+
1292+> `(map @ @)`((~(uno by a) b) |=([k=@ v=@ w=@] (add v w)))
1293+{[p=5 q=5] [p=1 q=1] [p=2 q=2] [p=3 q=6] [p=4 q=4]}
10041294```
10051295
10061296---
1297+
10071298### `++urn:by`
10081299
10091300Turn (with key)
@@ -1015,37 +1306,32 @@ the key and the value of each element as its sample.
10151306
10161307`a` is a map.
10171308
1018−`b` is a wet gate that accepts two nouns.
1309+`b` is a gate that accepts two nouns.
10191310
10201311#### Produces
10211312
1022−A noun.
1313+A `map`.
10231314
10241315#### Source
10251316
10261317```hoon
1027− ++ urn :: apply gate to nodes
1028− ~/ %urn
1029− |* b=$-([* *] *)
1030− |-
1031− ?~ a ~
1032− a(n n.a(q (b p.n.a q.n.a)), l $(a l.a), r $(a r.a))
1318+++ urn
1319+ ~/ %urn
1320+ |* b=$-([* *] *)
1321+ |-
1322+ ?~ a ~
1323+ a(n n.a(q (b p.n.a q.n.a)), l $(a l.a), r $(a r.a))
10331324```
10341325
10351326#### Examples
10361327
10371328```
1038− > m
1039− {[p='a' q=1] [p='b' q=2]}
1040−
1041− > (~(urn by m) |=(a=(pair * *) q.a))
1042− {[p='a' q=1] [p='b' q=2]}
1329+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3]])
1330+> a
1331+{[p=1 q=1] [p=2 q=2] [p=3 q=3]}
10431332
1044− > (~(urn by m) |=(a=(pair * *) 7))
1045− {[p='a' q=7] [p='b' q=7]}
1046−
1047− > (~(urn by m) |=(a=(pair * *) p.a))
1048− {[p='a' q=97] [p='b' q=98]}
1333+> (~(urn by a) |=([k=@ v=@] (pow v 2)))
1334+{[p=1 q=1] [p=2 q=4] [p=3 q=9]}
10491335```
10501336
10511337---
@@ -1058,7 +1344,7 @@ Produce the depth of the tree map `a`.
10581344
10591345#### Accepts
10601346
1061−`a` is a map.
1347+`a` is a map, and is the sample of `+by`.
10621348
10631349#### Produces
10641350
@@ -1067,28 +1353,28 @@ An atom.
10671353#### Source
10681354
10691355```hoon
1070− ++ wyt :: depth of map
1071− =< $
1072− ~% %wyt + ~
1073− |. ^- @
1074− ?~(a 0 +((add $(a l.a) $(a r.a))))
1356+++ wyt
1357+ =< $
1358+ ~% %wyt + ~
1359+ |. ^- @
1360+ ?~(a 0 +((add $(a l.a) $(a r.a))))
10751361```
10761362
10771363#### Examples
10781364
10791365```
1080− > =m (my [['a' 1] ['b' 2] ~])
1366+> =a `(map @ @)`(malt ~[[1 1] [2 2] [3 3]])
1367+> =b `(map @ @)`(malt ~[[1 1] [2 2] [3 3] [4 4] [5 5]])
1368+> a
1369+{[p=1 q=1] [p=2 q=2] [p=3 q=3]}
1370+> b
1371+{[p=5 q=5] [p=1 q=1] [p=2 q=2] [p=3 q=3] [p=4 q=4]}
10811372
1082− > =o (my [['c' 3] ['d' 4] ~])
1373+> ~(wyt by a)
1374+3
10831375
1084− > ~(wyt by m)
1085− 2
1086−
1087− > ~(wyt by o)
1088− 2
1089−
1090− > ~(wyt by (~(uni by m) o))
1091− 4
1376+> ~(wyt by b)
1377+5
10921378```
10931379
10941380---
@@ -1097,15 +1383,12 @@ An atom.
10971383
10981384List of values
10991385
1100−Produces a list of all values in map `a` that is prepended to list `b`,
1101−which is empty by default.
1386+Produces a list of all values in map `a`.
11021387
11031388#### Accepts
11041389
11051390`a` is a map.
11061391
1107−`b` is a list.
1108−
11091392#### Produces
11101393
11111394A list.
@@ -1123,11 +1406,12 @@ A list.
11231406#### Examples
11241407
11251408```
1126− > =m (my [['a' 1] ['b' 2] ~])
1127− [n=[p='b' q=2] l={[p='a' q=1]} r={}]
1409+> =a `(map @t @)`(malt ~[['a' 1] ['b' 2] ['c' 3]])
1410+> a
1411+{[p='b' q=2] [p='a' q=1] [p='c' q=3]}
11281412
1129− > ~(val by m)
1130− ~[1 2]
1413+> ~(val by a)
1414+~[3 1 2]
11311415```
11321416
11331417---
content/docs/hoon/reference/stdlib/2j.md+263−155
@@ -4,25 +4,45 @@ weight = 13
44template = "doc.html"
55+++
66
7−### `++ja`
7+## `++ja`
88
99Jar engine
1010
11−```hoon
12− |_ a=(jar)
13−```
11+A container arm for `jar` operation arms. A `jar` is a `map` of
12+`list`s. The contained arms inherit the sample jar.
1413
15−A container arm for `++jar` operation arms. A `++jar` is a `++map` of
16−`++list`s. The contained arms inherit the sample jar.
14+#### Accepts
1715
1816`a` is a jar.
1917
18+#### Produces
19+
20+A core.
21+
22+#### Source
23+
24+```hoon
25+++ ja
26+ =| a=(tree (pair * (list))) :: (jar)
27+ |@
28+```
29+
30+#### Examples
31+
2032```
2133> ~(. ja (my [a+1 b+2 ~]))
2234< 2.ngd
23− [ a=?(%~ [n=[?(p=%a p=%b) q=@ud] l=nlr([p=?(%a %b) q=@ud]) r=nlr([p=?(%a %b) q=@ud])])
24− <123.zao 45.xig 1.pnw %140>
35+ [ a
36+ ?(
37+ %~
38+ [ n=[?(p=%a p=%b) q=@ud]
39+ l=nlr([p=?(%a %b) q=@ud])
40+ r=nlr([p=?(%a %b) q=@ud])
41+ ]
42+ )
43+ <123.zao 46.hgz 1.pnw %140>
2544 ]
45+>
2646```
2747
2848---
@@ -31,37 +51,41 @@ A container arm for `++jar` operation arms. A `++jar` is a `++map` of
3151
3252Grab value by key
3353
34−```hoon
35− ++ get :: gets list by key
36− |* b=*
37− =+ c=(~(get by a) b)
38− ?~(c ~ u.c)
39−```
54+Produces the list at key `b` in jar `a`.
4055
4156#### Accepts
4257
43−`a` is a `++jar`.
58+`a` is a `jar`, and is the sample of `+ja`.
4459
45−`b` is a key of the same type as the keys in `a`.
60+`b` is a noun.
4661
4762#### Produces
4863
49−A list retrieved from jar `a` using the key `b`.
64+A `list`.
5065
51−Examples
66+#### Source
5267
68+```hoon
69+++ get
70+ |* b=*
71+ =+ c=(~(get by a) b)
72+ ?~(c ~ u.c)
5373```
54−> =l (my [['a' (ly 1 2 3 ~)] ['b' (ly 4 5 6 ~)]~])
55−> l
56−[n=[p='b' q=[i=4 t=~[5 6]]] l={} r={[p='a' q=[i=1 t=~[2 3]]]}]
5774
58−> (~(get ja l) 'a')
59−[i=1 t=[i=2 t=~[3]]]
75+#### Examples
6076
61−> (~(get ja l) 'b')
62−[i=4 t=[i=5 t=~[6]]]
77+```
78+> =j `(jar @t @ud)`(malt ~[['a' `(list @ud)`~[1 2 3]] ['b' `(list @ud)`~[4 5 6]]])
79+> j
80+{[p='b' q=~[4 5 6]] [p='a' q=~[1 2 3]]}
81+
82+> `(list @ud)`(~(get ja j) 'a')
83+~[1 2 3]
6384
64−> (~(get ja l) 'c')
85+> `(list @ud)`(~(get ja j) 'b')
86+~[4 5 6]
87+
88+> `(list @ud)`(~(get ja j) 'c')
6589~
6690```
6791
@@ -71,114 +95,166 @@ Examples
7195
7296Prepend to list
7397
74−#### Source
75−
76−```hoon
77− ++ add :: adds key-list pair
78− |* [b=* c=*]
79− =+ d=(get b)
80− (~(put by a) b [c d])
81−```
98+Adds `c` to the head of the list at key `b` in jar `a`. If `b` does not exist in `a`, a new key-value pair is added with a list containing `c`.
8299
83100#### Accepts
84101
85−`a` is a jar.
102+`a` is a `jar`, and is the sample of `+ja`.
86103
87−`b` is a key of the same type as the keys in `a`.
104+`b` is a noun of the same type as the keys in `a`.
88105
89−`c` is a value of the same type as the values in `a`.
106+`c` is a noun of the same type the lists in `a` contain.
107+
108+#### Produces
109+
110+A `jar`.
111+
112+#### Source
113+
114+```hoon
115+++ add
116+ |* [b=* c=*]
117+ =+ d=(get b)
118+ (~(put by a) b [c d])
119+```
90120
91121#### Examples
92122
93123```
94−> =l (my [['a' (ly 1 2 3 ~)] ['b' (ly 4 5 6 ~)]~])
95−> l
96−[n=[p='b' q=[i=4 t=~[5 6]]] l={} r={[p='a' q=[i=1 t=~[2 3]]]}]
97−> (~(add ja l) 'a' 100)
98−[ n=[p='b' q=[i=4 t=[i=5 t=~[6]]]]
99− l=~
100− r=[n=[p='a' q=[i=100 t=[i=1 t=~[2 3]]]] l=~ r=~]
101−]
102−> (~(add ja l) 'a' 100)
103−[n=[p='b' q=[i=4 t=[i=5 t=~[6]]]] l=~ r=[n=[p='a' q=[i=100 t=[i=1 t=~[2 3]]]] l=~ r=~]]
104−> (~(add ja l) 'b' 7)
105−[n=[p='b' q=[i=7 t=[i=4 t=~[5 6]]]] l=~ r=[n=[p='a' q=[i=1 t=[i=2 t=~[3]]]] l=~ r=~]]
106−> (~(add ja l) 'c' 7)
107−[ n=[p='b' q=[i=4 t=[i=5 t=~[6]]]]
108− l=~
109− r=[n=[p='c' q=[i=7 t=~]] l=[n=[p='a' q=[i=1 t=~[2 3]]] l={} r={}] r=~]
110−]
111−> (~(add ja l) 'c' (ly 7 8 9 ~))
112−mull-grow
113−mull-nice
124+> =j `(jar @t @ud)`(malt ~[['a' `(list @ud)`~[1 2 3]] ['b' `(list @ud)`~[4 5 6]]])
125+> j
126+{[p='b' q=~[4 5 6]] [p='a' q=~[1 2 3]]}
127+
128+> `(jar @t @ud)`(~(add ja j) 'b' 7)
129+{[p='b' q=~[7 4 5 6]] [p='a' q=~[1 2 3]]}
130+
131+> `(jar @t @ud)`(~(add ja j) 'c' 8)
132+{[p='b' q=~[4 5 6]] [p='a' q=~[1 2 3]] [p='c' q=~[8]]}
114133```
115134
116−\*\*
135+---
117136
118−### `++ju`
137+## `++ju`
119138
120139Jug operations
121140
141+Container arm for jug operation arms. A `jug` is a `map` of
142+`set`s. The contained arms inherit its sample jug, `a`.
143+
144+#### Accepts
145+
146+`a` is a `jug`.
147+
148+#### Produces
149+
150+A core.
151+
152+#### Source
153+
122154```hoon
123− ++ ju :: jug engine
124− |/ a=(jug)
155+++ ju
156+ =| a=(tree (pair * (tree))) :: (jug)
157+ |@
125158```
126159
127−Container arm for jug operation arms. A `++jug` is a `++map` of
128−`++sets`. The contained arms inherit its sample jug, `a`.
129−
130−`a` is a jug.
160+#### Example
131161
132162```
133−> ~(. ju (my [[a (sy 1 ~)] [b (sy 2 ~)] ~]))
134−< 5.cws
135− [ a
136− ?(
137− %~
138− [ n=[p=@ub ?(q=%~ q=[?(n=@ud #!) l=nlr(?(@ud #!)) r=nlr(?(@ud #!))])]
139− l=nlr([p=@ub q=?(%~ [?(n=@ud #!) l=nlr(?(@ud #!)) r=nlr(?(@ud #!))])])
140− r=nlr([p=@ub q=?(%~ [?(n=@ud #!) l=nlr(?(@ud #!)) r=nlr(?(@ud #!))])])
141− ]
142− )
143− <123.zao 45.xig 1.pnw %140>
144− ]
163+> =j `(jug @t @ud)`(malt ~[['a' (silt ~[1 2 3])] ['b' (silt ~[4 5 6])]])
164+> j
165+{[p='b' q={5 6 4}] [p='a' q={1 2 3}]}
166+
167+> ~(. ju j)
168+<5.cws [a=nlr([p=@t q=nlr(@ud)]) <123.zao 46.hgz 1.pnw %140>]>
145169```
146170
171+---
172+
147173### `++del:ju`
148174
149175Remove
150176
177+Produces jug `a` with value `c` removed from set located at key `b`.
178+
179+#### Accepts
180+
181+`a` is a jug, and is the sample of `+ju`.
182+
183+`b` is a noun of the same type as the keys in `a`.
184+
185+`c` is a noun of the same type as the sets in `a` contain.
186+
151187#### Source
152188
153189```hoon
154− ++ del :: del key-set pair
155− |* [b=* c=*]
156− ^+ a
157− =+ d=(get b)
158− =+ e=(~(del in d) c)
159− ?~ e
160− (~(del by a) b)
161− (~(put by a) b e)
190+++ del
191+ |* [b=* c=*]
192+ ^+ a
193+ =+ d=(get b)
194+ =+ e=(~(del in d) c)
195+ ?~ e
196+ (~(del by a) b)
197+ (~(put by a) b e)
162198```
163199
164−Produces jug `a` with value `c` removed from set located at key `b`.
200+#### Examples
165201
166−`a` is a jug.
202+```
203+> j
204+{[p='b' q={5 6 4}] [p='a' q={1 2 3}]}
167205
168−`b` is a key of the same type as the keys in `a`.
206+> `(jug @t @ud)`(~(del ju j) 'b' 6)
207+{[p='b' q={5 4}] [p='a' q={1 2 3}]}
169208
170−`c` is the value of the same type of the keys in `a` that is to be
171−removed.
209+> `(jug @t @ud)`(~(del ju j) 'b' 10)
210+{[p='b' q={5 6 4}] [p='a' q={1 2 3}]}
172211
212+> `(jug @t @ud)`(~(del ju j) 'c' 10)
213+{[p='b' q={5 6 4}] [p='a' q={1 2 3}]}
173214```
174− > s
175− [[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
176215
177− > (~(del ju s) 'a' 1)
178− {[p='a' q={3 2}] [p='b' q={5 4 6}]}
216+---
217+
218+### `++gas:ju`
219+
220+Concatenate
221+
222+Add each of the key-value pairs in list `b` to jug `a`. The values in `b` are the type the sets in `a` contain. For keys in `b` that exist in `a`, the values will be added to their sets. For keys in `b` that don't exist in `a`, new keys and sets will be added.
223+
224+#### Accepts
225+
226+`a` is a `jug`, and is the sample of `+ju`.
179227
180− > (~(del ju s) 'c' 7)
181− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
228+`b` is a `(list [p q])`, where:
229+
230+- `p` is a noun, the type of the keys in `a`.
231+- `q` is a noun, the type the sets in `a` contain.
232+
233+#### Produces
234+
235+A `jug`.
236+
237+#### Source
238+
239+```hoon
240+++ gas
241+ |* b=(list [p=* q=*])
242+ => .(b `(list _?>(?=([[* ^] ^] a) [p=p q=n.q]:n.a))`b)
243+ |- ^+ a
244+ ?~ b
245+ a
246+ $(b t.b, a (put p.i.b q.i.b))
247+```
248+
249+#### Examples
250+
251+```
252+> =j `(jug @t @ud)`(malt ~[['a' (silt ~[1 2 3])] ['b' (silt ~[4 5 6])]])
253+> j
254+{[p='b' q={5 6 4}] [p='a' q={1 2 3}]}
255+
256+> `(jug @t @ud)`(~(gas ju j) ~[['a' 10] ['a' 42] ['b' 999] ['c' 7]])
257+{[p='b' q={5 6 4 999}] [p='a' q={10 42 1 2 3}] [p='c' q={7}]}
182258```
183259
184260---
@@ -187,28 +263,42 @@ removed.
187263
188264Retrieve set
189265
266+Produces a set retrieved from jar `a` using key `b`.
267+
268+#### Accepts
269+
270+`a` is a jar, and the sample of `+ju`.
271+
272+`b` is key, a noun of the same type as the keys in `a`.
273+
274+#### Produces
275+
276+A `set`.
277+
278+#### Source
279+
190280```hoon
191− ++ get :: gets set by key
192− |* b=*
193− =+ c=(~(get by a) b)
194− ?~(c ~ u.c)
281+++ get
282+ |* b=*
283+ =+ c=(~(get by a) b)
284+ ?~(c ~ u.c)
195285```
196286
197−Produces a set retrieved from jar `a` using key `b`.
287+#### Examples
198288
199−`a` is a jar.
289+```
290+> =j `(jug @t @ud)`(malt ~[['a' (silt ~[1 2 3])] ['b' (silt ~[4 5 6])]])
291+> j
292+{[p='b' q={5 6 4}] [p='a' q={1 2 3}]}
200293
201−`b` is a key of the same type as the keys in `a`.
294+> `(set @ud)`(~(get ju j) 'a')
295+{1 2 3}
202296
203−```
204− > s
205− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
206− > (~(get ju s) 'a')
207− {1 3 2}
208− > (~(get ju s) 'b')
209− {5 4 6}
210− > (~(get ju s) 'c')
211− ~
297+> `(set @ud)`(~(get ju j) 'b')
298+{5 6 4}
299+
300+> `(set @ud)`(~(get ju j) 'c')
301+{}
212302```
213303
214304---
@@ -217,37 +307,45 @@ Produces a set retrieved from jar `a` using key `b`.
217307
218308Check contents
219309
310+Computes whether a value `c` exists within the set located at key `b`
311+with jug `a`, producing a flag.
312+
313+#### Accepts
314+
315+`a` is a `jug`, and the sample of `+ju`.
316+
317+`b` is a noun of the same type as the keys in `a`.
318+
319+`c` is a noun of the same type as the sets in `a` contain.
320+
321+#### Produces
322+
323+A `?`.
324+
325+#### Source
326+
220327```hoon
221− ++ has :: existence check
222− |* [b=* c=*]
223− ^- ?
224− (~(has in (get b)) c)
328+++ has
329+ |* [b=* c=*]
330+ ^- ?
331+ (~(has in (get b)) c)
225332```
226333
227−Computes whether a value `c` exists within the set located at key `b`
228−with jar `a`. Produces a loobean.
334+#### Examples
229335
230−`a` is a set.
336+```
337+> =j `(jug @t @ud)`(malt ~[['a' (silt ~[1 2 3])] ['b' (silt ~[4 5 6])]])
338+> j
339+{[p='b' q={5 6 4}] [p='a' q={1 2 3}]}
231340
232−`b` is a key as a noun.
341+> (~(has ju j) 'b' 5)
342+%.y
233343
234−`c` is a value as a noun.
344+> (~(has ju j) 'b' 10)
345+%.n
235346
236−```
237− > s
238− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
239− > (~(has ju s) 'a' 3)
240− %.y
241− > (~(has ju s) 'b' 6)
242− %.y
243− > (~(has ju s) 'a' 7)
244− %.n
245− > (~(has jus s) 'c' 7)
246− ! -find-limb.jus
247− ! find-none
248− ! exit
249− > (~(has ju s) 'c' 7)
250− %.n
347+> (~(has ju j) 'c' 10)
348+%.n
251349```
252350
253351---
@@ -256,34 +354,44 @@ with jar `a`. Produces a loobean.
256354
257355Add key-set pair
258356
259−```hoon
260− ++ put :: add key-set pair
261− |* [b=* c=*]
262− ^+ a
263− =+ d=(get b)
264− (~(put by a) b (~(put in d) c))
265−```
357+Produces jug `a` with `c` added to the set located at key `b`. If `b` isn't a key in `a`, it will be added and a new set created containing `c`.
358+
359+#### Accepts
266360
267−Produces jar `a` with `c` added to the set value located at key `b`.
361+`a` is a `jug`.
268362
269−`a` is a set.
363+`b` is a noun, the type of the keys in `a`.
270364
271−`b` is a key as a noun.
365+`c` is a noun, the type the sets in `a` contain.
272366
273−`c` is a value.
367+#### Produces
368+
369+A `jug`.
370+
371+#### Source
372+
373+```hoon
374+++ put
375+ |* [b=* c=*]
376+ ^+ a
377+ =+ d=(get b)
378+ (~(put by a) b (~(put in d) c))
379+```
380+
381+#### Examples
274382
275383```
276− > s
277− [p='a' q=[1 3 2]] [p='b' q=[5 4 6]]]
384+> j
385+{[p='b' q={5 6 4}] [p='a' q={1 2 3}]}
278386
279− > (~(put ju s) 'a' 7)
280− {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]}
387+> `(jug @t @ud)`(~(put ju j) 'c' 5)
388+{[p='b' q={5 6 4}] [p='a' q={1 2 3}] [p='c' q={5}]}
281389
282− > (~(put ju s) 'a' 1)
283− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
390+> `(jug @t @ud)`(~(put ju j) 'a' 4)
391+{[p='b' q={5 6 4}] [p='a' q={1 2 3 4}]}
284392
285− > (~(put ju s) 'c' 7)
286− {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]}
393+> `(jug @t @ud)`(~(put ju j) 'a' 1)
394+{[p='b' q={5 6 4}] [p='a' q={1 2 3}]}
287395```
288396
289397---
content/docs/hoon/reference/stdlib/2k.md+191−135
@@ -4,8 +4,7 @@ weight = 14
44template = "doc.html"
55+++
66
7−### `++to`
8−
7+## `++to`
98
109Queue operations
1110
@@ -19,8 +18,9 @@ sample queue.
1918#### Source
2019
2120```hoon
22− ++ to
23− |_ a=(tree)
21+++ to
22+ =| a=(tree) :: (qeu)
23+ |@
2424```
2525
2626#### Discussion
@@ -31,50 +31,99 @@ interfaces. `to` is the interface core for `qeu`; it's not generic across all
3131the different containers that use `tree`.
3232
3333---
34−### `++bal:to`
3534
36−Balance
35+### `+apt:to`
3736
38−Vertically rebalances queue `a`.
37+Check correctness
38+
39+Test whether queue `a` is correctly ordered, producing a flag.
3940
4041#### Accepts
4142
42−`a` is a queue.
43+`a` is a `que`.
4344
4445#### Produces
4546
46−A queue.
47+A `?`.
4748
4849#### Source
4950
5051```hoon
51− ++ bal
52− |- ^+ a
53− ?~ a ~
54− ?. |(?=(~ l.a) (mor n.a n.l.a))
55− $(a l.a(r $(a a(l r.l.a))))
56− ?. |(?=(~ r.a) (mor n.a n.r.a))
57− $(a r.a(l $(a a(r l.r.a))))
58− a
52+++ apt
53+ |- ^- ?
54+ ?~ a &
55+ ?& ?~(l.a & ?&((mor n.a n.l.a) $(a l.a)))
56+ ?~(r.a & ?&((mor n.a n.r.a) $(a r.a)))
57+ ==
5958```
6059
6160#### Examples
6261
6362```
64− > `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]
65− {"a" "b" "c" "d" "e" "f" "g"}
63+> =bad `(qeu @ud)`[1 ~ 2 ~ 3 ~ ~]
64+
65+> ~(apt to bad)
66+%.n
67+```
68+
69+```
70+> =good `(qeu @ud)`(~(gas to `(qeu @ud)`~) ~[1 2 3])
71+
72+> ~(apt to good)
73+%.y
74+```
75+
76+---
77+
78+### `++bal:to`
79+
80+Balance
81+
82+Vertically rebalances queue `a`.
83+
84+#### Accepts
6685
67− > `*`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]
68− [[97 0] 0 [98 0] 0 [99 0] 0 [100 0] 0 [101 0] 0 [102 0] 0 [103 0] 0 0]
86+`a` is a `qeu`.
6987
70− > ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
71− [n=[i='d' t=""] l={"a" "b" "c"} r={"e" "f" "g"}]
88+#### Produces
89+
90+A `qeu`.
91+
92+#### Source
93+
94+```hoon
95+++ bal
96+ |- ^+ a
97+ ?~ a ~
98+ ?. |(?=(~ l.a) (mor n.a n.l.a))
99+ $(a l.a(r $(a a(l r.l.a))))
100+ ?. |(?=(~ r.a) (mor n.a n.r.a))
101+ $(a r.a(l $(a a(r l.r.a))))
102+ a
103+```
104+
105+#### Examples
72106
73− > `*`~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
74− [[100 0] [[99 0] [[98 0] [[97 0] 0 0] 0] 0] [101 0] 0 [102 0] 0 [103 0] 0 0]
107+```
108+> =a `(qeu @ud)`[1 ~ 2 ~ 3 ~ ~]
109+> a
110+{1 2 3}
111+> `*`a
112+[1 0 2 0 3 0 0]
113+> ~(apt to a)
114+%.n
115+
116+> =z `(qeu @ud)`~(bal to a)
117+> z
118+{1 2 3}
119+> `*`z
120+[2 [1 0 0] 3 0 0]
121+> ~(apt to z)
122+%.y
75123```
76124
77125---
126+
78127### `++dep:to`
79128
80129Maximum Depth
@@ -92,35 +141,36 @@ An atom.
92141#### Source
93142
94143```hoon
95− ++ dep :: max depth of queue
96− |- ^- @
97− ?~ a 0
98− +((max $(a l.a) $(a r.a)))
144+++ dep
145+ |- ^- @
146+ ?~ a 0
147+ +((max $(a l.a) $(a r.a)))
99148```
100149
101150#### Examples
102151
103152```
104− > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 7 ~])
105− > ~(dep to a)
106− 4
153+> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 7 ~])
154+> ~(dep to a)
155+4
107156
108− > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 ~])
109− > ~(dep to a)
110− 3
157+> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 ~])
158+> ~(dep to a)
159+3
111160
112− > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 ~])
113− > ~(dep to a)
114− 2
161+> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 ~])
162+> ~(dep to a)
163+2
115164
116− > ~(dep to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
117− 7
165+> ~(dep to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
166+7
118167
119− > ~(dep to ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]))
120− 4
168+> ~(dep to ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]))
169+4
121170```
122171
123172---
173+
124174### `++gas:to`
125175
126176Push list
@@ -129,7 +179,7 @@ Push all elements of list `b` into the queue `a`.
129179
130180#### Accepts
131181
132−`a` is a queue.
182+`a` is a queue, and is the sample of `+to`.
133183
134184`b` is a list.
135185
@@ -140,25 +190,26 @@ A queue.
140190#### Source
141191
142192```hoon
143− ++ gas :: insert list to que
144− |= b=(list _?>(?=(^ a) n.a))
145− |- ^+ a
146− ?~(b a $(b t.b, a (put i.b)))
193+++ gas
194+ |= b=(list _?>(?=(^ a) n.a))
195+ |- ^+ a
196+ ?~(b a $(b t.b, a (put i.b)))
147197```
148198
149−
150199#### Examples
151200
152201```
153− > `(qeu)`(~(gas to `(qeu @)`~) [1 2 3 ~])
154− {3 2 1}
202+> `(qeu)`(~(gas to `(qeu @)`~) [1 2 3 ~])
203+{3 2 1}
155204
156− > =a (~(gas to `(qeu @)`~) [1 2 3 ~])
157− > =b [4 5 6 ~]
158− > `(qeu)`(~(gas to a) b)
159− {6 5 4 3 2 1}
205+> =a (~(gas to `(qeu @)`~) [1 2 3 ~])
206+> =b [4 5 6 ~]
207+> `(qeu)`(~(gas to a) b)
208+{6 5 4 3 2 1}
160209```
210+
161211---
212+
162213### `++get:to`
163214
164215Head-tail pair
@@ -176,31 +227,32 @@ A cell of the last element in `a` along with the rest of queue `a`.
176227#### Source
177228
178229```hoon
179− ++ get :: head-rest pair
180− |- ^+ ?>(?=(^ a) [p=n.a q=*(tree _n.a)])
181− ?~ a
182− !!
183− ?~ r.a
184− [n.a l.a]
185− =+ b=$(a r.a)
186− :- p.b
187− ?: |(?=(~ q.b) (mor n.a n.q.b))
188− a(r q.b)
189− a(n n.q.b, l a(r l.q.b), r r.q.b)
230+++ get
231+ |- ^+ ?>(?=(^ a) [p=n.a q=*(tree _n.a)])
232+ ?~ a
233+ !!
234+ ?~ r.a
235+ [n.a l.a]
236+ =+ b=$(a r.a)
237+ :- p.b
238+ ?: |(?=(~ q.b) (mor n.a n.q.b))
239+ a(r q.b)
240+ a(n n.q.b, l a(r l.q.b), r r.q.b)
190241```
191242
192243#### Examples
193244
194245```
195− > =s (~(gas to *(tree @)) `(list @)`~[1 2 3])
196− > ~(get to s)
197− [n=2 l={3} r={1}]
246+> =s (~(gas to *(tree @)) `(list @)`~[1 2 3])
247+> ~(get to s)
248+[n=2 l={3} r={1}]
198249
199− > ~(get to ~)
200− ! exit
250+> ~(get to ~)
251+! exit
201252```
202253
203254---
255+
204256### `++nap:to`
205257
206258Remove head
@@ -218,39 +270,40 @@ A queue.
218270#### Source
219271
220272```hoon
221− ++ nap :: removes root
222− ?> ?=(^ a)
223− ?: =(~ l.a) r.a
224− =+ b=get(a l.a)
225− bal(n.a p.b, l.a q.b)
273+++ nap
274+ ?> ?=(^ a)
275+ ?: =(~ l.a) r.a
276+ =+ b=get(a l.a)
277+ bal(n.a p.b, l.a q.b)
226278```
227279
228280#### Examples
229281
230282```
231− > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
232− > -.a
233− n=6
283+> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
284+> -.a
285+n=6
234286
235− > =b ~(nap to a)
236− > -.b
237− n=2
287+> =b ~(nap to a)
288+> -.b
289+n=2
238290
239− > a
240− [n=6 l={} r={5 4 3 2 1}]
291+> a
292+[n=6 l={} r={5 4 3 2 1}]
241293
242− > b
243− [n=2 l=[n=4 l={5} r={3}] r=[n=1 l={} r={}]]
294+> b
295+[n=2 l=[n=4 l={5} r={3}] r=[n=1 l={} r={}]]
244296
245− > `(qeu)`b
246− {5 4 3 2 1}
297+> `(qeu)`b
298+{5 4 3 2 1}
247299
248− > `(qeu)`a
249− {6 5 4 3 2 1}
300+> `(qeu)`a
301+{6 5 4 3 2 1}
250302```
251303
252304---
253−### `++nip:to`
305+
306+### `++nip:to`
254307
255308Removes the root of queue `a`, producing the resulting queue.
256309
@@ -265,40 +318,41 @@ A queue.
265318#### Source
266319
267320```hoon
268− ++ nip :: removes root
269− |- ^+ a
270− ?~ a ~
271− ?~ l.a r.a
272− ?~ r.a l.a
273− ?: (mor n.l.a n.r.a)
274− l.a(r $(l.a r.l.a))
275− r.a(l $(r.a l.r.a))
321+++ nip
322+ |- ^+ a
323+ ?~ a ~
324+ ?~ l.a r.a
325+ ?~ r.a l.a
326+ ?: (mor n.l.a n.r.a)
327+ l.a(r $(l.a r.l.a))
328+ r.a(l $(r.a l.r.a))
276329```
277330
278331#### Examples
279332
280333```
281− > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
282− > a
283− [n=6 l={} r={5 4 3 2 1}]
334+> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
335+> a
336+[n=6 l={} r={5 4 3 2 1}]
284337
285− > ~(nip to a)
286− [n=2 l=[n=4 l={5} r={3}] r=[n=1 l={} r={}]]
338+> ~(nip to a)
339+[n=2 l=[n=4 l={5} r={3}] r=[n=1 l={} r={}]]
287340```
288341
289342---
343+
290344### `++put:to`
291345
292346Insert
293347
294−Accept any noun `b` and adds to queue `a` as the head, producing the
348+Accept noun `b` and adds to queue `a` as the head, producing the
295349resulting queue.
296350
297351#### Accepts
298352
299−`a` is a queue.
353+`a` is a queue, and is the sample of `+to`.
300354
301−`b` is any noun.
355+`b` is a noun.
302356
303357#### Produces
304358
@@ -307,23 +361,24 @@ A queue.
307361#### Source
308362
309363```hoon
310− ++ put :: insert new tail
311− |* b=*
312− |- ^+ a
313− ?~ a
314− [b ~ ~]
315− bal(l.a $(a l.a))
364+++ put
365+ |* b=*
366+ |- ^+ a
367+ ?~ a
368+ [b ~ ~]
369+ bal(l.a $(a l.a))
316370```
317371
318372#### Examples
319373
320374```
321− > =a (~(gas to `(qeu @)`~) `(list @)`[3 1 2 4 5 6 ~])
322− > `(qeu)`(~(put to a) 7)
323− {7 6 5 4 2 1 3}
375+> =a (~(gas to `(qeu @)`~) `(list @)`[3 1 2 4 5 6 ~])
376+> `(qeu)`(~(put to a) 7)
377+{7 6 5 4 2 1 3}
324378```
325379
326380---
381+
327382### `++tap:to`
328383
329384Queue to list
@@ -341,26 +396,28 @@ A list.
341396#### Source
342397
343398```hoon
344− ++ tap :: adds list to end
345− =+ b=`(list _?>(?=(^ a) n.a))`~
346− |- ^+ b
347− =+ 0 :: hack for jet match
348− ?~ a
349− b
350− $(a r.a, b [n.a $(a l.a)])
399+++ tap
400+ =+ b=`(list _?>(?=(^ a) n.a))`~
401+ |- ^+ b
402+ =+ 0 :: hack for jet match
403+ ?~ a
404+ b
405+ $(a r.a, b [n.a $(a l.a)])
351406```
352407
353408#### Examples
354409
355410```
356− > =a (~(gas to `(qeu @)`~) [3 1 2 4 5 6 ~])
357− > `*`a
358− [6 0 2 [4 [5 0 0] 0] 1 0 3 0 0]
359− > ~(tap to a)
360− ~[3 1 2 4 5 6]
411+> =a (~(gas to `(qeu @)`~) [3 1 2 4 5 6 ~])
412+> `*`a
413+[6 0 2 [4 [5 0 0] 0] 1 0 3 0 0]
414+
415+> ~(tap to a)
416+~[3 1 2 4 5 6]
361417```
362418
363419---
420+
364421### `++top:to`
365422
366423Produce head
@@ -378,19 +435,18 @@ A unit.
378435#### Source
379436
380437```hoon
381− ++ top :: produces head
382− |- ^- (unit _?>(?=(^ a) n.a))
383− ?~ a ~
384− ?~(r.a [~ n.a] $(a r.a))
385− --
438+++ top
439+ |- ^- (unit _?>(?=(^ a) n.a))
440+ ?~ a ~
441+ ?~(r.a [~ n.a] $(a r.a))
386442```
387443
388444#### Examples
389445
390446```
391− > =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
392− > ~(top to a)
393− [~ u=1]
447+> =a (~(gas to `(qeu @)`~) `(list @)`[1 2 3 4 5 6 ~])
448+> ~(top to a)
449+[~ u=1]
394450```
395451
396452#### Discussion
content/docs/hoon/reference/stdlib/2l.md+5−3
@@ -4,7 +4,7 @@ weight = 15
44template = "doc.html"
55+++
66
7−### `++malt`
7+## `++malt`
88
99Map from list
1010
@@ -37,7 +37,8 @@ A map.
3737```
3838
3939---
40−### `++molt`
40+
41+## `++molt`
4142
4243Map from pair list
4344
@@ -75,7 +76,8 @@ A map.
7576Only used internally as a helper to `malt`.
7677
7778---
78−### `++silt`
79+
80+## `++silt`
7981
8082Set from list
8183
content/docs/hoon/reference/stdlib/2m.md+40−32
@@ -4,7 +4,7 @@ weight = 16
44template = "doc.html"
55+++
66
7−### `++ly`
7+## `++ly`
88
99List from raw noun
1010
@@ -40,7 +40,8 @@ A `list`.
4040`ly` is an alias for `le:nl`.
4141
4242---
43−### `++my`
43+
44+## `++my`
4445
4546Map from raw noun
4647
@@ -73,7 +74,8 @@ A `map`.
7374`my` is an alias for `my:nl`.
7475
7576---
76−### `++sy`
77+
78+## `++sy`
7779
7880Set from raw noun
7981
@@ -112,7 +114,8 @@ A `set`.
112114`sy` is an alias for `si:nl`.
113115
114116---
115−### `++nl`
117+
118+## `++nl`
116119
117120Noun-to-container operations
118121
@@ -127,6 +130,7 @@ nouns.
127130```
128131
129132---
133+
130134### `++le:nl`
131135
132136Construct list
@@ -144,12 +148,12 @@ A list.
144148#### Source
145149
146150```hoon
147− ++ le :: construct list
148− |* a=(list)
149− ^+ =< $
150− |@ ++ $ ?:(*? ~ [i=(snag 0 a) t=$])
151− --
152− a
151+++ le
152+ |* a=(list)
153+ ^+ =< $
154+ |@ ++ $ ?:(*? ~ [i=(snag 0 a) t=$])
155+ --
156+ a
153157```
154158
155159#### Examples
@@ -163,6 +167,7 @@ A list.
163167```
164168
165169---
170+
166171### `++my:nl`
167172
168173Construct map
@@ -181,10 +186,10 @@ A map.
181186#### Source
182187
183188```hoon
184− ++ my
185− |* a=(list (pair))
186− => .(a ^+((le a) a))
187− (~(gas by `(map _p.i.-.a _q.i.-.a)`~) a)
189+++ my
190+ |* a=(list (pair))
191+ => .(a ^+((le a) a))
192+ (~(gas by `(map _p.i.-.a _q.i.-.a)`~) a)
188193```
189194
190195#### Examples
@@ -195,6 +200,7 @@ A map.
195200```
196201
197202---
203+
198204### `++si:nl`
199205
200206Construct set
@@ -212,10 +218,10 @@ A set.
212218#### Source
213219
214220```hoon
215− ++ si
216− |* a=(list)
217− => .(a ^+((le a) a))
218− (~(gas in `(set _i.-.a)`~) a)
221+++ si
222+ |* a=(list)
223+ => .(a ^+((le a) a))
224+ (~(gas in `(set _i.-.a)`~) a)
219225```
220226
221227#### Examples
@@ -226,6 +232,7 @@ A set.
226232```
227233
228234---
235+
229236### `++snag:nl`
230237
231238Index
@@ -246,13 +253,13 @@ A noun.
246253#### Sources
247254
248255```hoon
249− ++ snag
250− |* [a=@ b=(list)]
251− ?~ b
252− ~_ leaf+"snag-fail"
253− !!
254− ?: =(0 a) i.b
255− $(b t.b, a (dec a))
256+++ snag
257+ |* [a=@ b=(list)]
258+ ?~ b
259+ ~_ leaf+"snag-fail"
260+ !!
261+ ?: =(0 a) i.b
262+ $(b t.b, a (dec a))
256263```
257264
258265#### Examples
@@ -268,6 +275,7 @@ A noun.
268275```
269276
270277---
278+
271279### `++weld:nl`
272280
273281Concatenate
@@ -287,13 +295,13 @@ A list.
287295#### Source
288296
289297```hoon
290− ++ weld
291− |* [a=(list) b=(list)]
292− => .(a ^+((le a) a), b ^+((le b) b))
293− =+ 42
294− |-
295− ?~ a b
296− [i=i.a t=$(a t.a)]
298+++ weld
299+ |* [a=(list) b=(list)]
300+ => .(a ^+((le a) a), b ^+((le b) b))
301+ =+ 42
302+ |-
303+ ?~ a b
304+ [i=i.a t=$(a t.a)]
297305```
298306
299307#### Examples
content/docs/hoon/reference/stdlib/2n.md+152−138
@@ -4,7 +4,39 @@ weight = 17
44template = "doc.html"
55+++
66
7−### `++cork`
7+## `++aftr`
8+
9+Pair after
10+
11+`+aftr` first takes gate `a`, producing a wet gate. The new wet gate then takes `b`, producing the inverted pair of `[b a]`. This is the inverted version of [+fore](#fore).
12+
13+#### Accepts
14+
15+`a` is a gate, and the sample of `+aftr`.
16+
17+`b` is a gate, and the sample of `(aftr a)`.
18+
19+#### Produces
20+
21+`(pair b a)`.
22+
23+#### Source
24+
25+```hoon
26+++ aftr |*(a=$-(* *) |*(b=$-(* *) (pair b a)))
27+```
28+
29+#### Examples
30+
31+```
32+> =a (aftr @ud)
33+> `(a @t)`['foo' 42]
34+[p='foo' q=42]
35+```
36+
37+---
38+
39+## `++cork`
840
941Compose forward
1042
@@ -37,7 +69,7 @@ Build `f` such that `(f x) .= (b (a x))`.
3769
3870---
3971
40−### `++corl`
72+## `++corl`
4173
4274Compose backward
4375
@@ -52,7 +84,7 @@ Build `f` such that
5284#### Source
5385
5486```hoon
55−++ corl :: compose backwards
87+++ corl
5688 |* [a=$-(* *) b=$-(* *)]
5789 =< +:|.((a (b))) :: type check
5890 =+ c=+<.b
@@ -69,7 +101,7 @@ Build `f` such that
69101
70102---
71103
72−### `++curr` {#curry}
104+## `++curr` {#curry}
73105
74106Right curry
75107
@@ -88,10 +120,11 @@ A gate.
88120#### Source
89121
90122```hoon
91− ++ curr
92− |* [a=_|=(^ **) c=*}
93− |* b=_+<+.a
94− (a b c)
123+++ curr
124+ |* [a=$-(^ *) c=*]
125+ =+ b=+<+.a
126+ |@ ++ $ (a b c)
127+ --
95128```
96129
97130#### Examples
@@ -107,7 +140,7 @@ A gate.
107140
108141---
109142
110−### `++cury`
143+## `++cury`
111144
112145Curry left
113146
@@ -126,10 +159,11 @@ A gate.
126159#### Source
127160
128161```hoon
129− ++ cury
130− |* [a=_|=(^ **) b=*}
131− |* c=_+<+.a
132− (a b c)
162+++ cury
163+ |* [a=$-(^ *) b=*]
164+ =+ c=+<+.a
165+ |@ ++ $ (a b c)
166+ --
133167```
134168
135169#### Examples
@@ -145,79 +179,39 @@ A gate.
145179
146180---
147181
148−### `++hard`
182+## `++fore`
149183
150−Force remold
184+Pair before
151185
152−Demands that a specific type be produced, crashing the program if it is
153−not.
186+`+fore` first takes gate `a`, producing a wet gate. The new wet gate then takes `b`, producing the pair of `[a b]`.
154187
155−#### Source
156−
157−```hoon
158− ++ hard
159− |* han=gate
160− |= fud=* ^- han
161− ~_ leaf+"hard"
162− =+ gol=(han fud)
163− ?>(=(gol fud) gol)
164−```
165−
166−#### Examples
167−
168−```
169− > ((hard (list)) (limo [1 2 3 ~]))
170− ~[1 2 3]
171− > ((hard @) (add 2 2))
172− 4
173− > ((hard @t) (crip "Tape to cord, bro!"))
174− 'Tape to cord, bro'
175− > ((hard tape) (crip "...Tape to cord, bro?..."))
176− ! hard
177− ! exit
178−```
188+#### Accepts
179189
180−---
190+`a` is a gate, and is the sample of `+fore`.
181191
182−### `++soft`
192+`b` is a gate, and is the sample of `(fore a)`.
183193
184−Maybe remold
194+#### Produces
185195
186−Politely requests a specific type to be produced, producing null if it
187−is not.
196+`(pair a b)`.
188197
189198#### Source
190199
191200```hoon
192− ++ soft
193− |* han=gate
194− |= fud=* ^- (unit han)
195− =+ gol=(han fud)
196− ?.(=(gol fud) ~ [~ gol])
201+++ fore |*(a=$-(* *) |*(b=$-(* *) (pair a b)))
197202```
198203
199204#### Examples
200205
201206```
202− > ((soft %4) (add 2 2))
203− [~ %4]
204−
205− > ((soft @) (add 2 2))
206− [~ 4]
207−
208− > ((soft %5) (add 2 2))
209− ~
210−
211− > ((soft @t) (crip "Tape to cord, Woohoo!"))
212− [~ 'Tape to cord, Woohoo!']
213−
214− > ((soft @t) (trip 'Cmon man... Tape to cord? Please?!'))
215− ~
207+> =a (fore @ud)
208+> `(a @t)`[42 'foo']
209+[p=42 q='foo']
216210```
217211
218212---
219213
220−### `++head`
214+## `++head`
221215
222216Get head
223217
@@ -229,30 +223,30 @@ A cell.
229223
230224#### Produces
231225
232−An atom.
226+A noun.
233227
234228#### Source
235229
236230```hoon
237− ++ head |*(^ ,:+<-)
231+++ head |*(^ ,:+<-)
238232```
239233
240234#### Examples
241235
242236```
243− > (head [1 2])
244− 1
237+> (head [1 2])
238+1
245239
246− > (head [[1 1] 2])
247− [1 1]
240+> (head [[1 1] 2])
241+[1 1]
248242
249− > (head "hello")
250− 'h'
243+> (head "hello")
244+'h'
251245```
252246
253247---
254248
255−### `++same`
249+## `++same`
256250
257251Identity
258252
@@ -269,98 +263,54 @@ A noun.
269263#### Source
270264
271265```hoon
272− ++ same |*(* +<)
266+++ same |*(* +<)
273267```
274268
275269#### Examples
276270
277271```
278− > (same [1 2])
279− [1 2]
272+> (same [1 2])
273+[1 2]
280274
281− > (same [[1 1] 2])
282− [[1 1] 2]
275+> (same [[1 1] 2])
276+[[1 1] 2]
283277
284− > (same "hello")
285− "hello"
278+> (same "hello")
279+"hello"
286280```
287281
288282---
289283
290−### `++slog`
284+## `++succ`
291285
292−Deify printf
286+Successor
293287
294−Produces a stack trace if the stack trace isn't null, then produces the other
295−input.
288+Increment an atom.
296289
297290#### Accepts
298291
299−A `tang`.
292+An `atom`.
300293
301294#### Produces
302295
303−A `tang`.
296+An `atom`.
304297
305298#### Source
306299
307300```hoon
308− ++ slog
309− =| pri=@
310− |= a=tang ^+ same
311− ?~(a same ~>(%slog.[pri i.a] $(a t.a)))
301+++ succ |=(@ +(+<))
312302```
313303
314304#### Examples
315305
316306```
317− > =+ result=((slog [%leaf "error-message"]~) [12 13]) [%product result]
318− [%product 12 13]
307+> (succ 1)
308+2
319309```
320310
321−#### Discussion
322−
323−`slog` is intended to be put in the middle of a bunch of chained function
324−calls that string a piece of data through them, so that an error message will be
325−printed if there's one to print.
326−
327311---
328312
329−### `++mean`
330−
331−Crash and printf
332−
333−Ends the program and produces a `tang` tracing error message.
334−
335−#### Accepts
336−
337−`a` is a tang.
338−
339−#### Produces
340−
341−A crash.
342−
343−#### Source
344−
345−```hoon
346− ++ mean
347− |= a=tang
348− ^+ !!
349− ?~ a !!
350− ~_(i.a $(a t.a))
351−```
352−
353−#### Examples
354−
355−```
356− > ~>(%mean.[%leaf "fuse-loop"] !!)
357− ####
358− !! crash
359−```
360−
361−---
362−
363−### `++tail`
313+## `++tail`
364314
365315Get tail
366316
@@ -377,7 +327,7 @@ A noun.
377327#### Source
378328
379329```hoon
380− ++ tail |*(^ ,:+<+)
330+++ tail |*(^ ,:+<+)
381331```
382332
383333#### Examples
@@ -395,7 +345,7 @@ A noun.
395345
396346---
397347
398−### `++test`
348+## `++test`
399349
400350Test for equality
401351
@@ -414,7 +364,7 @@ A flag.
414364#### Source
415365
416366```hoon
417− ++ test |=(^ =(+<- +<+))
367+++ test |=(^ =(+<- +<+))
418368```
419369
420370#### Examples
@@ -434,3 +384,67 @@ A flag.
434384```
435385
436386---
387+
388+## `++lead`
389+
390+Put head
391+
392+`(lead a)` produces a wet gate, then `((lead a) b)` produces `[a b]`.
393+
394+#### Accepts
395+
396+`a` is a noun, and is the sample of `+lead`.
397+
398+`b` is a noun, and is the sample of `((lead a) b)`
399+
400+#### Produces
401+
402+A cell of `[a b]`.
403+
404+#### Source
405+
406+```hoon
407+++ lead |*(* |*(* [+>+< +<]))
408+```
409+
410+#### Examples
411+
412+```
413+> =a (lead 'foo')
414+> (a 'bar')
415+['foo' 'bar']
416+```
417+
418+---
419+
420+## `++late`
421+
422+Put tail
423+
424+`(late a)` produces a wet gate, then `((late a) b)` produces the inverted cell `[b a]`. This is the inverted version of [+lead](#lead).
425+
426+#### Accepts
427+
428+`a` is a noun, and is the sample of `+late`.
429+
430+`b` is a noun, and is the sample of `(late a)`.
431+
432+#### Produces
433+
434+A cell of `[b a]`.
435+
436+#### Source
437+
438+```hoon
439+++ late |*(* |*(* [+< +>+<]))
440+```
441+
442+#### Examples
443+
444+```
445+> =a (late 'foo')
446+> (a 'bar')
447+['bar' 'foo']
448+```
449+
450+---
content/docs/hoon/reference/stdlib/2o.md+99−86
@@ -4,109 +4,115 @@ weight = 18
44template = "doc.html"
55+++
66
7−### `++jar`
7+## `++jar`
88
99Mold generator. A `jar` is a `map` of `list`.
1010
11+Produces the mold of a map from `key` to lists of `value`.
12+
13+#### Accepts
14+
15+`key` is a `mold`, and is the type of the map key
16+
17+`value` is a `mold`, and is the type of items in the lists. The lists are the values in the map.
18+
19+#### Produces
20+
21+A `mold`.
22+
1123#### Source
1224
1325```hoon
14− ++ jar |*([a=mold b=mold] (map a (list b)))
26+++ jar |$ [key value] (map key (list value))
1527```
1628
1729#### Examples
1830
1931```
20− > =a (ly [1 2 ~])
21− > a
22− ~[1 2]
32+> `(jar @t @ud)`(malt ~[['foo' ~[1 2 3]] ['bar' ~[4 5 6]]])
33+{[p='bar' q=~[4 5 6]] [p='foo' q=~[1 2 3]]}
34+```
2335
24− > =b (ly [3 4 ~])
25− > b
26− ~[3 4]
36+#### Discussion
2737
28− > =c (my [[%a a] [%b b] ~])
29− > c
30− [n=[p=%b q=[i=3 t=~[4]]] l={[p=%a q=[i=1 t=[i=2 t=~]]]} r={}]
38+See also: [`ja`](/docs/hoon/reference/stdlib/2j#ja), [`by`](/docs/hoon/reference/stdlib/2i), [`map`](#map), [lists](/docs/hoon/reference/stdlib/2b)
3139
32− > (~(get ja c) %a)
33− [i=1 t=[i=2 t=~]]
40+---
3441
35− > (~(get ja c) %c)
36− ~
37−```
42+## `++jug`
3843
39−#### Discussion
44+Mold generator. A `jug` is a `map` of `set`.
4045
41−See also: [`ja`](/docs/hoon/reference/stdlib/2j), [`by`](/docs/hoon/reference/stdlib/2i), [`map`](/docs/hoon/reference/stdlib/2i), [`list`](/docs/hoon/reference/stdlib/2b)
46+Produces the mold of a map from `key` to sets of `value`.
4247
43−---
44−### `++jug`
48+#### Accepts
4549
46−Mold generator. A `jug` is a `map` of `set`.
50+`key` is a `mold`, and is the type of the map key.
51+
52+`value` is a `mold`, and is the type of items in the sets. The sets are the values in the map.
53+
54+#### Produces
55+
56+A `mold`.
4757
4858#### Source
4959
5060```hoon
51− ++ jug |*([a=mold b=mold] (map a (set b)))
61+++ jug |$ [key value] (map key (set value))
5262```
5363
5464#### Examples
5565
5666```
57− > =a (sy [1 2 ~])
58− > a
59− [n=2 l={1} r={}]
60−
61− > =b (sy [3 4 ~])
62− > b
63− [n=4 l={} r={3}]
64−
65− > =c (my [%a a] [%b b] ~])
66− > c
67− [n=[p=%b q=[n=4 l={} r={3}]] l={[p=%a q=[n=2 l={1} r={}]]} r={}]
68−
69− > (~(get ju c) %b)
70− [n=4 l=~ r=[n=3 l={} r={}]]
71−
72− > (~(put ju c) [%b 5])
73− [ n=[p=%b q=[n=4 l=[n=5 l={} r={}] r=[n=3 l={} r={}]]]
74− l=[n=[p=%a q=[n=2 l=[n=1 l={} r={}] r=~]] l={} r={}]
75− r=~
76− ]
67+> `(jug @t @ud)`(malt ~[['foo' (silt ~[1 2 3])] ['bar' (silt ~[4 5 6])]])
68+{[p='bar' q={5 6 4}] [p='foo' q={1 2 3}]}
7769```
7870
7971#### Discussion
8072
81−See also: [`ja`](/docs/hoon/reference/stdlib/2j), [`by`](/docs/hoon/reference/stdlib/2i), [`set`](/docs/hoon/reference/stdlib/2h)
73+See also: [`ju`](/docs/hoon/reference/stdlib/2j#ju), [`by`](/docs/hoon/reference/stdlib/2i), [`map`](#map), [`set`](#set)
8274
8375---
84−### `++map`
76+
77+## `++map`
8578
8679Map
8780
8881Mold generator. A `map` is a [treap](https://en.wikipedia.org/wiki/Treap) of
8982key-value pairs.
9083
84+Produces the mold of a map from `key` to `value`.
85+
86+#### Accepts
87+
88+`key` is a `mold`.
89+
90+`value` is a `mold`.
91+
92+#### Produces
93+
94+A `mold`.
9195
9296#### Source
9397
9498```hoon
95− ++ map |* [a=mold b=mold]
96− %+ cork (tree (pair a b))
97− |= c=(tree (pair a b)) ^+ c
98− ?.(~(apt by c) ~ c)
99+++ map
100+ |$ [key value]
101+ $| (tree (pair key value))
102+ |=(a=(tree (pair)) ?:(=(~ a) & ~(apt by a)))
99103```
100104
101105#### Examples
102106
103107```
104− > ? *(map @t @u)
105− nlr({p/@t q/@u})
106− {}
108+> ? *(map @t @ud)
109+ nlr([p=@t q=@ud])
110+{}
111+```
107112
108− > (molt `(list (pair * *))`[[a+1 b+2] ~])
109− [n=[p=[97 1] q=[98 2]] l={} r={}]
113+```
114+> `(map @t @ud)`(malt ~[['foo' 1] ['bar' 2] ['baz' 3]])
115+{[p='bar' q=2] [p='baz' q=3] [p='foo' q=1]}
110116```
111117
112118#### Discussion
@@ -114,74 +120,81 @@ key-value pairs.
114120See also: [`by`](/docs/hoon/reference/stdlib/2i)
115121
116122---
117−### `++qeu`
123+
124+## `++qeu`
118125
119126Queue
120127
121128Mold generator. An ordered [treap](http://en.wikipedia.org/wiki/Treap) of
122129items.
123130
131+Produces the mold of a queue of `item`.
132+
133+#### Accepts
134+
135+`item` is a `mold`.
136+
137+#### Produces
138+
139+A `mold`.
140+
124141#### Source
125142
126143```hoon
127− ++ qeu |*(a=mold (tree a))
144+++ qeu
145+ |$ [item]
146+ $| (tree item)
147+ |=(a=(tree) ?:(=(~ a) & ~(apt to a)))
128148```
129149
130−
131150#### Examples
132151
133152```
134− > (qeu time)
135− < 1.huj
136− { *
137− < 1.zda
138− { a/<1.vyv {* <112.lqf 224.nab 54.tyv 119.veb 31.ohr 1.jmk $143>}>
139− <31.ohr 1.jmk $143>
140− }
141− >
142− }
143−
144−
145− > (~(gas to *(qeu time)) [~2014.1.1 ~2014.1.2 ~])
146− [n=~2014.1.2 l={} r={~2014.1.1}]
153+> `(qeu @ud)`(~(gas to *(qeu @ud)) ~[1 2 3 4 5])
154+{5 4 3 2 1}
147155```
148156
149157#### Discussion
150158
151−See also: [`qeu`](/docs/hoon/reference/stdlib/2k)
159+See also: [`+to`](/docs/hoon/reference/stdlib/2k#to)
152160
153161---
154−### `++set`
162+
163+## `++set`
155164
156165Set
157166
158−Mold generator. A `qeu` is an ordered [treap](http://en.wikipedia.org/wiki/Treap) of
167+Mold generator. A `set` is an unordered [treap](http://en.wikipedia.org/wiki/Treap) of
159168items.
160169
170+Produces the mold of a set of `item`.
171+
172+#### Accepts
173+
174+`item` is a `mold`.
175+
176+#### Produces
177+
178+A `mold`.
179+
161180#### Source
162181
163182```hoon
164− ++ set |* a=mold
165− %+ cork (tree a)
166− |= b=(tree a) ^+ b
167− ?.(~(apt in b) ~ b)
183+++ set
184+ |$ [item]
185+ $| (tree item)
186+ |=(a=(tree) ?:(=(~ a) & ~(apt in a)))
168187```
169188
170189#### Examples
171190
172191```
173− > (sy "abc")
174− [n='b' l={'a' 'c'} r={}]
175−
176− > (~(put in (sy "abc")) %d)
177− [n='b' l=[n='d' l={} r={'a' 'c'}] r=~]
178−
179− > (~(put in (sy "abc")) %a)
180− [n='b' l=[n='c' l={'a'} r={}] r=~]
192+> `(set @ud)`(silt ~[1 2 3 4 5])
193+{5 1 2 3 4}
181194```
182195
183196#### Discussion
184197
185−See also: [`in`](/docs/hoon/reference/stdlib/2h)
198+See also: [`+in`](/docs/hoon/reference/stdlib/2h)
186199
187−---
200+---
content/docs/hoon/reference/stdlib/2p.md+125−119
@@ -4,15 +4,15 @@ weight = 19
44template = "doc.html"
55+++
66
7−### `++cue` {#cue}
7+## `++cue` {#cue}
88
99Unpack atom to noun
1010
11−Produces a noun unpacked from atom `a`. The inverse of `jam`.
11+Produces a noun unpacked from atom `a`. The inverse of [+jam](#jam).
1212
1313#### Accepts
1414
15−An Atom.
15+`a` is an atom.
1616
1717#### Produces
1818
@@ -21,49 +21,44 @@ A noun.
2121#### Source
2222
2323```hoon
24− ++ cue
25− ~/ %cue
26− |= a=@
27− ^- *
28− =+ b=0
29− =+ m=`(map @ *)`~
30− =< q
31− |- ^- [p=@ q=* r=(map @ *)]
32− ?: =(0 (cut 0 [b 1] a))
33− =+ c=(rub +(b) a)
34− [+(p.c) q.c (~(put by m) b q.c)]
35− =+ c=(add 2 b)
36− ?: =(0 (cut 0 [+(b) 1] a))
37− =+ u=$(b c)
38− =+ v=$(b (add p.u c), m r.u)
39− =+ w=[q.u q.v]
40− [(add 2 (add p.u p.v)) w (~(put by r.v) b w)]
41− =+ d=(rub c a)
42− [(add 2 p.d) (need (~(get by m) q.d)) m]
24+++ cue
25+ ~/ %cue
26+ |= a=@
27+ ^- *
28+ =+ b=0
29+ =+ m=`(map @ *)`~
30+ =< q
31+ |- ^- [p=@ q=* r=(map @ *)]
32+ ?: =(0 (cut 0 [b 1] a))
33+ =+ c=(rub +(b) a)
34+ [+(p.c) q.c (~(put by m) b q.c)]
35+ =+ c=(add 2 b)
36+ ?: =(0 (cut 0 [+(b) 1] a))
37+ =+ u=$(b c)
38+ =+ v=$(b (add p.u c), m r.u)
39+ =+ w=[q.u q.v]
40+ [(add 2 (add p.u p.v)) w (~(put by r.v) b w)]
41+ =+ d=(rub c a)
42+ [(add 2 p.d) (need (~(get by m) q.d)) m]
4343```
4444
4545#### Examples
4646
4747```
48− > (cue 12)
49− 1
50−
51− > (cue 817)
52− [1 1]
53−
54− > (cue 4.657)
55− [1 2]
48+> (jam [1 2 3])
49+3.426.417
5650
57− > (cue 39.689)
58− [0 19]
51+> (cue 3.426.417)
52+[1 2 3]
5953```
6054
6155---
62−### `++jam` {#jam}
56+
57+## `++jam` {#jam}
6358
6459Pack noun to atom
6560
66−Produces an atom packed from noun `a`. The inverse of `cue`.
61+Produces an atom packed from noun `a`. The inverse of [+cue](#cue).
6762
6863#### Accepts
6964
@@ -76,53 +71,60 @@ An atom.
7671#### Source
7772
7873```hoon
79− ++ jam
80− ~/ %jam
81− |= a=*
82− ^- @
83− =+ b=0
84− =+ m=`(map * @)`~
85− =< q
86− |- ^- [p=@ q=@ r=(map * @)]
87− =+ c=(~(get by m) a)
88− ?~ c
89− => .(m (~(put by m) a b))
90− ?: ?=(@ a)
91− =+ d=(mat a)
92− [(add 1 p.d) (lsh 0 1 q.d) m]
93− => .(b (add 2 b))
94− =+ d=$(a -.a)
95− =+ e=$(a +.a, b (add b p.d), m r.d)
96− [(add 2 (add p.d p.e)) (mix 1 (lsh 0 2 (cat 0 q.d q.e))) r.e]
97− ?: ?&(?=(@ a) (lte (met 0 a) (met 0 u.c)))
98− =+ d=(mat a)
99− [(add 1 p.d) (lsh 0 1 q.d) m]
100− =+ d=(mat u.c)
101− [(add 2 p.d) (mix 3 (lsh 0 2 q.d)) m]
74+++ jam
75+ ~/ %jam
76+ |= a=*
77+ ^- @
78+ =+ b=0
79+ =+ m=`(map * @)`~
80+ =< q
81+ |- ^- [p=@ q=@ r=(map * @)]
82+ =+ c=(~(get by m) a)
83+ ?~ c
84+ => .(m (~(put by m) a b))
85+ ?: ?=(@ a)
86+ =+ d=(mat a)
87+ [(add 1 p.d) (lsh 0 q.d) m]
88+ => .(b (add 2 b))
89+ =+ d=$(a -.a)
90+ =+ e=$(a +.a, b (add b p.d), m r.d)
91+ [(add 2 (add p.d p.e)) (mix 1 (lsh [0 2] (cat 0 q.d q.e))) r.e]
92+ ?: ?&(?=(@ a) (lte (met 0 a) (met 0 u.c)))
93+ =+ d=(mat a)
94+ [(add 1 p.d) (lsh 0 q.d) m]
95+ =+ d=(mat u.c)
96+ [(add 2 p.d) (mix 3 (lsh [0 2] q.d)) m]
10297```
10398
10499#### Examples
105100
106101```
107− > (jam 1)
108− 12
102+> (jam 1)
103+12
109104
110− > (jam [1 1])
111− 817
105+> (cue 12)
106+1
107+```
112108
113− > (jam [1 2])
114− 4.657
109+```
110+> (jam [1 1])
111+817
115112
116− > (jam [~ u=19])
117− 39.689
113+> (cue 817)
114+[1 1]
118115```
119116
120−#### Discussion
117+```
118+> (jam [~ u=19])
119+39.689
121120
122−`mat` is only used internally as a helper to `jam`.
121+> (cue 39.689)
122+[0 19]
123+```
123124
124125---
125−### `++mat`
126+
127+## `++mat`
126128
127129Length-encode
128130
@@ -136,54 +138,58 @@ is the length of `q` in bits.
136138
137139#### Produces
138140
139−A cell of two atoms.
141+A cell of two atoms, `p` and `q`.
140142
141143#### Source
142144
143145```hoon
144− ++ mat
145− ~/ %mat
146− |= a=@
147− ^- [p=@ q=@]
148− ?: =(0 a)
149− [1 1]
150− =+ b=(met 0 a)
151− =+ c=(met 0 b)
152− :- (add (add c c) b)
153− (cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a)))
146+++ mat
147+ ~/ %mat
148+ |= a=@
149+ ^- [p=@ q=@]
150+ ?: =(0 a)
151+ [1 1]
152+ =+ b=(met 0 a)
153+ =+ c=(met 0 b)
154+ :- (add (add c c) b)
155+ (cat 0 (bex c) (mix (end [0 (dec c)] b) (lsh [0 (dec c)] a)))
154156```
155157
156158#### Examples
157159
158160```
159− > (mat 0xaaa)
160− [p=20 q=699.024]
161+> (mat 0xaaa)
162+[p=20 q=699.024]
161163
162− > (met 0 q:(mat 0xaaa))
163− 20
164+> (met 0 q:(mat 0xaaa))
165+20
164166
165− > `@ub`q:(mat 0xaaa)
166− 0b1010.1010.1010.1001.0000
167+> `@ub`q:(mat 0xaaa)
168+0b1010.1010.1010.1001.0000
167169
168− > =a =-(~&(- -) `@ub`0xaaa)
169− 0b1010.1010.1010
170+> =a =-(~&(- -) `@ub`0xaaa)
171+0b1010.1010.1010
170172
171− > =b =-(~&(- -) `@ub`(xeb a))
172− 0b1100
173+> =b =-(~&(- -) `@ub`(xeb a))
174+0b1100
173175
174− > =b =-(~&(- -) `@ub`(met 0 a))
175− 0b1100
176+> =b =-(~&(- -) `@ub`(met 0 a))
177+0b1100
176178
177− > =c =-(~&(- -) (xeb b))
178− 4
179+> =c =-(~&(- -) (xeb b))
180+4
179181
180− > [`@ub`a `@ub`(end 0 (dec c) b) `@ub`(bex c)]
181− [0b1010.1010.1010 0b100 0b1.0000]
182+> [`@ub`a `@ub`(end 0 (dec c) b) `@ub`(bex c)]
183+[0b1010.1010.1010 0b100 0b1.0000]
182184```
183185
186+#### Discussion
187+
188+`mat` is only used internally as a helper to [`jam`](#jam).
184189
185190---
186−### `++rub`
191+
192+## `++rub`
187193
188194Length-decode
189195
@@ -200,43 +206,43 @@ offset `a` is advanced.
200206
201207#### Produces
202208
203−A cell of two atoms.
209+A cell of two atoms, `p` and `q`.
204210
205211#### Source
206212
207213```hoon
208− ++ rub
209− ~/ %rub
210− |= [a=@ b=@]
211− ^- [p=@ q=@]
212− =+ ^= c
213− =+ [c=0 m=(met 0 b)]
214− |- ?< (gth c m)
215− ?. =(0 (cut 0 [(add a c) 1] b))
216− c
217− $(c +(c))
218− ?: =(0 c)
219− [1 0]
220− =+ d=(add a +(c))
221− =+ e=(add (bex (dec c)) (cut 0 [d (dec c)] b))
222− [(add (add c c) e) (cut 0 [(add d (dec c)) e] b)]
214+++ rub
215+ ~/ %rub
216+ |= [a=@ b=@]
217+ ^- [p=@ q=@]
218+ =+ ^= c
219+ =+ [c=0 m=(met 0 b)]
220+ |- ?< (gth c m)
221+ ?. =(0 (cut 0 [(add a c) 1] b))
222+ c
223+ $(c +(c))
224+ ?: =(0 c)
225+ [1 0]
226+ =+ d=(add a +(c))
227+ =+ e=(add (bex (dec c)) (cut 0 [d (dec c)] b))
228+ [(add (add c c) e) (cut 0 [(add d (dec c)) e] b)]
223229```
224230
225231#### Examples
226232
227233```
228− > `@ub`(jam 0xaaa)
229− 0b1.0101.0101.0101.0010.0000
234+> `@ub`(jam 0xaaa)
235+0b1.0101.0101.0101.0010.0000
230236
231− > (rub 1 0b1.0101.0101.0101.0010.0000)
232− [p=20 q=2.730]
237+> (rub 1 0b1.0101.0101.0101.0010.0000)
238+[p=20 q=2.730]
233239
234− > `@ux`q:(rub 1 0b1.0101.0101.0101.0010.0000)
235− 0xaaa
240+> `@ux`q:(rub 1 0b1.0101.0101.0101.0010.0000)
241+0xaaa
236242```
237243
238244#### Discussion
239245
240−`rub` is only used internally as a helper to `cue`.
246+`rub` is only used internally as a helper to [`cue`](#cue).
241247
242248---
content/docs/hoon/reference/stdlib/2q.md+350−139
@@ -4,32 +4,110 @@ weight = 20
44template = "doc.html"
55+++
66
7−### `++char`
7+## `+$axis`
88
9−Character
9+Tree address
10+
11+A Nock axis inside a noun. After the leading 1, in binary, a `1` signfies
12+right and `0` left.
13+
14+#### Source
15+
16+```hoon
17++$ axis @
18+```
19+
20+#### Examples
21+
22+```
23+> =axis `axis`7
24+> axis
25+7
26+> `@ub`axis
27+0b111
28+
29+> =noun [[4 5] [6 14 15]]
30+
31+> .*(noun [0 axis])
32+[14 15]
33+```
34+
35+---
36+
37+## `+$bean`
38+
39+Boolean
40+
41+`0`, `&`, or `%.y` are true, and `1`, `|`, and `%.n` are false.
42+
43+Note 1 is false and 0 is true. This is sometimes referred to as "loobean".
44+
45+#### Source
46+
47+```hoon
48++$ bean ?
49+```
50+
51+#### Examples
52+
53+```
54+> *bean
55+%.y
56+```
57+
58+```
59+> `bean`&
60+%.y
61+```
62+
63+```
64+> `bean`|
65+%.n
66+```
67+
68+---
69+
70+## `+$flag`
71+
72+Boolean
73+
74+Same as [$bean](#bean).
1075
11−A single character. Aura `@tD` designates a single UTF-8 byte. All parsers
12−consume `tape`s, which are lists of `char`.
76+#### Source
77+
78+```hoon
79++$ flag ?
80+```
81+
82+---
1383
84+## `+$char`
85+
86+Character
87+
88+A single `@t` character.
1489
1590#### Source
1691
1792```hoon
18− ++ char @tD
93++$ char @t
1994```
2095
2196#### Examples
2297
2398```
24− > *char
25− ''
99+> *char
100+''
101+```
26102
27− > `@tD`97
28− 'a'
103+```
104+> `char`'a'
105+'a'
29106```
30107
31108---
32−### `++cord`
109+
110+## `+$cord`
33111
34112UTF-8 text
35113
@@ -39,26 +117,26 @@ atom of UTF-8 text.
39117#### Source
40118
41119```hoon
42− ++ cord @t
120++$ cord @t
43121```
44122
45123#### Examples
46124
47125```
48− > *cord
49− ''
126+> *cord
127+''
50128
51− > `@ux`'foobar'
52− 0x7261.626f.6f66
129+> `@ux`'foobar'
130+0x7261.626f.6f66
53131
54− > `@t`97
55− 'a'
132+> `@t`97
133+'a'
56134
57− > `@`'urbit'
58− 499.984.265.845
135+> `@`'urbit'
136+499.984.265.845
59137
60− > `@t`499.984.265.845
61− 'urbit'
138+> `@t`499.984.265.845
139+'urbit'
62140```
63141
64142#### Discussion
@@ -66,15 +144,44 @@ atom of UTF-8 text.
66144Aura `@t` designates a Unicode atom, little-endian: the first character
67145in the text is the least-significant byte.
68146
69−[`trip`](/docs/hoon/reference/stdlib/4b) converts from `cord` to `tape`, and [`crip`](/docs/hoon/reference/stdlib/4b) converts
147+[`trip`](/docs/hoon/reference/stdlib/4b#trip) converts from `cord` to `tape`, and [`crip`](/docs/hoon/reference/stdlib/4b#crip) converts
70148from `tape` to `cord`.
71149
150+---
151+
152+## `+$byts`
153+
154+bytes, LSB first
155+
156+An atom `dat` with its byte-length specified in `wid`. This is to handle leading zeros that are typically ignored.
72157
158+#### Source
159+
160+```hoon
161++$ byts [wid=@ud dat=@]
162+```
163+
164+#### Examples
165+
166+```
167+> *byts
168+[wid=0 dat=0]
169+```
170+
171+```
172+> =a `byts`[4 2]
173+> a
174+[wid=4 dat=2]
175+
176+> `@ux`(rev 3 a)
177+0x200.0000
178+```
73179
74180---
75−### `++date`
76181
77−Point in time
182+## `+$date`
183+
184+Parsed date
78185
79186A boolean designating AD or BC, a year atom, a month atom, and a `tarp`,
80187which is a day atom and a time.
@@ -82,176 +189,278 @@ which is a day atom and a time.
82189#### Source
83190
84191```hoon
85− ++ date [[a=? y=@ud] m=@ud t=tarp]
192++$ date [[a=? y=@ud] m=@ud t=tarp]
86193```
87194
88195#### Examples
89196
90197```
91− > *date
92− [[a=%.y y=0] m=0 t=[d=0 h=0 m=0 s=0 f=~]]
198+> *date
199+[[a=%.y y=0] m=0 t=[d=0 h=0 m=0 s=0 f=~]]
93200
94− > `date`(yore ~2014.6.6..21.09.15..0a16)
95− [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
201+> `date`(yore ~2014.6.6..21.09.15..0a16)
202+[[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
96203
97− > now
98− ~2018.5.25..17.55.15..9ad8
204+> now
205+~2018.5.25..17.55.15..9ad8
99206```
100207
101−
102208#### Discussion
103209
104−See also: [`year`](/docs/hoon/reference/stdlib/3c), [`yore`](/docs/hoon/reference/stdlib/3c)
210+See also: [`year`](/docs/hoon/reference/stdlib/3c#year), [`yore`](/docs/hoon/reference/stdlib/3c#yore)
105211
106212---
107−### `++knot`
108213
109−ASCII
214+## `+$knot`
215+
216+ASCII text
110217
111218An atom type that only permits ASCII characters.
112219
113220#### Source
114221
115222```hoon
223++$ knot @ta
224+```
225+
226+#### Examples
227+
228+```
229+> *knot
230+~.
231+
232+> `@ta`105
233+~.i
234+```
235+
236+---
116237
117− ++ knot @ta
238+## `+$noun`
239+
240+Any noun
241+
242+#### Source
243+
244+```hoon
245++$ noun *
118246```
119247
120248#### Examples
121249
122250```
123− > *knot
124− ~.
251+> *noun
252+0
253+```
125254
126− > `@ta`105
127− ~.i
255+```
256+> `noun`'foo'
257+7.303.014
258+```
259+
260+```
261+> `noun`"foo"
262+[102 111 111 0]
128263```
129264
130265---
131−### `++tang`
132266
133−Generic print structure
267+## `+$path`
134268
135−A list of `tank`s. It's for printing types and bottom-up printing of stack
136−traces.
269+Like unix path
270+
271+A path is a list of [`$knot`](#knot).
137272
138273#### Source
139274
140275```hoon
141− ++ tang (list tank)
276++$ path (list knot)
142277```
143278
144279#### Examples
145280
146281```
147− > *tang
148− ~
282+> *path
283+/
284+```
285+
286+```
287+> `path`"foo"
288+/f/o/o
289+```
290+
291+```
292+> `path`[~.foo ~.bar ~.baz ~]
293+/foo/bar/baz
294+```
149295
150− > (~(win re [%palm ["1" "2" "3" "4"] [%leaf "foobar"] [%leaf "bazbud"] [%leaf "zzzzzzqaaa"] ~]) 0 50)
151− <<"23foobar1bazbud1zzzzzzqaaa4">>
296+---
152297
153− > (~(win re [%palm ["1" "2" "3" "4"] [%leaf "foobar"] [%leaf "bazbud"] [%leaf "zzzzzzqaaa"] ~]) 0 10)
154− <<"2 foobar" " bazbud" "zzzzzzqaaa">>
298+## `+$stud`
155299
156− > (~(win re [%rose ["1" "2" "3"] [%leaf "foobar"] [%leaf "bazbud"] ~]) 0 20)
157− <<"2foobar1bazbud3">>
300+Standard name
158301
159− > (~(win re [%rose ["1" "2" "3"] [%leaf "foobar"] [%leaf "bazbud"] ~]) 0 10)
160− <<"2 foobar" " bazbud" "3">>
302+#### Source
303+
304+```hoon
305++$ stud :: standard name
306+ $@ mark=@tas :: auth=urbit
307+ $: auth=@tas :: standards authority
308+ type=path :: standard label
309+ == ::
161310```
162311
163312---
164−### `++tank`
165313
166−Pretty-printing structure
314+## `+$tang`
167315
168−A `tank` is one of three cases: a `%leaf` is simply a string (a printed line);
169−a `%palm` is list of `tank` delimited by the strings in `p`, with back-steps at
170−new lines; and a `%rose` is a list of `tank` delimited by the strings in `p`
171−without back-steps at new lines.
316+Bottom-first error
172317
318+A list of [`tank`](#tank)s. It's for printing types and bottom-up printing of stack
319+traces.
173320
174321#### Source
175322
176323```hoon
177− ++ tank $% [$leaf p=tape]
178− $: $palm
179− p=[p=tape q=tape r=tape s=tape]
180− q=(list tank)
181− ==
182− $: $rose
183− p=[p=tape q=tape r=tape]
184− q=(list tank)
185− ==
186− ==
324++$ tang (list tank)
187325```
188326
189327#### Examples
190328
329+```
330+> *tang
331+~
332+```
191333
192334```
193− > *tank
194− [%rose p=[p="" q="" r=""] q=~]
335+> %- %- slog
336+ ^- tang
337+ :~ 'foo'
338+ leaf+"bar"
339+ [%palm ["|" "(" "!" ")"] leaf+"foo" leaf+"bar" leaf+"baz" ~]
340+ [%rose [" " "[" "]"] leaf+"foo" leaf+"bar" leaf+"baz" ~]
341+ ==
342+foo
343+bar
344+(!foo|bar|baz)
345+[foo bar baz]
346+ ~
347+~
348+```
195349
196− > (wash [0 80] >(bex 20) (bex 19)<) :: at 80 cols
197− <<"[1.048.576 524.288]">>
350+---
198351
199− > (wash [0 15] >(bex 20) (bex 19)<) :: at 15 cols
200− <<"[ 1.048.576" " 524.288" "]">>
352+## `+$tank`
201353
202− > [(bex 150) (bex 151)] :: at 80 cols
203− [ 1.427.247.692.705.959.881.058.285.969.449.495.136.382.746.624
204− 2.854.495.385.411.919.762.116.571.938.898.990.272.765.493.248
205− ]
354+Formatted print tree
206355
207− > (wash [0 40] >(bex 150) (bex 151)<)
208− <<
209− "[ \\/1.427.247.692.705.959.881.058.285.\\/"
210− " 969.449.495.136.382.746.624"
211− " \\/ \\/"
212− " \\/2.854.495.385.411.919.762.116.571.\\/"
213− " 938.898.990.272.765.493.248"
214− " \\/ \\/"
215− "]"
216− >>
356+A `tank` is one of four cases:
357+
358+- just a `cord`.
359+- `%leaf` is just a `tape`.
360+- `%palm` is a list of `tank` delimited by the strings in `p`, with back-steps at new lines.
361+- `%rose` is a list of `tank` delimited by the strings in `p` without back-steps at new lines.
362+
363+#### Source
364+
365+```hoon
366++$ tank
367+ $~ leaf/~
368+ $@ cord
369+ $% [%leaf p=tape]
370+ [%palm p=(qual tape tape tape tape) q=(list tank)]
371+ [%rose p=(trel tape tape tape) q=(list tank)]
372+ ==
373+```
374+
375+#### Examples
376+
377+```
378+> *tank
379+[%leaf p=""]
380+```
381+
382+```
383+> ~(ram re 'foobar')
384+"foobar"
217385```
218386
387+```
388+> ~(ram re leaf+"foo")
389+"foo"
390+```
391+
392+```
393+> ~(ram re [%palm ["|" "(" "!" ")"] leaf+"foo" leaf+"bar" leaf+"baz" ~])
394+"(!foo|bar|baz)"
395+```
396+
397+```
398+> ~(ram re [%rose [" " "[" "]"] leaf+"foo" leaf+"bar" leaf+"baz" ~])
399+"[foo bar baz]"
400+```
219401
220402---
221−### `++tape`
403+
404+## `+$tape`
222405
223406List of characters
224407
225−One of Hoon's two string types, the other being `++cord`. A tape is a list of
226−`char`.
408+One of Hoon's two string types, the other being [`+cord`](#cord). A tape is a list of `@tD`.
227409
228410#### Source
229411
230412```hoon
231− ++ tape (list @tD)
413++$ tape (list @tD)
232414```
233415
234416#### Examples
235417
236418```
237− > *tape
238− ""
419+> *tape
420+""
239421
240− > `tape`"foobar"
241− "foobar"
422+> `tape`"foobar"
423+"foobar"
242424
243− >`(list @t)`"foobar"
244− <|f o o b a r|>
425+>`(list @t)`"foobar"
426+<|f o o b a r|>
245427
246− >`(list @tD)`"foobar"
247− "foobar"
428+>`(list @tD)`"foobar"
429+"foobar"
248430
249− > `(list @)`"foobar"
250− ~[102 111 111 98 97 114]
431+> `(list @)`"foobar"
432+~[102 111 111 98 97 114]
251433```
252434
253435---
254−### `++tarp`
436+
437+## `+$tour`
438+
439+UTF-32 clusters
440+
441+A `tour` is a list of UTF-32 characters.
442+
443+#### Source
444+
445+```hoon
446++$ tour (list @c)
447+```
448+
449+#### Examples
450+
451+```
452+> *tour
453+~
454+```
455+
456+```
457+> `tour`(tuba "foobar")
458+~[~-f ~-o ~-o ~-b ~-a ~-r]
459+```
460+
461+---
462+
463+## `+$tarp`
255464
256465Parsed time
257466
@@ -261,28 +470,28 @@ for precision.
261470#### Source
262471
263472```hoon
264− ++ tarp [d=@ud h=@ud m=@ud s=@ud f=(list @ux)]
473++$ tarp [d=@ud h=@ud m=@ud s=@ud f=(list @ux)]
265474```
266475
267476#### Examples
268477
269478```
270− > *tarp
271− [d=0 h=0 m=0 s=0 f=~]
479+> *tarp
480+[d=0 h=0 m=0 s=0 f=~]
272481
273− > (yell now)
274− [d=106.751.991.821.625 h=22 m=58 s=10 f=~[0x44ff]]
482+> (yell now)
483+[d=106.751.991.821.625 h=22 m=58 s=10 f=~[0x44ff]]
275484
276− > `tarp`(yell ~2014.6.6..21.09.15..0a16)
277− [d=106.751.991.820.172 h=21 m=9 s=15 f=~[0xa16]]
485+> `tarp`(yell ~2014.6.6..21.09.15..0a16)
486+[d=106.751.991.820.172 h=21 m=9 s=15 f=~[0xa16]]
278487
279− > (yell ~d20)
280− [d=20 h=0 m=0 s=0 f=~]
488+> (yell ~d20)
489+[d=20 h=0 m=0 s=0 f=~]
281490```
282491
283−
284492---
285−### `++term`
493+
494+## `+$term`
286495
287496Hoon constant
288497
@@ -292,56 +501,58 @@ first character. The syntax for `@tas` is the text itself, always preceded by
292501`%`. The empty `@tas` has a
293502special syntax, `$`.
294503
295−
296504#### Source
297505
298506```hoon
299− ++ term @tas
507++$ term @tas
300508```
301509
302510#### Examples
303511
304512```
305− > *term
306− %$
513+> *term
514+%$
307515
308− > *%term
309− %term
516+> *%term
517+%term
310518
311− > %dead-fish9
312− %dead-fish9
519+> %dead-fish9
520+%dead-fish9
313521
314− > -:!>(%dead-fish9)
315− #t/$dead-fish9
316−```
522+> -:!>(%dead-fish9)
523+#t/%dead-fish9
317524
525+> -:!>(`@tas`%dead-fish9)
526+#t/@tas
527+```
318528
319529---
320−### `++wain`
530+
531+## `+$wain`
321532
322533List of strings
323534
324535A list of `cord`s. A `wain` is used instead of a single `cord` with `\n`.
325536
326−
327537#### Source
328538
329539```hoon
330− ++ wain (list cord)
540++$ wain (list cord)
331541```
332542
333543#### Examples
334544
335545```
336− > *wain
337− <||>
546+> *wain
547+<||>
338548
339− > `wain`/som/del/rok
340− <|som del rok|>
549+> `wain`/som/del/rok
550+<|som del rok|>
341551```
342552
343553---
344−### `++wall`
554+
555+## `+$wall`
345556
346557List of list of characters
347558
@@ -350,8 +561,9 @@ A list of `tape`s. `wall` is used instead of a single `tape` with `\n`.
350561#### Source
351562
352563```hoon
353− ++ wall (list tape)
564++$ wall (list tape)
354565```
566+
355567#### Examples
356568
357569```
@@ -371,5 +583,4 @@ A list of `tape`s. `wall` is used instead of a single `tape` with `\n`.
371583 >>
372584```
373585
374−
375−---
586+---
content/docs/hoon/reference/stdlib/3a.md+25−5
@@ -4,7 +4,7 @@ weight = 21
44template = "doc.html"
55+++
66
7−### `++egcd`
7+## `++egcd`
88
99Extended Euclidean algorithm
1010
@@ -54,7 +54,8 @@ of `a` and `b`. Also produces `u` and `v` such that `au + bv = GCD(a, b)`.
5454```
5555
5656---
57−### `++fo`
57+
58+## `++fo`
5859
5960Modulo prime
6061
@@ -69,6 +70,7 @@ Container core for modular arithmetic functions.
6970```
7071
7172---
73+
7274### `++dif:fo`
7375
7476Subtraction
@@ -106,6 +108,7 @@ An atom.
106108```
107109
108110---
111+
109112### `++exp:fo`
110113
111114Exponent
@@ -153,6 +156,7 @@ An atom.
153156```
154157
155158---
159+
156160### `++fra:fo`
157161
158162Divide
@@ -202,6 +206,7 @@ An atom.
202206```
203207
204208---
209+
205210### `++inv:fo`
206211
207212Inverse
@@ -248,6 +253,7 @@ An atom.
248253```
249254
250255---
256+
251257### `++pro:fo`
252258
253259Multiplication
@@ -285,6 +291,7 @@ An atom.
285291```
286292
287293---
294+
288295### `++sit:fo`
289296
290297Modulus
@@ -317,6 +324,7 @@ An atom.
317324```
318325
319326---
327+
320328### `++sum:fo`
321329
322330Modular sum
@@ -355,7 +363,8 @@ An atom.
355363```
356364
357365---
358−### `++si`
366+
367+## `++si`
359368
360369Signed integer
361370
@@ -393,6 +402,7 @@ one. For example:
393402```
394403
395404---
405+
396406### `++abs:si`
397407
398408Absolute value
@@ -407,7 +417,7 @@ Produces the absolute value of signed integer `a`.
407417
408418An atom.
409419
410−### Source
420+#### Source
411421
412422```hoon
413423 ++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a)))
@@ -424,6 +434,7 @@ An atom.
424434```
425435
426436---
437+
427438### `++dif:si`
428439
429440Subtraction
@@ -458,6 +469,7 @@ A signed integer.
458469```
459470
460471---
472+
461473### `++dul:si`
462474
463475Modulus
@@ -497,6 +509,7 @@ An atom.
497509```
498510
499511---
512+
500513### `++fra:si`
501514
502515Divide
@@ -534,6 +547,7 @@ A signed atom.
534547```
535548
536549---
550+
537551### `++new:si`
538552
539553Atom to @s
@@ -576,6 +590,7 @@ A signed integer.
576590```
577591
578592---
593+
579594### `++old:si`
580595
581596Sign and absolute value
@@ -608,6 +623,7 @@ A cell composed of a `term` and an atom.
608623```
609624
610625---
626+
611627### `++pro:si`
612628
613629Multiplication
@@ -638,6 +654,7 @@ Produces a signed integer by multiplying `a` and `b`.
638654```
639655
640656---
657+
641658### `++rem:si`
642659
643660Remainder
@@ -676,8 +693,8 @@ A signed integer.
676693 --2
677694```
678695
679−
680696---
697+
681698### `++sum:si`
682699
683700Addition
@@ -723,6 +740,7 @@ A signed integer.
723740```
724741
725742---
743+
726744### `++sun:si`
727745
728746@u to @s
@@ -766,6 +784,7 @@ An atom.
766784```
767785
768786---
787+
769788### `++syn:si`
770789
771790Sign test
@@ -798,6 +817,7 @@ An `term`.
798817```
799818
800819---
820+
801821### `++cmp:si`
802822
803823Compare
content/docs/hoon/reference/stdlib/3b.md+200−29
@@ -4,7 +4,7 @@ weight = 22
44template = "doc.html"
55+++
66
7−### `++fn`
7+## `++fn`
88
99Float
1010
@@ -25,7 +25,7 @@ exponent, a signed decimal; and `a` to the significand, an unsigned integer.
2525 ==
2626```
2727
28−### Examples
28+#### Examples
2929
3030```
3131 > *fn
@@ -44,9 +44,9 @@ exponent, a signed decimal; and `a` to the significand, an unsigned integer.
4444 [%f s=%.y e=--17 a=7.333.324.850.834.000.007.430.214.137.126.970]
4545```
4646
47−
4847---
49−### `++dn`
48+
49+## `++dn`
5050
5151Decimal float
5252
@@ -79,7 +79,8 @@ and `a` to the significand, an unsigned integer.
7979```
8080
8181---
82−### `++rn`
82+
83+## `++rn`
8384
8485Parsed decimal float
8586
@@ -106,7 +107,8 @@ not-a-number (`$n`).
106107```
107108
108109---
109−### `++fl`
110+
111+## `++fl`
110112
111113Arbitrary-precision floating-point
112114
@@ -134,6 +136,7 @@ Container arm for floating-point arithmetic functions.
134136```
135137
136138---
139+
137140### `++rou:fl`
138141
139142Round
@@ -175,6 +178,7 @@ An `fn`.
175178```
176179
177180---
181+
178182### `++rau:fl`
179183
180184Various roundings
@@ -212,12 +216,12 @@ An `fn`.
212216 [%f s=%.y e=-102 a=6.626.897.619.228.945.634.459.505.846.648.832]
213217```
214218
215−
216219#### Discussion
217220
218221See `lug:fl` for possible rounding operations.
219222
220223---
224+
221225### `++add:fl`
222226
223227Add
@@ -273,6 +277,7 @@ An `fn`.
273277```
274278
275279---
280+
276281### `++sub:fl`
277282
278283Subtract
@@ -329,6 +334,7 @@ An `fn`.
329334```
330335
331336---
337+
332338### `++mul:fl`
333339
334340Multiply
@@ -362,6 +368,7 @@ An `fn`.
362368```
363369
364370---
371+
365372### `++div:fl`
366373
367374Divide
@@ -400,6 +407,7 @@ An `fn`.
400407```
401408
402409---
410+
403411### `++sqt:fl`
404412
405413Square root
@@ -437,6 +445,7 @@ An `fn`.
437445```
438446
439447---
448+
440449### `++lth:fl`
441450
442451Less than
@@ -477,6 +486,7 @@ An `flag`.
477486```
478487
479488---
489+
480490### `++equ:fl`
481491
482492Equals
@@ -515,6 +525,7 @@ A `flag`.
515525```
516526
517527---
528+
518529### `++ibl:fl`
519530
520531Integer binary logarithm
@@ -546,6 +557,7 @@ A signed integer.
546557```
547558
548559---
560+
549561### `++uni:fl`
550562
551563Change representation to odd
@@ -582,6 +594,7 @@ A cell of a signed integer and an unsigned integer.
582594```
583595
584596---
597+
585598### `++xpd:fl`
586599
587600Expand
@@ -625,6 +638,7 @@ A cell of a signed integer and an unsigned integer.
625638```
626639
627640---
641+
628642### `++lug:fl`
629643
630644Central rounding mechanism
@@ -634,6 +648,7 @@ value selected for `t`. `s` is a sticky bit that represents a value less than
634648ULP(a) = 2^(e.a)
635649
636650Possible rounding operations:
651+
637652- Floor (`$fl`)
638653- Ceiling (`$ce`)
639654- Smaller (`$sm`)
@@ -730,6 +745,7 @@ An `fn`.
730745```
731746
732747---
748+
733749### `++drg:fl`
734750
735751Get printable decimal
@@ -814,6 +830,7 @@ A cell of a signed integer and an unsigned integer.
814830```
815831
816832---
833+
817834### `++toj:fl`
818835
819836Round to integer
@@ -855,6 +872,7 @@ An `fn`.
855872```
856873
857874---
875+
858876### `++ned:fl`
859877
860878Require float
@@ -882,7 +900,6 @@ A cell of a signed integer and an unsigned integer.
882900
883901#### Examples
884902
885−
886903```
887904 > (ned:fl [%f s=%.y e=-11 a=7.530.107.827.833.587])
888905 [%f s=%.y e=-11 a=7.530.107.827.833.587]
@@ -897,6 +914,7 @@ A cell of a signed integer and an unsigned integer.
897914```
898915
899916---
917+
900918### `++shf:fl`
901919
902920Shift power
@@ -937,6 +955,7 @@ An `fn`.
937955```
938956
939957---
958+
940959### `++fli:fl`
941960
942961Flip sign
@@ -973,6 +992,7 @@ An `fn`.
973992```
974993
975994---
995+
976996### `++swr:fl`
977997
978998Switch rounding
@@ -1000,6 +1020,7 @@ Switches the rounding mode of `r:fl`.
10001020```
10011021
10021022---
1023+
10031024### `++prc:fl`
10041025
10051026Force precision of 2 or greater
@@ -1030,6 +1051,7 @@ Otherwise, a crash is produced.
10301051```
10311052
10321053---
1054+
10331055### `++den:fl`
10341056
10351057Behavior
@@ -1062,6 +1084,7 @@ The default value of `d` is `%d`.
10621084```
10631085
10641086---
1087+
10651088### `++emn:fl`
10661089
10671090Minimum exponent
@@ -1082,6 +1105,7 @@ Produces `v:fl`, the minimum exponent. The default minimum exponent is -16.494.
10821105```
10831106
10841107---
1108+
10851109### `++emx:fl`
10861110
10871111Maximum exponent
@@ -1105,6 +1129,7 @@ Returns the maximum exponent of `fl`. The default maximum exponent is --16.271.
11051129```
11061130
11071131---
1132+
11081133### `++spd:fl`
11091134
11101135Smallest denormal
@@ -1125,6 +1150,7 @@ Produces the smallest possible denormalized float.
11251150```
11261151
11271152---
1153+
11281154### `++spn:fl`
11291155
11301156Smallest normal
@@ -1145,6 +1171,7 @@ Produces the smallest representable normal float.
11451171```
11461172
11471173---
1174+
11481175### `++lfn:fl`
11491176
11501177Largest normal
@@ -1165,6 +1192,7 @@ Produces the largest representable normal float.
11651192```
11661193
11671194---
1195+
11681196### `++lfe:fl`
11691197
11701198Maximum
@@ -1185,6 +1213,7 @@ Produces the sum of `emx:fl` plus `prc:fl`.
11851213```
11861214
11871215---
1216+
11881217### `++zer:fl`
11891218
11901219Zero
@@ -1207,6 +1236,7 @@ Produces zero represented as a float.
12071236```
12081237
12091238---
1239+
12101240### `++rou:fl`
12111241
12121242Round
@@ -1250,6 +1280,7 @@ An `fn`.
12501280```
12511281
12521282---
1283+
12531284### `++syn:fl`
12541285
12551286Get sign
@@ -1283,6 +1314,7 @@ An `fn`.
12831314```
12841315
12851316---
1317+
12861318### `++abs:fl`
12871319
12881320Absolute value
@@ -1317,6 +1349,7 @@ An `fn`.
13171349```
13181350
13191351---
1352+
13201353### `++add:fl`
13211354
13221355Add
@@ -1365,6 +1398,7 @@ An `fn`.
13651398```
13661399
13671400---
1401+
13681402### `++ead:fl`
13691403
13701404Exact add
@@ -1414,6 +1448,7 @@ An `fn`.
14141448```
14151449
14161450---
1451+
14171452### `++sub:fl`
14181453
14191454Subtract
@@ -1445,6 +1480,7 @@ An `fn`.
14451480```
14461481
14471482---
1483+
14481484### `++mul:fl`
14491485
14501486Multiply
@@ -1479,6 +1515,7 @@ An `fn`.
14791515```
14801516
14811517---
1518+
14821519### `++emu:fl`
14831520
14841521Exact multiply
@@ -1512,6 +1549,7 @@ An `fn`.
15121549```
15131550
15141551---
1552+
15151553### `++div:fl`
15161554
15171555Divide
@@ -1544,6 +1582,7 @@ An `fn`.
15441582```
15451583
15461584---
1585+
15471586### `++fma:fl`
15481587
15491588Fused multiply-add
@@ -1579,6 +1618,7 @@ An `fn`.
15791618```
15801619
15811620---
1621+
15821622### `++sqt:fl`
15831623
15841624Square root
@@ -1612,6 +1652,7 @@ An `fn`.
16121652```
16131653
16141654---
1655+
16151656### `++inv:fl`
16161657
16171658Inverse
@@ -1654,6 +1695,7 @@ An `fn`.
16541695```
16551696
16561697---
1698+
16571699### `++sun:fl`
16581700
16591701Signed integer to float
@@ -1690,7 +1732,8 @@ An `fn`.
16901732```
16911733
16921734---
1693−### `++san:fl`
1735+
1736+### `++san:fl`
16941737
16951738Signed integer to float
16961739
@@ -1724,6 +1767,7 @@ An `fn`.
17241767```
17251768
17261769---
1770+
17271771### `++lth:fl`
17281772
17291773Less than
@@ -1770,6 +1814,7 @@ A `unit` of `flag`.
17701814```
17711815
17721816---
1817+
17731818### `++lte:fl`
17741819
17751820Less than or equal
@@ -1815,6 +1860,7 @@ A `unit` of `flag`.
18151860```
18161861
18171862---
1863+
18181864### `++equ:fl`
18191865
18201866Equals
@@ -1857,6 +1903,7 @@ An `unit` of `flag`.
18571903```
18581904
18591905---
1906+
18601907### `++gte:fl`
18611908
18621909Greater or equal than
@@ -1895,6 +1942,7 @@ An `unit` of `flag`.
18951942```
18961943
18971944---
1945+
18981946### `++gth:fl`
18991947
19001948Greater than
@@ -1930,6 +1978,7 @@ An `unit` of `flag`.
19301978```
19311979
19321980---
1981+
19331982### `++drg:fl`
19341983
19351984Float to decimal
@@ -1964,6 +2013,7 @@ A `dn`.
19642013```
19652014
19662015---
2016+
19672017### `++grd:fl`
19682018
19692019Decimal to float
@@ -2003,6 +2053,7 @@ An `fn`.
20032053```
20042054
20052055---
2056+
20062057### `++toi:fl`
20072058
20082059Round to signed integer
@@ -2036,6 +2087,7 @@ A `unit` of @s.
20362087```
20372088
20382089---
2090+
20392091### `++toj:fl`
20402092
20412093Round to integer fn
@@ -2079,16 +2131,17 @@ A `unit` of @s.
20792131```
20802132
20812133---
2082−### `++ff`
2134+
2135+## `++ff`
20832136
20842137IEEE-754 Formatting
20852138
20862139Container core for IEEE-754 formatting operations.
20872140
2088−- `w` is width: The number of bits in the exponent field.
2089−- `p` is precision: The number of bits in the significand field.
2090−- `w` is bias: Added to exponent when storing.
2091−- `r` is rounding mode: Possible modes are nearest (`$n`), up (`$u`),
2141+- `w` is width: The number of bits in the exponent field.
2142+- `p` is precision: The number of bits in the significand field.
2143+- `w` is bias: Added to exponent when storing.
2144+- `r` is rounding mode: Possible modes are nearest (`$n`), up (`$u`),
20922145 down (`$d`), to zero (`$z`), and away from zero (`$a`). Default value is `%a`.
20932146
20942147#### Source
@@ -2108,6 +2161,7 @@ Container core for IEEE-754 formatting operations.
21082161```
21092162
21102163---
2164+
21112165#### Discussion
21122166
21132167`++ff` has no use outside of the functionality provided to other cores: `++rd`,
@@ -2115,6 +2169,7 @@ Container core for IEEE-754 formatting operations.
21152169meant to power those cores.
21162170
21172171---
2172+
21182173### `++sb:ff`
21192174
21202175Sign bit
@@ -2135,6 +2190,7 @@ Produces the sign bit of `++ff`.
21352190```
21362191
21372192---
2193+
21382194### `++me:ff`
21392195
21402196Minimum exponent
@@ -2155,6 +2211,7 @@ Produces the minimum possible exponent of `ff`.
21552211```
21562212
21572213---
2214+
21582215### `++pa:ff`
21592216
21602217Initialize `fl`
@@ -2187,6 +2244,7 @@ configuration of the `ff` core.
21872244internal use in other cores.
21882245
21892246---
2247+
21902248### `++sea:ff`
21912249
21922250`@r` to `fn`
@@ -2225,6 +2283,7 @@ A `unit` of @s.
22252283```
22262284
22272285---
2286+
22282287### `++bit:ff`
22292288
22302289`fn` to `@r`, rounding
@@ -2253,6 +2312,7 @@ A `@r`.
22532312```
22542313
22552314---
2315+
22562316### `++bif:ff`
22572317
22582318`fn` to `@r`, no rounding
@@ -2295,6 +2355,7 @@ A `flag`.
22952355```
22962356
22972357---
2358+
22982359### `++sig:ff`
22992360
23002361Get sign
@@ -2325,6 +2386,7 @@ A `flag`.
23252386```
23262387
23272388---
2389+
23282390### `++exp:ff`
23292391
23302392Get exponent
@@ -2355,6 +2417,7 @@ A signed integer.
23552417```
23562418
23572419---
2420+
23582421### `++add:ff`
23592422
23602423Add
@@ -2387,6 +2450,7 @@ A `@r`, an IEEE float.
23872450```
23882451
23892452---
2453+
23902454### `++sub:ff`
23912455
23922456Sub
@@ -2419,6 +2483,7 @@ A `@r`, an IEEE float.
24192483```
24202484
24212485---
2486+
24222487### `++mul:ff`
24232488
24242489Multiply
@@ -2451,6 +2516,7 @@ A `@r`, an IEEE float.
24512516```
24522517
24532518---
2519+
24542520### `++div:ff`
24552521
24562522Divide
@@ -2483,6 +2549,7 @@ A `@r`, an IEEE float.
24832549```
24842550
24852551---
2552+
24862553### `++fma:ff`
24872554
24882555Fused multiply-add
@@ -2518,6 +2585,7 @@ A `@r`, an IEEE float.
25182585```
25192586
25202587---
2588+
25212589### `++sqt:ff`
25222590
25232591Square root
@@ -2548,6 +2616,7 @@ A `@r`, an IEEE float.
25482616```
25492617
25502618---
2619+
25512620### `++lth:ff`
25522621
25532622Less than
@@ -2582,6 +2651,7 @@ A `flag`.
25822651```
25832652
25842653---
2654+
25852655### `++lte:ff`
25862656
25872657Less than or equal to
@@ -2616,6 +2686,7 @@ A `flag`.
26162686```
26172687
26182688---
2689+
26192690### `++equ:ff`
26202691
26212692Equals
@@ -2650,6 +2721,7 @@ A `flag`.
26502721```
26512722
26522723---
2724+
26532725### `++gte:ff`
26542726
26552727Greater or equal than
@@ -2684,6 +2756,7 @@ A `flag`.
26842756```
26852757
26862758---
2759+
26872760### `++gth:ff`
26882761
26892762Greater than
@@ -2718,6 +2791,7 @@ A `flag`.
27182791```
27192792
27202793---
2794+
27212795### `++sun:ff`
27222796
27232797Unsigned integer to `@r`
@@ -2747,6 +2821,7 @@ A `@r`, an IEEE float.
27472821```
27482822
27492823---
2824+
27502825### `++san:ff`
27512826
27522827Signed integer to `@r`
@@ -2776,6 +2851,7 @@ A `@r`, an IEEE float.
27762851```
27772852
27782853---
2854+
27792855### `++toi:ff`
27802856
27812857Round to integer
@@ -2805,6 +2881,7 @@ A `flag` of `@s`.
28052881```
28062882
28072883---
2884+
28082885### `++drg:ff`
28092886
28102887`@r` to decimal float
@@ -2837,6 +2914,7 @@ A `dn`.
28372914```
28382915
28392916---
2917+
28402918### `++grd:ff`
28412919
28422920Decimal float to `@r`
@@ -2867,7 +2945,8 @@ A `@r`, an IEEE float.
28672945```
28682946
28692947---
2870−### `++rlyd`
2948+
2949+## `++rlyd`
28712950
28722951Prep `@rd` for print
28732952
@@ -2895,7 +2974,8 @@ A `dn`.
28952974```
28962975
28972976---
2898−### `++rlys`
2977+
2978+## `++rlys`
28992979
29002980Prep @rs for print
29012981
@@ -2923,7 +3003,8 @@ A `dn`.
29233003```
29243004
29253005---
2926−### `++rlyh`
3006+
3007+## `++rlyh`
29273008
29283009Prep `@rh` for print
29293010
@@ -2951,7 +3032,8 @@ A `dn`.
29513032```
29523033
29533034---
2954−### `++rlyq`
3035+
3036+## `++rlyq`
29553037
29563038Prep `@rq` for print
29573039
@@ -2979,7 +3061,8 @@ A `dn`.
29793061```
29803062
29813063---
2982−### `++ryld`
3064+
3065+## `++ryld`
29833066
29843067Finish parsing `@rd`
29853068
@@ -3007,7 +3090,8 @@ A a `@rd`, a double-precision float.
30073090```
30083091
30093092---
3010−### `++ryls`
3093+
3094+## `++ryls`
30113095
30123096Finish parsing `@rs`
30133097
@@ -3038,7 +3122,8 @@ A a `@rs`, a single-precision float.
30383122```
30393123
30403124---
3041−### `++rylh`
3125+
3126+## `++rylh`
30423127
30433128Finish parsing `@rh`
30443129
@@ -3072,7 +3157,8 @@ A a `@rh`, a half-precision float.
30723157```
30733158
30743159---
3075−### `++rylq`
3160+
3161+## `++rylq`
30763162
30773163Finish parsing `@rq`
30783164
@@ -3100,7 +3186,8 @@ A a `@rq`, a quad-precision float.
31003186```
31013187
31023188---
3103−### `++rd`
3189+
3190+## `++rd`
31043191
31053192Double-precision fp
31063193
@@ -3119,6 +3206,7 @@ down (`$d`), and round to zero (`$z`).
31193206```
31203207
31213208---
3209+
31223210### `++ma:rd`
31233211
31243212Initialize `ff`
@@ -3143,6 +3231,7 @@ configuration of the `rd` core.
31433231```
31443232
31453233---
3234+
31463235### `++sea:rd`
31473236
31483237`@rd` to `fn`
@@ -3162,6 +3251,7 @@ Converts `a` from a double-precision binary float to `fn`.
31623251```
31633252
31643253---
3254+
31653255### `++bit:rd`
31663256
31673257`fn` to `@rd`
@@ -3191,6 +3281,7 @@ A `@rd`, a double-precision float.
31913281```
31923282
31933283---
3284+
31943285### `++add:rd`
31953286
31963287Add
@@ -3224,6 +3315,7 @@ A `@rd`.
32243315```
32253316
32263317---
3318+
32273319### `++sub:rd`
32283320
32293321Subtract
@@ -3257,6 +3349,7 @@ A `@rd`.
32573349```
32583350
32593351---
3352+
32603353### `++mul:rd`
32613354
32623355Multiply
@@ -3290,6 +3383,7 @@ A `@rd`.
32903383```
32913384
32923385---
3386+
32933387### `++div:rd`
32943388
32953389Divide
@@ -3323,6 +3417,7 @@ A `@rd`.
33233417```
33243418
33253419---
3420+
33263421### `++fma:rd`
33273422
33283423Fused multiply-add
@@ -3344,7 +3439,6 @@ A `@rd`.
33443439
33453440#### Source
33463441
3347−
33483442#### Source
33493443
33503444```hoon
@@ -3362,6 +3456,7 @@ A `@rd`.
33623456```
33633457
33643458---
3459+
33653460### `++sqt:rd`
33663461
33673462Square root
@@ -3392,6 +3487,7 @@ A `@rd`.
33923487```
33933488
33943489---
3490+
33953491### `++lth:rd`
33963492
33973493Less than
@@ -3431,6 +3527,7 @@ A `@rd`.
34313527```
34323528
34333529---
3530+
34343531### `++lte:rd`
34353532
34363533Less than or equal
@@ -3470,6 +3567,7 @@ A `@rd`.
34703567```
34713568
34723569---
3570+
34733571### `++equ:rd`
34743572
34753573Equals
@@ -3509,6 +3607,7 @@ A `@rd`.
35093607```
35103608
35113609---
3610+
35123611### `++gte:rd`
35133612
35143613Greater than or equal
@@ -3548,6 +3647,7 @@ A `@rd`.
35483647```
35493648
35503649---
3650+
35513651### `++gth:rd`
35523652
35533653Greater than
@@ -3587,6 +3687,7 @@ A `@rd`.
35873687```
35883688
35893689---
3690+
35903691### `++sun:rd`
35913692
35923693Unsigned integer to `@rd`
@@ -3615,6 +3716,7 @@ A `@rd`.
36153716```
36163717
36173718---
3719+
36183720### `++san:rd`
36193721
36203722Unsigned integer to `@rd`
@@ -3643,6 +3745,7 @@ A `@rd`.
36433745```
36443746
36453747---
3748+
36463749### `++sig:rd`
36473750
36483751Get sign
@@ -3671,6 +3774,7 @@ A `flag`.
36713774```
36723775
36733776---
3777+
36743778### `++exp:rd`
36753779
36763780Get exponent
@@ -3699,6 +3803,7 @@ A `@s`.
36993803```
37003804
37013805---
3806+
37023807### `++toi:rd`
37033808
37043809Round to integer
@@ -3727,6 +3832,7 @@ A `unit` of `@s`.
37273832```
37283833
37293834---
3835+
37303836### `++drg:rd`
37313837
37323838`@rd` to decimal float
@@ -3756,6 +3862,7 @@ A `dn`.
37563862```
37573863
37583864---
3865+
37593866### `++grd:rd`
37603867
37613868Decimal float to `@rd`
@@ -3785,7 +3892,8 @@ A `@rd`.
37853892```
37863893
37873894---
3788−### `++rs`
3895+
3896+## `++rs`
37893897
37903898Single-precision fp
37913899
@@ -3804,6 +3912,7 @@ down (`$d`), and round to zero (`$z`).
38043912```
38053913
38063914---
3915+
38073916### `++ma:rs`
38083917
38093918Initialize `ff`
@@ -3828,6 +3937,7 @@ configuration of the `rs` core.
38283937```
38293938
38303939---
3940+
38313941### `++sea:rs`
38323942
38333943`@rs` to `fn`
@@ -3857,6 +3967,7 @@ An `fn`.
38573967```
38583968
38593969---
3970+
38603971### `++bit:rs`
38613972
38623973`fn` to `@rs`
@@ -3886,6 +3997,7 @@ A `@rs`, a single-precision float.
38863997```
38873998
38883999---
4000+
38894001### `++add:rs`
38904002
38914003Add
@@ -3919,6 +4031,7 @@ A `@rs`.
39194031```
39204032
39214033---
4034+
39224035### `++sub:rs`
39234036
39244037Subtract
@@ -3942,6 +4055,7 @@ Subtracts `a` from `b`.
39424055```
39434056
39444057---
4058+
39454059### `++mul:rs`
39464060
39474061Multiply
@@ -3975,6 +4089,7 @@ A `@rs`.
39754089```
39764090
39774091---
4092+
39784093### `++div:rs`
39794094
39804095Divide
@@ -4008,6 +4123,7 @@ A `@rs`.
40084123```
40094124
40104125---
4126+
40114127### `++fma:rs`
40124128
40134129Fused multiply-add
@@ -4044,6 +4160,7 @@ A `@rs`.
40444160```
40454161
40464162---
4163+
40474164### `++sqt:rs`
40484165
40494166Square root
@@ -4075,6 +4192,7 @@ A `@rs`.
40754192```
40764193
40774194---
4195+
40784196### `++lth:rs`
40794197
40804198Less than
@@ -4111,6 +4229,7 @@ A `@rs`.
41114229```
41124230
41134231---
4232+
41144233### `++lte:rs`
41154234
41164235Less than or equal
@@ -4147,6 +4266,7 @@ A `@rs`.
41474266```
41484267
41494268---
4269+
41504270### `++equ:rs`
41514271
41524272Equals
@@ -4183,6 +4303,7 @@ A `@rs`.
41834303```
41844304
41854305---
4306+
41864307### `++gte:rs`
41874308
41884309Greater than or equal
@@ -4219,6 +4340,7 @@ A `@rs`.
42194340```
42204341
42214342---
4343+
42224344### `++gth:rs`
42234345
42244346Greater than
@@ -4258,6 +4380,7 @@ A `@rs`.
42584380```
42594381
42604382---
4383+
42614384### `++sun:rs`
42624385
42634386Unsigned integer to `@rs`
@@ -4286,6 +4409,7 @@ A `@rs`.
42864409```
42874410
42884411---
4412+
42894413### `++san:rs`
42904414
42914415Signed integer to `@rs`'
@@ -4344,6 +4468,7 @@ A `flag`.
43444468```
43454469
43464470---
4471+
43474472### `++exp:rs`
43484473
43494474Get exponent
@@ -4372,6 +4497,7 @@ A signed integer.
43724497```
43734498
43744499---
4500+
43754501### `++toi:rs`
43764502
43774503Round to integer
@@ -4400,6 +4526,7 @@ A `unit` of `@s`.
44004526```
44014527
44024528---
4529+
44034530### `++drg:rs`
44044531
44054532`@rs` to decimal float
@@ -4429,6 +4556,7 @@ A `dn`.
44294556```
44304557
44314558---
4559+
44324560### `++grd:rs`
44334561
44344562Decimal float to `@rs`
@@ -4458,7 +4586,8 @@ A `@rs`.
44584586```
44594587
44604588---
4461−### `++rq`
4589+
4590+## `++rq`
44624591
44634592Quadruple-precision fp
44644593
@@ -4491,6 +4620,7 @@ configuration of the `rq` core.
44914620```
44924621
44934622---
4623+
44944624### `++sea:rq`
44954625
44964626`@rq` to `fn`
@@ -4520,6 +4650,7 @@ An `fn`.
45204650```
45214651
45224652---
4653+
45234654### `++bit:rq`
45244655
45254656`fn` to `@rq`
@@ -4549,6 +4680,7 @@ A `@rq`, a quad-precision float.
45494680```
45504681
45514682---
4683+
45524684### `++add:rq`
45534685
45544686Add
@@ -4582,6 +4714,7 @@ A `@rq`.
45824714```
45834715
45844716---
4717+
45854718### `++sub:rq`
45864719
45874720Subtract
@@ -4618,6 +4751,7 @@ A `@rq`.
46184751```
46194752
46204753---
4754+
46214755### `++mul:rq`
46224756
46234757Multiply
@@ -4651,6 +4785,7 @@ A `@rq`.
46514785```
46524786
46534787---
4788+
46544789### `++div:rq`
46554790
46564791Divide
@@ -4684,6 +4819,7 @@ A `@rq`.
46844819```
46854820
46864821---
4822+
46874823### `++fma:rq`
46884824
46894825Fused multiply-add
@@ -4720,6 +4856,7 @@ A `@rq`.
47204856```
47214857
47224858---
4859+
47234860### `++sqt:rq`
47244861
47254862Square root
@@ -4751,6 +4888,7 @@ A `@rq`.
47514888```
47524889
47534890---
4891+
47544892### `++lth:rq`
47554893
47564894Less than
@@ -4776,7 +4914,6 @@ A `@rq`.
47764914 (lth:ma a b)
47774915```
47784916
4779−
47804917#### Examples
47814918
47824919```
@@ -4788,6 +4925,7 @@ A `@rq`.
47884925```
47894926
47904927---
4928+
47914929### `++lte:rq`
47924930
47934931Less than or equal
@@ -4827,6 +4965,7 @@ A `@rq`.
48274965```
48284966
48294967---
4968+
48304969### `++equ:rq`
48314970
48324971Equals
@@ -4863,6 +5002,7 @@ A `@rq`.
48635002```
48645003
48655004---
5005+
48665006### `++gte:rq`
48675007
48685008Greater than or equal
@@ -4902,6 +5042,7 @@ A `@rq`.
49025042```
49035043
49045044---
5045+
49055046### `++gth:rq`
49065047
49075048Tests whether `a` is greater than `b`.
@@ -4939,6 +5080,7 @@ A `@rq`.
49395080```
49405081
49415082---
5083+
49425084### `++sun:rq`
49435085
49445086Unsigned integer to `@rq`
@@ -4967,6 +5109,7 @@ A `@rq`, a quad-precision float.
49675109```
49685110
49695111---
5112+
49705113### `++san:rq`
49715114
49725115Signed integer to `rq`
@@ -4995,6 +5138,7 @@ A `@rq`, a quad-precision float.
49955138```
49965139
49975140---
5141+
49985142### `++sig:rq`
49995143
50005144Get sign
@@ -5023,6 +5167,7 @@ A `flag`.
50235167```
50245168
50255169---
5170+
50265171### `++exp:rq`
50275172
50285173Get exponent
@@ -5051,6 +5196,7 @@ A `@s`, a signed integer.
50515196```
50525197
50535198---
5199+
50545200### `++toi:rq`
50555201
50565202Round to integer
@@ -5082,6 +5228,7 @@ A `unit` of `@s`.
50825228```
50835229
50845230---
5231+
50855232### `++drg:rq`
50865233
50875234`@rq` to decimal float
@@ -5114,6 +5261,7 @@ A `dn`.
51145261```
51155262
51165263---
5264+
51175265### `++grd:rq`
51185266
51195267Decimal float to `@rq`
@@ -5145,7 +5293,8 @@ A `@rq`, a quad-precision float.
51455293```
51465294
51475295---
5148−### `++rh`
5296+
5297+## `++rh`
51495298
51505299Half-precision fp
51515300
@@ -5164,6 +5313,7 @@ down (`$d`), and round to zero (`$z`).
51645313```
51655314
51665315---
5316+
51675317### `++ma:rh`
51685318
51695319Initialize `ff`
@@ -5179,6 +5329,7 @@ configuration of the `rh` core.
51795329```
51805330
51815331---
5332+
51825333### `++sea:rh`
51835334
51845335`@rh` to `fn`
@@ -5208,6 +5359,7 @@ An `fn`.
52085359```
52095360
52105361---
5362+
52115363### `++bit:rh`
52125364
52135365`fn` to `@rh`
@@ -5237,6 +5389,7 @@ A `@rh`, a half-precision float.
52375389```
52385390
52395391---
5392+
52405393### `++add:rh`
52415394
52425395Produces the sum of `a` plus `b`.
@@ -5268,6 +5421,7 @@ A `@rh`.
52685421```
52695422
52705423---
5424+
52715425### `++sub:rh`
52725426
52735427Subtract
@@ -5304,6 +5458,7 @@ A `@rh`.
53045458```
53055459
53065460---
5461+
53075462### `++mul:rh`
53085463
53095464Multiply
@@ -5337,6 +5492,7 @@ A `@rh`.
53375492```
53385493
53395494---
5495+
53405496### `++div:rh`
53415497
53425498Divide
@@ -5370,6 +5526,7 @@ A `@rh`.
53705526```
53715527
53725528---
5529+
53735530### `++fma:rh`
53745531
53755532Fused multiply-add
@@ -5406,6 +5563,7 @@ A `@rh`.
54065563```
54075564
54085565---
5566+
54095567### `++sqt:rh`
54105568
54115569Square root
@@ -5437,6 +5595,7 @@ A `@rh`.
54375595```
54385596
54395597---
5598+
54405599### `++lth:rh`
54415600
54425601Less than
@@ -5473,6 +5632,7 @@ A `@rh`.
54735632```
54745633
54755634---
5635+
54765636### `++lte:rh`
54775637
54785638Less than or equal
@@ -5512,6 +5672,7 @@ A `@rh`.
55125672```
55135673
55145674---
5675+
55155676### `++equ:rh`
55165677
55175678Equals
@@ -5548,6 +5709,7 @@ A `@rh`.
55485709```
55495710
55505711---
5712+
55515713### `++gte:rh`
55525714
55535715Greater than or equal
@@ -5587,6 +5749,7 @@ A `@rh`.
55875749```
55885750
55895751---
5752+
55905753### `++gth:rh`
55915754
55925755Tests whether `a` is greater than `b`.
@@ -5653,6 +5816,7 @@ A `@rs`, a single-precision float.
56535816```
56545817
56555818---
5819+
56565820### `++fos:rh`
56575821
56585822`@rs` to `@rh`
@@ -5681,6 +5845,7 @@ A `@rh`, a half-precision float.
56815845```
56825846
56835847---
5848+
56845849### `++sun:rh`
56855850
56865851Unsigned integer to `@rh`
@@ -5709,6 +5874,7 @@ A `@rh`, a half-precision float.
57095874```
57105875
57115876---
5877+
57125878### `++san:rh`
57135879
57145880Signed integer to `@rh`
@@ -5737,6 +5903,7 @@ A `@rh`, a half-precision float.
57375903```
57385904
57395905---
5906+
57405907### `++sig:rh`
57415908
57425909Get sign
@@ -5765,6 +5932,7 @@ A `flag`.
57655932```
57665933
57675934---
5935+
57685936### `++exp:rh`
57695937
57705938Get exponent
@@ -5793,6 +5961,7 @@ A `@s`, a signed integer.
57935961```
57945962
57955963---
5964+
57965965### `++toi:rh`
57975966
57985967Round to integer
@@ -5824,6 +5993,7 @@ A `unit` of `@s`.
58245993```
58255994
58265995---
5996+
58275997### `++drg:rh`
58285998
58295999`@rh` to decimal float
@@ -5856,6 +6026,7 @@ A `dn`.
58566026```
58576027
58586028---
6029+
58596030### `++grd:rh`
58606031
58616032Decimal float to `@rh`
@@ -5886,4 +6057,4 @@ A `@rh`, a a half-precision float.
58866057 .~~-3.43e2
58876058```
58886059
5889−---
6060+---
content/docs/hoon/reference/stdlib/3c.md+26−10
@@ -4,7 +4,7 @@ weight = 23
44template = "doc.html"
55+++
66
7−### `++yall`
7+## `++yall`
88
99Time since beginning of time
1010
@@ -60,9 +60,9 @@ A cell of unsigned decimals.
6060 [y=0 m=1 d=1]
6161```
6262
63−
6463---
65−### `++yawn`
64+
65+## `++yawn`
6666
6767Days since beginning of time
6868
@@ -124,7 +124,8 @@ An unsigned decimal.
124124```
125125
126126---
127−### `++year`
127+
128+## `++year`
128129
129130Date to @d
130131
@@ -161,7 +162,8 @@ A `@d`.
161162```
162163
163164---
164−### `++yell`
165+
166+## `++yell`
165167
166168Tarp from atomic date
167169
@@ -212,7 +214,8 @@ A `tarp`.
212214```
213215
214216---
215−### `++yelp`
217+
218+## `++yelp`
216219
217220Leap-week?
218221
@@ -251,7 +254,8 @@ A flag.
251254```
252255
253256---
254−### `++yore`
257+
258+## `++yore`
255259
256260Date from atomic date
257261
@@ -287,7 +291,8 @@ A `date`.
287291```
288292
289293---
290−### `++yule`
294+
295+## `++yule`
291296
292297Daily time to time atom
293298
@@ -349,7 +354,8 @@ A time atom, `@d`.
349354```
350355
351356---
352−### `++yo`
357+
358+## `++yo`
353359
354360Time constants core
355361
@@ -362,6 +368,7 @@ Core whose arms contain constants for interacting with earth time.
362368```
363369
364370---
371+
365372### `++cet:yo`
366373
367374Days in a century
@@ -394,6 +401,7 @@ An atom.
394401```
395402
396403---
404+
397405### `++day:yo`
398406
399407Seconds in day
@@ -421,6 +429,7 @@ An atom.
421429```
422430
423431---
432+
424433### `++era:yo`
425434
426435Leap-year period
@@ -458,6 +467,7 @@ A year is a leap-year if:
458467- **or** if it's divisible by 400.
459468
460469---
470+
461471### `++hor:yo`
462472
463473Seconds in hour
@@ -486,6 +496,7 @@ An atom.
486496```
487497
488498---
499+
489500### `++jes:yo`
490501
491502Maximum 64-bit timestamp
@@ -515,6 +526,7 @@ An atom.
515526The date is December 4, 292,277,026,596.
516527
517528---
529+
518530### `++mit:yo`
519531
520532Seconds in minute
@@ -539,6 +551,7 @@ An atom.
539551```
540552
541553---
554+
542555### `++moh:yo`
543556
544557Days in month
@@ -568,6 +581,7 @@ A `list` of `@ud`
568581```
569582
570583---
584+
571585### `++moy:yo`
572586
573587Days in months of leap-year
@@ -597,6 +611,7 @@ A `list` of `@ud`.
597611```
598612
599613---
614+
600615### `++qad:yo`
601616
602617Seconds in 4 years
@@ -622,6 +637,7 @@ An atom.
622637```
623638
624639---
640+
625641### `++yer:yo`
626642
627643Seconds in year
@@ -646,4 +662,4 @@ An atom.
646662 31.536.000
647663```
648664
649−---
665+---
content/docs/hoon/reference/stdlib/3d.md+26−12
@@ -4,7 +4,7 @@ weight = 24
44template = "doc.html"
55+++
66
7−### `++shad`
7+## `++shad`
88
99Double SHA-256
1010
@@ -34,7 +34,8 @@ An atom.
3434```
3535
3636---
37−### `++shaf`
37+
38+## `++shaf`
3839
3940Half SHA-256
4041
@@ -69,7 +70,8 @@ first and last halves of the 256-bit salted hash `shas`.
6970```
7071
7172---
72−### `++shal`
73+
74+## `++shal`
7375
7476SHA-512 with length
7577
@@ -225,7 +227,8 @@ as a way of saying that the atom `ruz` is shorter than its representative
225227byte-string.
226228
227229---
228−### `++sham`
230+
231+## `++sham`
229232
230233128-bit noun hash
231234
@@ -263,7 +266,8 @@ An atom.
263266```
264267
265268---
266−### `++shan`
269+
270+## `++shan`
267271
268272SHA-1
269273
@@ -359,7 +363,8 @@ An atom.
359363SHA-1 is a deprecated function; it is not considered secure.
360364
361365---
362−### `++shas`
366+
367+## `++shas`
363368
364369Salted hash
365370
@@ -391,7 +396,8 @@ of that logical operation is then itself hashed with SHA-256.
391396```
392397
393398---
394−### `++shaw`
399+
400+## `++shaw`
395401
396402Hash to nbits
397403
@@ -429,7 +435,8 @@ An atom.
429435```
430436
431437---
432−### `++shax`
438+
439+## `++shax`
433440
434441SHA-256
435442
@@ -454,7 +461,8 @@ Produces an atom by hashing an atom `ruz` with SHA-256.
454461```
455462
456463---
457−### `++shay`
464+
465+## `++shay`
458466
459467SHA-256 with length
460468
@@ -578,7 +586,8 @@ as a way of saying that the atom `ruz` is shorter than its representative
578586byte-string.
579587
580588---
581−### `++shaz`
589+
590+## `++shaz`
582591
583592SHA-512
584593
@@ -611,7 +620,8 @@ An atom.
611620```
612621
613622---
614−### `++og`
623+
624+## `++og`
615625
616626Container arm for SHA-256-powered random-number generation. Its sample `a` is an
617627atom that is used as a seed for the hash.
@@ -646,6 +656,7 @@ result every time it is run. Use `eny`, 256 bits of entropy, for a
646656non-deterministic product.
647657
648658---
659+
649660### `++rad:og`
650661
651662Random in range
@@ -687,6 +698,7 @@ An atom.
687698```
688699
689700---
701+
690702### `++rads:og`
691703
692704Random continuation
@@ -732,6 +744,7 @@ generate separate random values from the same seed. Notice how we jump from
732744one `rads` function call to another in the above example.
733745
734746---
747+
735748### `++raw:og`
736749
737750Random bits
@@ -781,12 +794,13 @@ An atom.
781794```
782795
783796---
797+
784798### `++raws:og`
785799
786800Random bits continuation
787801
788802Produces a cell. The head of the cell is an atom with a bitwidth `b` that is
789−composed of random bits. The tail is a new core produced from hashing the
803+composed of random bits. The tail is a new core produced from hashing the
790804parent core with `(raw b)`.
791805
792806#### Source
content/docs/hoon/reference/stdlib/3f.md+20−4
@@ -3,7 +3,8 @@ title = "3f: Scrambling"
33weight = 26
44template = "doc.html"
55+++
6−### `++un`
6+
7+## `++un`
78
89Reversible scrambling
910
@@ -18,6 +19,7 @@ Used in the `@p` phonetic base.
1819```
1920
2021---
22+
2123### `++wren:un`
2224
2325Conceal structure
@@ -70,6 +72,7 @@ An atom.
7072```
7173
7274---
75+
7376### `++wred:un`
7477
7578Restore structure
@@ -122,6 +125,7 @@ An atom.
122125```
123126
124127---
128+
125129### `++xafo:un`
126130
127131Add modulo 255
@@ -159,6 +163,7 @@ An atom.
159163```
160164
161165---
166+
162167### `++xaro:un`
163168
164169Subtract modulo 255
@@ -196,6 +201,7 @@ An atom.
196201```
197202
198203---
204+
199205### `++zaft:un`
200206
201207Look up in 255 sub box
@@ -248,6 +254,7 @@ An atom.
248254```
249255
250256---
257+
251258### `++zart:un`
252259
253260Reverse look up in 255 sub box
@@ -298,6 +305,7 @@ An atom.
298305```
299306
300307---
308+
301309### `++zyft:un`
302310
303311Lookup byte in 256 sub box
@@ -351,6 +359,7 @@ An atom.
351359```
352360
353361---
362+
354363### `++zyrt:un`
355364
356365Reverse lookup byte in 256 sub box
@@ -403,7 +412,8 @@ An atom.
403412```
404413
405414---
406−### `++ob`
415+
416+## `++ob`
407417
408418Reversible scrambling, v2
409419
@@ -416,6 +426,7 @@ A core for performing reversible scrambling operations for the `@p` phonetic
416426base.
417427
418428---
429+
419430### `++feen:ob`
420431
421432Conceal structure, v2
@@ -465,6 +476,7 @@ An atom.
465476```
466477
467478---
479+
468480### `++fend:ob`
469481
470482Restore structure, v2
@@ -518,6 +530,7 @@ An atom.
518530```
519531
520532---
533+
521534### `++fice:ob`
522535
523536Feistel-like cipher
@@ -561,6 +574,7 @@ An atom.
561574```
562575
563576---
577+
564578### `++teil:ob`
565579
566580Reverse Feistel-like cipher
@@ -593,7 +607,6 @@ An atom.
593607 ::
594608```
595609
596−
597610#### Examples
598611
599612```
@@ -605,6 +618,7 @@ An atom.
605618```
606619
607620---
621+
608622### `++rynd:ob`
609623
610624Reverse Feistel-like cipher
@@ -647,6 +661,7 @@ A cell of two atoms.
647661```
648662
649663---
664+
650665### `++rund:ob`
651666
652667Reverse single Feistel-like
@@ -689,6 +704,7 @@ A cell of two atoms.
689704```
690705
691706---
707+
692708### `++raku:ob`
693709
694710Key list
@@ -719,4 +735,4 @@ A list of atoms of aura `@ux` (hexadecimal).
719735 ~[0xb76d.5eed 0xee28.1300 0x85bc.ae01 0x4b38.7af7]
720736```
721737
722−---
738+---
content/docs/hoon/reference/stdlib/3g.md+23−42
@@ -4,8 +4,7 @@ weight = 27
44template = "doc.html"
55+++
66
7−### `++coin`
8−
7+## `++coin`
98
109Noun-literal syntax cases
1110
@@ -22,6 +21,7 @@ and printed using `++so` and `++co` cores.
2221```
2322
2423---
24+
2525#### Examples
2626
2727```
@@ -46,9 +46,9 @@ and printed using `++so` and `++co` cores.
4646 [3 4]
4747```
4848
49−
5049---
51−### `++dime`
50+
51+## `++dime`
5252
5353Aura-atom pair
5454
@@ -71,7 +71,8 @@ to parse atoms of specific auras.
7171```
7272
7373---
74−### `++edge`
74+
75+## `++edge`
7576
7677Parsing location metadata. Parsing location input `p` and optional result `p.q` and parsing continuation `q.q`.
7778
@@ -95,9 +96,9 @@ Parsing location metadata. Parsing location input `p` and optional result `p.q`
9596
9697See also: [Section 3g](/docs/hoon/reference/stdlib/3g#rule), `++rule`
9798
98−
9999---
100−### `++hair`
100+
101+## `++hair`
101102
102103Parsing line and column
103104
@@ -126,7 +127,8 @@ A pair of two `@ud` used in parsing indicating line and column number.
126127```
127128
128129---
129−### `++like`
130+
131+## `++like`
130132
131133Generic edge
132134
@@ -160,7 +162,8 @@ Generates an `++edge` with a parsed result set to a specific type.
160162```
161163
162164---
163−### `++nail`
165+
166+## `++nail`
164167
165168Location, remainder of parsed text
166169
@@ -180,31 +183,8 @@ Indicates parsing position `p`, and remaining text to be parsed `q`.
180183```
181184
182185---
183−### `++path`
184−
185−Filesystem path
186−
187−A list of `++knot`s. `++knot` is another name for `@ta`.
188−
189−#### Source
190−
191−```hoon
192− ++ path (list knot)
193−```
194−
195−#### Examples
196186
197−```
198− > `path`"abc"
199− /a/b/c
200−```
201−
202−#### Discussion
203−
204−Used in `%clay` and `%eyre` extensively.
205−
206−---
207−### `++pint`
187+## `++pint`
208188
209189Parsing range
210190
@@ -227,15 +207,14 @@ stack traces.
227207 [p=[p=1 q=4] q=[p=1 q=6]]
228208```
229209
230−
231210---
232−### `++rule`
211+
212+## `++rule`
233213
234214Parsing rule
235215
236216An empty parsing rule, but used to check that parsing rules match this with `_`.
237217
238−
239218#### Source
240219
241220```hoon
@@ -250,7 +229,8 @@ An empty parsing rule, but used to check that parsing rules match this with `_`.
250229```
251230
252231---
253−### `++spot`
232+
233+## `++spot`
254234
255235Stack trace line
256236
@@ -271,14 +251,14 @@ The stack trace that is printed after crashing.
271251```
272252
273253---
274−### `++tone`
254+
255+## `++tone`
275256
276257Nock result, error report
277258
278259Produces either success (`%0`), a block with list of requests blocked on (`%1`),
279260or failure with an error report (`%2`).
280261
281−
282262#### Source
283263
284264```hoon
@@ -319,14 +299,14 @@ or failure with an error report (`%2`).
319299```
320300
321301---
322−### `++toon`
302+
303+## `++toon`
323304
324305Nock result, stack trace
325306
326307Produces either success (`%0`), a block with list of requests blocked on (`%1`),
327308or failure with a stack trace (`%2`).
328309
329−
330310#### Source
331311
332312```hoon
@@ -347,7 +327,8 @@ or failure with a stack trace (`%2`).
347327```
348328
349329---
350−### `++wonk`
330+
331+## `++wonk`
351332
352333Product from edge
353334
content/docs/hoon/reference/stdlib/4a.md+5−1
@@ -4,7 +4,7 @@ weight = 28
44template = "doc.html"
55+++
66
7−### `++po`
7+## `++po`
88
99Phonetic base
1010
@@ -54,6 +54,7 @@ contained arms.
5454```
5555
5656---
57+
5758### `++ind:po`
5859
5960Parse suffix
@@ -92,6 +93,7 @@ A `unit`.
9293```
9394
9495---
96+
9597### `++ins:po`
9698
9799Parse prefix
@@ -133,6 +135,7 @@ A `unit` of an atom.
133135```
134136
135137---
138+
136139### `++tod:po`
137140
138141Fetch suffix
@@ -177,6 +180,7 @@ An atom.
177180```
178181
179182---
183+
180184### `++tos:po`
181185
182186Fetch prefix
content/docs/hoon/reference/stdlib/4b.md+36−37
@@ -4,7 +4,7 @@ weight = 29
44template = "doc.html"
55+++
66
7−### `++at`
7+## `++at`
88
99```hoon
1010 ++ at
@@ -13,8 +13,6 @@ template = "doc.html"
1313
1414XX document
1515
16−
17−
1816### `++r:at`
1917
2018```hoon
@@ -34,7 +32,6 @@ XX document
3432 rux
3533```
3634
37−
3835XX document
3936
4037### `++rf:at`
@@ -43,7 +40,6 @@ XX document
4340 ++ rf `tape`[?-(a $& '&', $| '|', * !!) ~]
4441```
4542
46−
4743XX document
4844
4945### `++rn:at`
@@ -179,10 +175,9 @@ XX document
179175
180176---
181177
182−
183178---
184179
185−### `++cass`
180+## `++cass`
186181
187182To lowercase
188183
@@ -220,7 +215,8 @@ A `++tape`.
220215```
221216
222217---
223−### `++crip`
218+
219+## `++crip`
224220
225221Tape to cord
226222
@@ -254,7 +250,8 @@ A `++cord`.
254250```
255251
256252---
257−### `++cuss`
253+
254+## `++cuss`
258255
259256To uppercase
260257
@@ -292,7 +289,8 @@ A `++tape`.
292289```
293290
294291---
295−### `++mesc`
292+
293+## `++mesc`
296294
297295Escape special chars
298296
@@ -332,9 +330,9 @@ A `++tape`.
332330 "as\0x27/sa\0xc3/\0x9f/"
333331```
334332
335−
336333---
337−### `++runt`
334+
335+## `++runt`
338336
339337Prepend `n` times
340338
@@ -371,9 +369,9 @@ A `++tape`.
371369 "aaaaaaaaaa"
372370```
373371
374−
375372---
376−### `++sand`
373+
374+## `++sand`
377375
378376Soft-cast by aura
379377
@@ -408,9 +406,9 @@ A `(unit @)`.
408406 ~
409407```
410408
411−
412409---
413−### `++sane`
410+
411+## `++sane`
414412
415413Check aura validity
416414
@@ -477,9 +475,9 @@ A boolean.
477475 %.n
478476```
479477
480−
481478---
482−### `++teff`
479+
480+## `++teff`
483481
484482UTF8 Length
485483
@@ -514,9 +512,9 @@ An atom.
514512 2
515513```
516514
517−
518515---
519−### `++trim`
516+
517+## `++trim`
520518
521519Tape split
522520
@@ -555,9 +553,9 @@ A cell of `++tape`s, `p` and `q`.
555553 [p="zam" q=""]
556554```
557555
558−
559556---
560−### `++trip`
557+
558+## `++trip`
561559
562560Cord to tape
563561
@@ -594,9 +592,9 @@ A `++tape`.
594592 "abc"
595593```
596594
597−
598595---
599−### `++tuba`
596+
597+## `++tuba`
600598
601599UTF8 to UTF32 tape
602600
@@ -629,9 +627,9 @@ A `++list` of codepoints `@c`.
629627 ~[~-c ~-h ~-a ~-r ~-s]
630628```
631629
632−
633630---
634−### `++tufa`
631+
632+## `++tufa`
635633
636634UTF32 to UTF8 tape
637635
@@ -665,9 +663,9 @@ A `++tape`.
665663 "ab±c"
666664```
667665
668−
669666---
670−### `++tuft`
667+
668+## `++tuft`
671669
672670UTF32 to UTF8 text
673671
@@ -724,9 +722,9 @@ A `++cord`.
724722 '¶'
725723```
726724
727−
728725---
729−### `++turf`
726+
727+## `++turf`
730728
731729UTF8 to UTF32 cord
732730
@@ -781,9 +779,9 @@ A `@c`, UTF-32 codepoint.
781779 0x442.0000.0443.0000.0442.0000.0020.0000.044f
782780```
783781
784−
785782---
786−### `++wack`
783+
784+## `++wack`
787785
788786Coin format encode
789787
@@ -831,7 +829,8 @@ A `++span` (`@ta`).
831829```
832830
833831---
834−### `++wick`
832+
833+## `++wick`
835834
836835Coin format decode
837836
@@ -877,9 +876,9 @@ A `++span` `@ta`.
877876 '~20_sam~'
878877```
879878
880−
881879---
882−### `++woad`
880+
881+## `++woad`
883882
884883Unescape cord
885884
@@ -938,9 +937,9 @@ A `++cord`.
938937 '¶20 as'
939938```
940939
941−
942940---
943−### `++wood`
941+
942+## `++wood`
944943
945944Escape cord
946945
content/docs/hoon/reference/stdlib/4c.md+12−16
@@ -4,7 +4,7 @@ weight = 30
44template = "doc.html"
55+++
66
7−### `++re`
7+## `++re`
88
99Pretty-printing engine
1010
@@ -29,6 +29,7 @@ Pretty-printing engine that accepts a `++tank` sample and contains arms that per
2929```
3030
3131---
32+
3233### `++ram:re`
3334
3435Flatten to tape
@@ -71,7 +72,9 @@ A `++tape`.
7172 > ~(ram re rose+["." "(" ")"]^~[leaf+"bar" leaf+"baz" leaf+"bam"])
7273 "(bar.baz.bam)"
7374```
75+
7476---
77+
7578### `++win:re`
7679
7780Render at indent
@@ -136,6 +139,7 @@ A `++wall` (`++list` of `++tapes`).
136139```
137140
138141---
142+
139143### `++din:re`
140144
141145XX document
@@ -148,7 +152,6 @@ XX document
148152
149153 ++ din (mod (add 2 tab) (mul 2 (div edg 3)))
150154
151−
152155---
153156
154157### `++fit:re`
@@ -163,14 +166,10 @@ Determine whether `tac` fits on one line. Internal to `++win`
163166
164167#### Source
165168
166−++ fit (lte (lent ram) (sub edg tab))
167−
169+++ fit (lte (lent ram) (sub edg tab))
168170
169171#### Examples
170172
171−
172−
173−
174173---
175174
176175### `++rig:re`
@@ -216,6 +215,7 @@ A `++wall` (list of `++tape`s).
216215#### Examples
217216
218217---
218+
219219### `++wig:re`
220220
221221`++win` render tape
@@ -248,10 +248,9 @@ Render `++tape`. Internal to `++win`.
248248 --
249249```
250250
251−
252−
253251---
254−### `++show`
252+
253+## `++show`
255254
256255```hoon
257256 ++ show :: XX deprecated, use span
@@ -314,7 +313,7 @@ Render `++tape`. Internal to `++win`.
314313
315314XX document
316315
317−### `++shep`
316+## `++shep`
318317
319318```hoon
320319 ++ shep
@@ -338,7 +337,7 @@ XX document
338337
339338XX document
340339
341−### `++shop`
340+## `++shop`
342341
343342```hoon
344343 ++ shop
@@ -356,9 +355,6 @@ XX document
356355 ::
357356```
358357
359−
360358XX document
361359
362−
363−
364−---
360+---
content/docs/hoon/reference/stdlib/4d.md+4−4
@@ -4,7 +4,7 @@ weight = 31
44template = "doc.html"
55+++
66
7−### `++last`
7+## `++last`
88
99Further trace
1010
@@ -48,7 +48,8 @@ A `hair`.
4848```
4949
5050---
51−### `++lust`
51+
52+## `++lust`
5253
5354Detect newline
5455
@@ -73,7 +74,6 @@ A hair.
7374 ?:(=(`@`10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
7475```
7576
76−
7777#### Examples
7878
7979```
@@ -97,4 +97,4 @@ A hair.
9797 [2 6]
9898```
9999
100−---
100+---
content/docs/hoon/reference/stdlib/4e.md+20−33
@@ -4,7 +4,7 @@ weight = 32
44template = "doc.html"
55+++
66
7−### `++bend`
7+## `++bend`
88
99Conditional composer
1010
@@ -70,9 +70,9 @@ A `++rule`.
7070 [~ %sep]
7171```
7272
73−
7473---
75−### `++comp`
74+
75+## `++comp`
7676
7777Arbitrary compose
7878
@@ -123,7 +123,8 @@ A `++rule`.
123123```
124124
125125---
126−### `++fail`
126+
127+## `++fail`
127128
128129Never parse
129130
@@ -154,9 +155,9 @@ An `++edge`.
154155 [p=[p=1.337 q=70] q=~]
155156```
156157
157−
158158---
159−### `++glue`
159+
160+## `++glue`
160161
161162Skip delimiter
162163
@@ -174,8 +175,6 @@ result.
174175
175176#### Produces
176177
177−
178−
179178#### Source
180179
181180```hoon
@@ -205,7 +204,8 @@ result.
205204```
206205
207206---
208−### `++less`
207+
208+## `++less`
209209
210210Parse unless
211211
@@ -220,8 +220,6 @@ connect `vex` with the following `++rule`.
220220
221221#### Produces
222222
223−
224−
225223#### Source
226224
227225```hoon
@@ -249,9 +247,9 @@ connect `vex` with the following `++rule`.
249247 ! exit
250248```
251249
252−
253250---
254−### `++pfix`
251+
252+## `++pfix`
255253
256254Discard first rule
257255
@@ -264,8 +262,6 @@ ignoring the result of the first and producing the result of the second.
264262
265263#### Produces
266264
267−
268−
269265#### Source
270266
271267```hoon
@@ -284,9 +280,9 @@ ignoring the result of the first and producing the result of the second.
284280 q=10
285281```
286282
287−
288283---
289−### `++plug`
284+
285+## `++plug`
290286
291287Parse to tuple
292288
@@ -302,8 +298,6 @@ more detailed explanation.
302298
303299#### Produces
304300
305−
306−
307301#### Source
308302
309303```hoon
@@ -333,9 +327,9 @@ more detailed explanation.
333327 [%moke '/' ~ %da ~2014.1.1]
334328```
335329
336−
337330---
338−### `++pose`
331+
332+## `++pose`
339333
340334Parse options
341335
@@ -350,8 +344,6 @@ following rule `sab`. See also: the monad applicator ;\~
350344
351345#### Produces
352346
353−
354−
355347#### Source
356348
357349```hoon
@@ -382,9 +374,9 @@ following rule `sab`. See also: the monad applicator ;\~
382374 ! exit
383375```
384376
385−
386377---
387−### `++sfix`
378+
379+## `++sfix`
388380
389381Discard second rule
390382
@@ -399,8 +391,6 @@ result of the first and discarding the result of the second.
399391
400392#### Produces
401393
402−
403−
404394#### Source
405395
406396```hoon
@@ -419,9 +409,9 @@ result of the first and discarding the result of the second.
419409 q=10
420410```
421411
422−
423412---
424−### `++simu`
413+
414+## `++simu`
425415
426416First and second
427417
@@ -436,8 +426,6 @@ connect `vex` with the following `++rule`.
436426
437427#### Produces
438428
439−
440−
441429#### Source
442430
443431```hoon
@@ -467,5 +455,4 @@ connect `vex` with the following `++rule`.
467455 ! exit
468456```
469457
470−
471−---
458+---
content/docs/hoon/reference/stdlib/4f.md+49−53
@@ -4,7 +4,7 @@ weight = 33
44template = "doc.html"
55+++
66
7−### `++bass`
7+## `++bass`
88
99Parser modifier: LSB
1010ordered `++list` as atom of a `++base`.
@@ -44,10 +44,9 @@ A `++rule`.
4444 0b101.0011
4545```
4646
47−
4847---
4948
50−### `++boss`
49+## `++boss`
5150
5251Parser modifier: LSB
5352
@@ -91,7 +90,8 @@ A `++rule`.
9190```
9291
9392---
94−### `++cold`
93+
94+## `++cold`
9595
9696Replace with constant
9797
@@ -132,9 +132,9 @@ An `++edge`.
132132 [p=[p=1 q=1] q=~]
133133```
134134
135−
136135---
137−### `++cook`
136+
137+## `++cook`
138138
139139Apply gate
140140
@@ -182,9 +182,9 @@ An `++rule`.
182182 [p=[p=1 q=2] q=[~ u=[p='b' q=[p=[p=1 q=2] q="bc"]]]]
183183```
184184
185−
186185---
187−### `++easy`
186+
187+## `++easy`
188188
189189Always parse
190190
@@ -225,9 +225,9 @@ A `++rule`.
225225 [p=[p=1 q=1] q=[~ [p='a' q=[p=[p=1 q=1] q="bc"]]]]
226226```
227227
228−
229228---
230−### `++full`
229+
230+## `++full`
231231
232232Parse to end
233233
@@ -266,9 +266,9 @@ A `++rule`.
266266 [p=[p=1 q=3] q=[~ u=[p=[~~a ~~b] q=[p=[p=1 q=3] q=""]]]]
267267```
268268
269−
270269---
271−### `++funk`
270+
271+## `++funk`
272272
273273Add to tape
274274
@@ -303,9 +303,9 @@ A `++rule`.
303303 [p=[p=1 q=4] q=~]
304304```
305305
306−
307306---
308−### `++here`
307+
308+## `++here`
309309
310310Place-based apply
311311
@@ -351,9 +351,9 @@ A `++rule`.
351351 ~[[[[p=1 q=1] p=1 q=2] ~~a] [[[p=1 q=2] p=1 q=3] ~~b] [[[p=1 q=3] p=1 q=4] ~~c]]
352352```
353353
354−
355354---
356−### `++ifix`
355+
356+## `++ifix`
357357
358358Infix
359359
@@ -392,9 +392,9 @@ A `++rule`.
392392 "my"
393393```
394394
395−
396395---
397−### `++jest`
396+
397+## `++jest`
398398
399399Match a cord
400400
@@ -445,9 +445,9 @@ An `++edge`.
445445 [p=[p=1 q=9] q=[~ [p='john doe' q=[p=[p=1 q=9] q=""]]]]
446446```
447447
448−
449448---
450−### `++just`
449+
450+## `++just`
451451
452452Match a char
453453
@@ -496,9 +496,9 @@ A `++rule`.
496496 ~~~25.
497497```
498498
499−
500499---
501−### `++knee`
500+
501+## `++knee`
502502
503503Recursive parsers
504504
@@ -552,9 +552,9 @@ A `++rule`.
552552 [~~a "bcd"]
553553```
554554
555−
556555---
557−### `++mask`
556+
557+## `++mask`
558558
559559Match char
560560
@@ -603,7 +603,8 @@ A `++rule`.
603603```
604604
605605---
606−### `++more`
606+
607+## `++more`
607608
608609Parse list with delimiter
609610
@@ -641,9 +642,9 @@ A `++rule`.
641642 [q=40 ~[q=20 q=60 q=1 q=5]]
642643```
643644
644−
645645---
646−### `++most`
646+
647+## `++most`
647648
648649Parse list of at least one match
649650
@@ -682,9 +683,9 @@ A `++rule`.
682683 ! exit
683684```
684685
685−
686686---
687−### `++next`
687+
688+## `++next`
688689
689690Consume char
690691
@@ -721,10 +722,9 @@ An `++edge`.
721722 [p=[p=1 q=2] q=[~ [p=~~j q=[p=[p=1 q=2] q="ohn jumps jones"]]]]
722723```
723724
724−
725725---
726726
727−### `++plus`
727+## `++plus`
728728
729729List of at least one match.
730730
@@ -760,9 +760,9 @@ A `++rule`.
760760 ['-' [' ' [' ' ['-' [' ' ~]]]]]
761761```
762762
763−
764763---
765−### `++sear`
764+
765+## `++sear`
766766
767767Conditional `++cook`
768768
@@ -803,9 +803,9 @@ A `++rule`.
803803 [p=[p=1 q=2] q=~]
804804```
805805
806−
807806---
808−### `++shim`
807+
808+## `++shim`
809809
810810Char in range
811811
@@ -851,9 +851,9 @@ A `++rule`.
851851 [p=[p=1 q=2] q=[~ [p=~~~41. q=[p=[p=1 q=2] q="bc"]]]]
852852```
853853
854−
855854---
856−### `++slug` {#slug}
855+
856+## `++slug` {#slug}
857857
858858Use gate to parse delimited list
859859
@@ -890,9 +890,9 @@ A `++rule`.
890890 'abc'
891891```
892892
893−
894893---
895−### `++stag`
894+
895+## `++stag`
896896
897897Add label
898898
@@ -936,9 +936,9 @@ A `++rule`.
936936 [p=[p=1 q=2] q=[~ u=[p=[10.000 ~~a] q=[p=[p=1 q=2] q="bc"]]]]
937937```
938938
939−
940939---
941−### `++star`
940+
941+## `++star`
942942
943943List of matches
944944
@@ -979,9 +979,9 @@ Parser modifier: parse `++list` of matches.
979979 "john smith"
980980```
981981
982−
983982---
984−### `++stet`
983+
984+## `++stet`
985985
986986Add faces
987987
@@ -993,8 +993,6 @@ Add faces `[p q]` to range-parser pairs in a list.
993993
994994#### Produces
995995
996−
997−
998996#### Source
999997
1000998```hoon
@@ -1030,9 +1028,9 @@ Add faces `[p q]` to range-parser pairs in a list.
10301028 ]
10311029```
10321030
1033−
10341031---
1035−### `++stew`
1032+
1033+## `++stew`
10361034
10371035Switch by first
10381036
@@ -1083,15 +1081,13 @@ Switch by first
10831081 ::
10841082```
10851083
1086−
10871084Parser generator. From an associative `++list` of characters or character
10881085ranges to `++rule`s, construct a `++map`, and parse `++tape`s only
10891086with `++rules` associated with a range that the `++tape`'s first character falls in.
10901087
1091−
1092−
10931088---
1094−### `++stir`
1089+
1090+## `++stir`
10951091
10961092Parse repeatedly
10971093
@@ -1137,9 +1133,9 @@ A rule.
11371133 b=294
11381134```
11391135
1140−
11411136---
1142−### `++stun`
1137+
1138+## `++stun`
11431139
11441140Parse several times
11451141
content/docs/hoon/reference/stdlib/4g.md+8−8
@@ -4,7 +4,7 @@ weight = 34
44template = "doc.html"
55+++
66
7−### `++rash`
7+## `++rash`
88
99Parse or crash
1010
@@ -47,9 +47,9 @@ The value of the parse result, or crash.
4747 ! exit
4848```
4949
50−
5150---
52−### `++rush`
51+
52+## `++rush`
5353
5454Parse or null
5555
@@ -91,9 +91,9 @@ The value of the parse result, or null.
9191 ~
9292```
9393
94−
9594---
96−### `++rust`
95+
96+## `++rust`
9797
9898Parse tape or null
9999
@@ -131,9 +131,9 @@ A `(unit ,@t)`
131131 ~
132132```
133133
134−
135134---
136−### `++scan`
135+
136+## `++scan`
137137
138138Parse tape or crash
139139
@@ -176,4 +176,4 @@ Either a `++tape` or a crash.
176176 ! exit
177177```
178178
179−---
179+---
content/docs/hoon/reference/stdlib/4h.md+66−64
@@ -4,7 +4,7 @@ weight = 35
44template = "doc.html"
55+++
66
7−### `++ace`
7+## `++ace`
88
99Parse space
1010
@@ -33,9 +33,9 @@ Parses ASCII character 32, space.
3333 [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="abc "]]]]
3434```
3535
36−
3736---
38−### `++bar`
37+
38+## `++bar`
3939
4040Parse vertical bar
4141
@@ -63,9 +63,9 @@ Parses ASCII character 124, the vertical bar.
6363 [p=[p=1 q=2] q=[~ [p=~~~7c. q=[p=[p=1 q=2] q="="]]]]
6464```
6565
66−
6766---
68−### `++bas`
67+
68+## `++bas`
6969
7070Parse backslash
7171
@@ -98,9 +98,9 @@ character, `\`.
9898 [p=[p=1 q=1] q=~]
9999```
100100
101−
102101---
103−### `++buc`
102+
103+## `++buc`
104104
105105Parse dollar sign
106106
@@ -128,9 +128,9 @@ Parses ASCII character 36, the dollar sign.
128128 [p=[p=1 q=2] q=[~ [p=~~~24. q=[p=[p=1 q=2] q="%"]]]]
129129```
130130
131−
132131---
133−### `++cab`
132+
133+## `++cab`
134134
135135Parse underscore
136136
@@ -158,9 +158,9 @@ Parses ASCII character 95, the underscore.
158158 [p=[p=1 q=1] q=~]
159159```
160160
161−
162161---
163−### `++cen`
162+
163+## `++cen`
164164
165165Parses percent sign
166166
@@ -188,9 +188,9 @@ Parses ASCII character 37, the percent sign.
188188 [p=[p=1 q=2] q=[~ [p=~~~25. q=[p=[p=1 q=2] q="^"]]]]
189189```
190190
191−
192191---
193−### `++col`
192+
193+## `++col`
194194
195195Parse colon
196196
@@ -219,7 +219,8 @@ Parses ASCII character 58, the colon
219219```
220220
221221---
222−### `++com`
222+
223+## `++com`
223224
224225Parse comma
225226
@@ -247,9 +248,9 @@ Parses ASCII character 44, the comma.
247248 [p=[p=1 q=1] q=~]
248249```
249250
250−
251251---
252−### `++doq`
252+
253+## `++doq`
253254
254255Parse double quote
255256
@@ -282,9 +283,9 @@ Parses ASCII character 34, the double quote.
282283 ! exit
283284```
284285
285−
286286---
287−### `++dot`
287+
288+## `++dot`
288289
289290Parse period
290291
@@ -312,9 +313,9 @@ Parses ASCII character 46, the period.
312313 [p=[p=1 q=2] q=[~ [p=~~~. q=[p=[p=1 q=2] q="^"]]]]
313314```
314315
315−
316316---
317−### `++fas`
317+
318+## `++fas`
318319
319320Parse forward slash
320321
@@ -339,9 +340,9 @@ Parses ASCII character 47, the forward slash.
339340 [p=[p=1 q=1] q=~]
340341```
341342
342−
343343---
344−### `++gal`
344+
345+## `++gal`
345346
346347Parse less-than sign
347348
@@ -369,9 +370,9 @@ Parses ASCII character 60, the less-than sign.
369370 [p=[p=1 q=1] q=~]
370371```
371372
372−
373373---
374−### `++gar`
374+
375+## `++gar`
375376
376377Parse greater-than sign
377378
@@ -399,9 +400,9 @@ Parses ASCII character 62, the greater-than sign.
399400 [p=[p=1 q=1] q=~]
400401```
401402
402−
403403---
404−### `++hax`
404+
405+## `++hax`
405406
406407Parse number sign
407408
@@ -426,9 +427,9 @@ Parses ASCII character 35, the number sign.
426427 [p=[p=1 q=2] q=[~ [p=~~~23. q=[p=[p=1 q=2] q="!"]]]]
427428```
428429
429−
430430---
431−### `++hep`
431+
432+## `++hep`
432433
433434Parse hyphen
434435
@@ -453,9 +454,9 @@ Parses ASCII character 45, the hyphen.
453454 [p=[p=1 q=1] q=~]
454455```
455456
456−
457457---
458−### `++kel`
458+
459+## `++kel`
459460
460461Parse left curley bracket
461462
@@ -482,9 +483,9 @@ interpolation. To parse either of them, they must be escaped.
482483 [p=[p=1 q=1] q=~]
483484```
484485
485−
486486---
487−### `++ker`
487+
488+## `++ker`
488489
489490Parse right curley bracket
490491
@@ -511,9 +512,9 @@ interpolation. To parse either of them, they must be escaped.
511512 [p=[p=1 q=1] q=~]
512513```
513514
514−
515515---
516−### `++ket`
516+
517+## `++ket`
517518
518519Parse caret
519520
@@ -539,7 +540,8 @@ Parses ASCII character 94, the caret.
539540```
540541
541542---
542−### `++lus`
543+
544+## `++lus`
543545
544546Parse plus sign
545547
@@ -567,9 +569,9 @@ Parses ASCII character 43, the plus sign.
567569 [p=[p=1 q=1] q=~]
568570```
569571
570−
571572---
572−### `++pam`
573+
574+## `++pam`
573575
574576Parse ampersand
575577
@@ -597,9 +599,9 @@ Parses ASCII character 38, the ampersand.
597599 [p=[p=1 q=1] q=~]
598600```
599601
600−
601602---
602−### `++pat`
603+
604+## `++pat`
603605
604606Parse "at" sign
605607
@@ -627,9 +629,9 @@ Parses ASCII character 64, the "at" sign.
627629 [p=[p=1 q=1] q=~]
628630```
629631
630−
631632---
632−### `++pel`
633+
634+## `++pel`
633635
634636Parse left parenthesis
635637
@@ -654,9 +656,9 @@ Parses ASCII character 40, the left parenthesis.
654656 [p=[p=1 q=1] q=~]
655657```
656658
657−
658659---
659−### `++per`
660+
661+## `++per`
660662
661663Parse right parenthesis
662664
@@ -681,9 +683,9 @@ Parses ASCII character 41, the right parenthesis.
681683 [p=[p=1 q=1] q=~]
682684```
683685
684−
685686---
686−### `++sel`
687+
688+## `++sel`
687689
688690Parse left square bracket
689691
@@ -708,9 +710,9 @@ Parses ASCII character 91, the left square bracket.
708710 [p=[p=1 q=1] q=~]
709711```
710712
711−
712713---
713−### `++sem`
714+
715+## `++sem`
714716
715717Parse semicolon
716718
@@ -735,9 +737,9 @@ Parses ASCII character 59, the semicolon.
735737 [p=[p=1 q=1] q=~]
736738```
737739
738−
739740---
740−### `++ser`
741+
742+## `++ser`
741743
742744Parse right square bracket
743745
@@ -762,9 +764,9 @@ Parses ASCII character 93, the right square bracket.
762764 [p=[p=1 q=1] q=~]
763765```
764766
765−
766767---
767−### `++sig`
768+
769+## `++sig`
768770
769771Parse tilde
770772
@@ -789,9 +791,9 @@ Parses ASCII character 126, the tilde.
789791 [p=[p=1 q=1] q=~]
790792```
791793
792−
793794---
794−### `++soq`
795+
796+## `++soq`
795797
796798Parse single quote
797799
@@ -817,9 +819,9 @@ Parses ASCII character 39, soq. Note the extra '' is to escape the first
817819 [p=[p=1 q=1] q=~]
818820```
819821
820−
821822---
822−### `++tar`
823+
824+## `++tar`
823825
824826Parse asterisk
825827
@@ -847,9 +849,9 @@ Parses ASCII character 42, the asterisk.
847849 [p=[p=1 q=1] q=~]
848850```
849851
850−
851852---
852−### `++tec`
853+
854+## `++tec`
853855
854856Parse backtick
855857
@@ -878,9 +880,9 @@ accent").
878880 [p=[p=1 q=1] q=~]
879881```
880882
881−
882883---
883−### `++tis`
884+
885+## `++tis`
884886
885887Parse equals sign
886888
@@ -906,7 +908,8 @@ Parses ASCII character 61, the equals sign.
906908```
907909
908910---
909−### `++wut`
911+
912+## `++wut`
910913
911914Parses question mark
912915
@@ -931,9 +934,9 @@ Parses ASCII character 63, the question mark.
931934 [p=[p=1 q=1] q=~]
932935```
933936
934−
935937---
936−### `++zap`
938+
939+## `++zap`
937940
938941Exclamation point
939942
@@ -958,5 +961,4 @@ Parses ASCII character 33, the exclamation point zap.
958961 [p=[p=1 q=1] q=~]
959962```
960963
961−
962−---
964+---
content/docs/hoon/reference/stdlib/4i.md+70−72
@@ -4,7 +4,7 @@ weight = 36
44template = "doc.html"
55+++
66
7−### `++alf`
7+## `++alf`
88
99Alphabetic characters
1010
@@ -29,9 +29,9 @@ Parse alphabetic characters, both upper and lowercase.
2929 "AaBbCc"
3030```
3131
32−
3332---
34−### `++aln`
33+
34+## `++aln`
3535
3636Alphanumeric characters
3737
@@ -56,9 +56,9 @@ Parse alphanumeric characters - both alphabetic characters and numbers.
5656 "0123456789abcdef"
5757```
5858
59−
6059---
61−### `++alp`
60+
61+## `++alp`
6262
6363Alphanumeric and `-`
6464
@@ -83,10 +83,9 @@ Parse alphanumeric strings and hep, "-".
8383 "123abc-"
8484```
8585
86−
8786---
8887
89−### `++bet`
88+## `++bet`
9089
9190Axis syntax `-`, `+`
9291
@@ -108,9 +107,9 @@ Parse the hep and lus axis syntax.
108107 3
109108```
110109
111−
112110---
113−### `++bin`
111+
112+## `++bin`
114113
115114Binary to atom
116115
@@ -138,9 +137,9 @@ Parse a tape of binary (0s and 1s) and produce its atomic representation.
138137 2.063
139138```
140139
141−
142140---
143−### `++but`
141+
142+## `++but`
144143
145144Binary digit
146145
@@ -167,9 +166,9 @@ Parse a single binary digit.
167166 ~[0 1]
168167```
169168
170−
171169---
172−### `++cit`
170+
171+## `++cit`
173172
174173Octal digit
175174
@@ -196,9 +195,9 @@ Parse a single octal digit.
196195 ~[6 0]
197196```
198197
199−
200198---
201−### `++dem`
199+
200+## `++dem`
202201
203202Decimal to atom
204203
@@ -223,9 +222,9 @@ Parse a decimal number to an atom.
223222 12.456
224223```
225224
226−
227225---
228−### `++dit`
226+
227+## `++dit`
229228
230229Decimal digit
231230
@@ -248,9 +247,9 @@ Parse a single decimal digit.
248247 ~[2 6 0 0 0]
249248```
250249
251−
252250---
253−### `++dog`
251+
252+## `++dog`
254253
255254`.` optional gap
256255
@@ -273,9 +272,9 @@ Dot followed by an optional gap, used with numbers.
273272 [~~~. ~]
274273```
275274
276−
277275---
278−### `++doh`
276+
277+## `++doh`
279278
280279`@p` separator
281280
@@ -301,9 +300,9 @@ Phonetic base phrase separator
301300 [[~~- ~~-] ~]
302301```
303302
304−
305303---
306−### `++dun`
304+
305+## `++dun`
307306
308307`--` to `~`
309308
@@ -324,10 +323,9 @@ Parse phep, `--`, to null, `~`.
324323 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=""]]]]
325324```
326325
327−
328326---
329327
330−### `++duz`
328+## `++duz`
331329
332330`==` to `~`
333331
@@ -348,10 +346,9 @@ Parse stet, `==`, to null `~`.
348346 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=" |=..."]]]]
349347```
350348
351−
352349---
353350
354−### `++gah`
351+## `++gah`
355352
356353Newline or ' '
357354
@@ -386,9 +383,9 @@ Whitespace component, either newline or space.
386383 ~[32 32 32 10 32 10 32 32]
387384```
388385
389−
390386---
391−### `++gap`
387+
388+## `++gap`
392389
393390Plural whitespace
394391
@@ -400,9 +397,9 @@ Separates tall runes
400397 ++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah)))) :: plural whitespace
401398```
402399
403−
404400---
405−### `++gaq`
401+
402+## `++gaq`
406403
407404End of line
408405
@@ -418,10 +415,9 @@ Two spaces, a newline, or comment.
418415 ==
419416```
420417
421−
422−
423418---
424−### `++gaw`
419+
420+## `++gaw`
425421
426422Classic whitespace
427423
@@ -433,9 +429,9 @@ Terran whitespace.
433429 ++ gaw (cold ~ (star ;~(pose vul gah))) :: classic white
434430```
435431
436−
437432---
438−### `++gay`
433+
434+## `++gay`
439435
440436Optional gap
441437
@@ -448,7 +444,8 @@ Optional gap.
448444```
449445
450446---
451−### `++gon`
447+
448+## `++gon`
452449
453450Long numbers
454451
@@ -470,9 +467,9 @@ Parse long numbers - Numbers which wrap around the shell with the line
470467 [p=[p=1 q=3] q=[~ u=[p=[~~~5c. ~ ~~~2f.] q=[p=[p=1 q=3] q=""]]]]
471468```
472469
473−
474470---
475−### `++gul`
471+
472+## `++gul`
476473
477474Axis syntax `<` or `>`
478475
@@ -494,9 +491,9 @@ Parse the axis gal and gar axis syntax.
494491 3
495492```
496493
497−
498494---
499−### `++hex`
495+
496+## `++hex`
500497
501498Hex to atom
502499
@@ -528,7 +525,8 @@ Parse any hexadecimal number to an atom.
528525```
529526
530527---
531−### `++hig`
528+
529+## `++hig`
532530
533531Uppercase
534532
@@ -556,9 +554,9 @@ Parse a single uppercase letter.
556554 [p=[p=1 q=2] q=[~ [p=~~~47. q=[p=[p=1 q=2] q=""]]]]
557555```
558556
559−
560557---
561−### `++hit`
558+
559+## `++hit`
562560
563561Hex digits
564562
@@ -588,7 +586,8 @@ Parse a single hexadecimal digit.
588586```
589587
590588---
591−### `++iny`
589+
590+## `++iny`
592591
593592Indentation block
594593
@@ -645,9 +644,9 @@ A `++rule`.
645644 de"
646645```
647646
648−
649647---
650−### `++low`
648+
649+## `++low`
651650
652651Lowercase
653652
@@ -672,9 +671,9 @@ Parse a single lowercase letter.
672671 [p=[p=1 q=2] q=[~ [p=~~g q=[p=[p=1 q=2] q=""]]]]
673672```
674673
675−
676674---
677−### `++mes`
675+
676+## `++mes`
678677
679678Hexbyte
680679
@@ -699,9 +698,9 @@ Parse a hexbyte.
699698 66
700699```
701700
702−
703701---
704−### `++nix`
702+
703+## `++nix`
705704
706705Letters and `-`
707706
@@ -723,10 +722,9 @@ Parse Letters and `-`.
723722 'as_me'
724723```
725724
726−
727725---
728726
729−### `++nud`
727+## `++nud`
730728
731729Numeric
732730
@@ -752,7 +750,8 @@ Parse a numeric character - A number.
752750```
753751
754752---
755−### `++prn`
753+
754+## `++prn`
756755
757756Printable character
758757
@@ -776,9 +775,9 @@ Parse any printable character.
776775 ! exit
777776```
778777
779−
780778---
781−### `++qit`
779+
780+## `++qit`
782781
783782Chars in cord
784783
@@ -814,9 +813,9 @@ Parse an individual character to its cord atom representation.
814813 ~[99 111 114 100]
815814```
816815
817−
818816---
819−### `++qit`
817+
818+## `++qit`
820819
821820Chars in cord
822821
@@ -852,10 +851,9 @@ Parse an individual character to its cord atom representation.
852851 ~[99 111 114 100]
853852```
854853
855−
856−
857854---
858−### `++qut`
855+
856+## `++qut`
859857
860858Cord
861859
@@ -894,9 +892,9 @@ quote (aka triple-soq) cord, between which must be in an indented block.
894892 'Heredoc isn't prohibited from containing quotes'
895893```
896894
897−
898895---
899−### `++soz`
896+
897+## `++soz`
900898
901899Delimiting `'''`
902900
@@ -918,9 +916,9 @@ Parse a triple-single quote, used for multiline strings.
918916 ! exit
919917```
920918
921−
922919---
923−### `++sym`
920+
921+## `++sym`
924922
925923Term
926924
@@ -947,9 +945,9 @@ A term: a letter(lowercase), followed by letters, numbers, or `-`.
947945 7.174.515
948946```
949947
950−
951948---
952−### `++ven`
949+
950+## `++ven`
953951
954952`+>-` axis syntax
955953
@@ -988,9 +986,9 @@ Axis syntax parser
988986 [3 4]
989987```
990988
991−
992989---
993−### `++vit`
990+
991+## `++vit`
994992
995993Base64 digit
996994
@@ -1023,7 +1021,8 @@ Parse a standard base64 digit.
10231021```
10241022
10251023---
1026−### `++vul`
1024+
1025+## `++vul`
10271026
10281027Comments to null
10291028
@@ -1050,5 +1049,4 @@ with a newline character.
10501049 ! exit
10511050```
10521051
1053−
1054−---
1052+---
content/docs/hoon/reference/stdlib/4j.md+62−64
@@ -4,7 +4,7 @@ weight = 37
44template = "doc.html"
55+++
66
7−### `++ab`
7+## `++ab`
88
99Primitive parser engine
1010
@@ -24,7 +24,7 @@ A core containing numeric parser primitives.
2424 <36.ecc 414.gly 100.xkc 1.ypj %164>
2525```
2626
27−------------------------------------------------------------------------
27+---
2828
2929### `++bix:ab`
3030
@@ -57,7 +57,7 @@ A an atom. XX
5757 q=163
5858```
5959
60−------------------------------------------------------------------------
60+---
6161
6262### `++hif:ab`
6363
@@ -89,7 +89,7 @@ An atom.
8989 q=48.626
9090```
9191
92−------------------------------------------------------------------------
92+---
9393
9494### `++huf:ab`
9595
@@ -125,7 +125,7 @@ An atom. XX
125125 0x1.0100
126126```
127127
128−------------------------------------------------------------------------
128+---
129129
130130### `++hyf:ab`
131131
@@ -157,7 +157,7 @@ An atom. XX
157157 365.637.097.828.335.095
158158```
159159
160−------------------------------------------------------------------------
160+---
161161
162162### `++pev:ab`
163163
@@ -193,7 +193,7 @@ An atom.
193193 ~ <syntax error at [1 11]>
194194```
195195
196−------------------------------------------------------------------------
196+---
197197
198198### `++pew:ab`
199199
@@ -207,8 +207,6 @@ Up to five @uw (base 64) digits.
207207
208208#### Produces
209209
210−
211−
212210#### Source
213211
214212```hoon
@@ -232,7 +230,7 @@ Up to five @uw (base 64) digits.
232230 ! exit
233231```
234232
235−------------------------------------------------------------------------
233+---
236234
237235### `++piv:ab`
238236
@@ -260,7 +258,7 @@ Parsing `++rule`. Parses exactly five base-32 digits.
260258 ! exit
261259```
262260
263−------------------------------------------------------------------------
261+---
264262
265263### `++piw:ab`
266264
@@ -288,8 +286,7 @@ Parsing `++rule`. Parses exactly five base-64 digits.
288286 ! exit
289287```
290288
291−
292−------------------------------------------------------------------------
289+---
293290
294291### `++qeb:ab`
295292
@@ -325,7 +322,7 @@ a leading zero.
325322 ! exit
326323```
327324
328−------------------------------------------------------------------------
325+---
329326
330327### `++qex:ab`
331328
@@ -359,7 +356,7 @@ without a leading zero.
359356 ! exit
360357```
361358
362−------------------------------------------------------------------------
359+---
363360
364361### `++qib:ab`
365362
@@ -389,7 +386,7 @@ Parsing `++rule`. Parses exactly four binary digits.
389386 ! exit
390387```
391388
392−------------------------------------------------------------------------
389+---
393390
394391### `++qix:ab`
395392
@@ -419,7 +416,7 @@ Parsing `++rule`. Parses exactly four hexadecimal digits.
419416 ! exit
420417```
421418
422−------------------------------------------------------------------------
419+---
423420
424421### `++seb:ab`
425422
@@ -450,7 +447,7 @@ Parsing `++rule`. Parses the number 1.
450447 ! {1 1}
451448```
452449
453−------------------------------------------------------------------------
450+---
454451
455452### `++sed:ab`
456453
@@ -478,7 +475,7 @@ Parsing `++rule`. Parses a nonzero decimal digit.
478475 ! exit
479476```
480477
481−------------------------------------------------------------------------
478+---
482479
483480### `++sev:ab`
484481
@@ -506,7 +503,7 @@ Parsing `++rule`. Parses a nonzero base-32 digit
506503 ! exit
507504```
508505
509−------------------------------------------------------------------------
506+---
510507
511508### `++sew:ab`
512509
@@ -534,7 +531,7 @@ Parsing `++rule`. Parses a nonzero base-64 digit
534531 ! exit
535532```
536533
537−------------------------------------------------------------------------
534+---
538535
539536### `++sex:ab`
540537
@@ -562,7 +559,7 @@ Parsing `++rule`. Parses a nonzero hexadecimal digit.
562559 ! exit
563560```
564561
565−------------------------------------------------------------------------
562+---
566563
567564### `++sib:ab`
568565
@@ -589,7 +586,7 @@ Parsing `++rule`. Parses a binary digit.
589586 0
590587```
591588
592−------------------------------------------------------------------------
589+---
593590
594591### `++sid:ab`
595592
@@ -614,7 +611,7 @@ Parsing `++rule`. Parses a decimal digit.
614611 5
615612```
616613
617−------------------------------------------------------------------------
614+---
618615
619616### `++siv:ab`
620617
@@ -639,7 +636,7 @@ Parsing `++rule`. Parses a base-32 digit.
639636 12
640637```
641638
642−------------------------------------------------------------------------
639+---
643640
644641### `++siw:ab`
645642
@@ -664,7 +661,7 @@ Parsing `++rule`. Parses a base-64 digit.
664661 48
665662```
666663
667−------------------------------------------------------------------------
664+---
668665
669666### `++six:ab`
670667
@@ -689,7 +686,7 @@ Parsing `++rule`. Parses a hexadecimal digit.
689686 14
690687```
691688
692−------------------------------------------------------------------------
689+---
693690
694691### `++sov:ab`
695692
@@ -713,7 +710,8 @@ Parsing `++rule`. Parses a base-32 letter.
713710 > (scan "c" sov:ab)
714711 12
715712```
716−------------------------------------------------------------------------
713+
714+---
717715
718716### `++sow:ab`
719717
@@ -743,7 +741,7 @@ Parsing `++rule`. Parses a base-64 letter/symbol.
743741 48
744742```
745743
746−------------------------------------------------------------------------
744+---
747745
748746### `++sox:ab`
749747
@@ -768,7 +766,7 @@ Parsing `++rule`. Parses a hexadecimal letter.
768766 14
769767```
770768
771−------------------------------------------------------------------------
769+---
772770
773771### `++ted:ab`
774772
@@ -801,7 +799,7 @@ leading zero.
801799 ! exit
802800```
803801
804−------------------------------------------------------------------------
802+---
805803
806804### `++tip:ab`
807805
@@ -830,7 +828,7 @@ syllable.
830828 242
831829```
832830
833−------------------------------------------------------------------------
831+---
834832
835833### `++tiq:ab`
836834
@@ -849,6 +847,7 @@ syllable.
849847 ++ tiq (sear |=(a/@ (ind:po a)) til)
850848
851849```
850+
852851#### Examples
853852
854853```
@@ -858,7 +857,7 @@ syllable.
858857 1
859858```
860859
861−------------------------------------------------------------------------
860+---
862861
863862### `++tid:ab`
864863
@@ -886,7 +885,7 @@ Parsing `++rule`. Parses exactly three decimal digits.
886885 ! exit
887886```
888887
889−------------------------------------------------------------------------
888+---
890889
891890### `++til:ab`
892891
@@ -916,7 +915,7 @@ Parsing `++rule`. Parses exactly three lowercase letters.
916915 ! exit
917916```
918917
919−------------------------------------------------------------------------
918+---
920919
921920### `++urs:ab`
922921
@@ -945,7 +944,7 @@ Parsing rule. Parses characters from an atom of the span aura `@ta`.
945944 'asa-lom_tak'
946945```
947946
948−------------------------------------------------------------------------
947+---
949948
950949### `++urt:ab`
951950
@@ -973,7 +972,7 @@ for cab, `_`.
973972 'asa-lom.t0k'
974973```
975974
976−------------------------------------------------------------------------
975+---
977976
978977### `++voy:ab`
979978
@@ -1001,9 +1000,9 @@ byte.
10011000 q=39
10021001```
10031002
1004−------------------------------------------------------------------------
1003+---
10051004
1006−### `++ag`
1005+## `++ag`
10071006
10081007Top-level atom parser engine
10091008
@@ -1027,7 +1026,7 @@ A core containing top-level atom parsers.
10271026 <14.vpu 414.mof 100.xkc 1.ypj %164>
10281027```
10291028
1030−------------------------------------------------------------------------
1029+---
10311030
10321031### `++ape:ag`
10331032
@@ -1054,7 +1053,7 @@ Parser modifier. Parses 0 or the sample rule `fel`.
10541053 ~[2 0 2]
10551054```
10561055
1057−------------------------------------------------------------------------
1056+---
10581057
10591058### `++bay:ag`
10601059
@@ -1079,7 +1078,7 @@ Parsing rule. Parses a binary number without a leading zero.
10791078 q=38
10801079```
10811080
1082−------------------------------------------------------------------------
1081+---
10831082
10841083### `++bip:ag`
10851084
@@ -1107,7 +1106,7 @@ Parsing rule. Parses a `@is`, an IPv6 address.
11071106 .0.0.ea.3e6c.0.0.0.0
11081107```
11091108
1110−------------------------------------------------------------------------
1109+---
11111110
11121111### `++dem:ag`
11131112
@@ -1134,7 +1133,7 @@ Parsing rule. Parses a decimal number that includes dot separators.
11341133 q=13.507
11351134```
11361135
1137−------------------------------------------------------------------------
1136+---
11381137
11391138### `++dim:ag`
11401139
@@ -1162,7 +1161,7 @@ Parsing rule. Parses a decimal number without a leading zero.
11621161 ! exit
11631162```
11641163
1165−------------------------------------------------------------------------
1164+---
11661165
11671166### `++dum:ag`
11681167
@@ -1191,7 +1190,7 @@ Parsing rule. Parses a decmial number with leading zeroes.
11911190 q=13.507
11921191```
11931192
1194−------------------------------------------------------------------------
1193+---
11951194
11961195### `++fed:ag`
11971196
@@ -1233,7 +1232,7 @@ Parsing rule. Parses an atom of aura `@p`, the phonetic base.
12331232 282.810.089.790.159.633.869.501.053.313.363.681.181
12341233```
12351234
1236−------------------------------------------------------------------------
1235+---
12371236
12381237### `++hex:ag`
12391238
@@ -1264,7 +1263,7 @@ Parsing rule. Parses a hexadecimal number
12641263 0x3.ac8d
12651264```
12661265
1267−------------------------------------------------------------------------
1266+---
12681267
12691268### `++lip:ag`
12701269
@@ -1294,7 +1293,7 @@ Parsing rule. Parses an IPv4 address.
12941293 .8.8.8.8
12951294```
12961295
1297−------------------------------------------------------------------------
1296+---
12981297
12991298### `++viz:ag`
13001299
@@ -1319,7 +1318,7 @@ Parsing rule. Parses a Base-32 number with dot separators.
13191318 q=15.125.353.270
13201319```
13211320
1322−------------------------------------------------------------------------
1321+---
13231322
13241323### `++vum:ag`
13251324
@@ -1344,7 +1343,7 @@ Parsing rule. Parses a raw base-32 string.
13441343 q=15.125.353.270
13451344```
13461345
1347−------------------------------------------------------------------------
1346+---
13481347
13491348### `++wiz:ag`
13501349
@@ -1372,7 +1371,8 @@ Parsing rule. Parses a base-64 number.
13721371```
13731372
13741373---
1375−### `++mu`
1374+
1375+## `++mu`
13761376
13771377Core used to scramble 16-bit atoms
13781378
@@ -1402,7 +1402,7 @@ relationship between a planet and its star.
14021402 <3.sjm [[@ux @ux] <414.hhh 100.xkc 1.ypj %164>]>
14031403```
14041404
1405−------------------------------------------------------------------------
1405+---
14061406
14071407### `++zag:mu`
14081408
@@ -1433,7 +1433,7 @@ planet.
14331433 [0x22e1 0x201]
14341434```
14351435
1436−------------------------------------------------------------------------
1436+---
14371437
14381438### `++zig:mu`
14391439
@@ -1465,7 +1465,7 @@ planet.
14651465 [0x1f04 0x1042]
14661466```
14671467
1468−------------------------------------------------------------------------
1468+---
14691469
14701470### `++zug:mu`
14711471
@@ -1495,14 +1495,13 @@ planet name.
14951495 0x10e1.00fa
14961496```
14971497
1498−
14991498---
1500−### `++ne`
1499+
1500+## `++ne`
15011501
15021502Digit rendering engine
15031503
1504−A door containing arms that render digits at bases 10, 16, 32, and
1505−64.
1504+A door containing arms that render digits at bases 10, 16, 32, and 64.
15061505
15071506#### Accepts
15081507
@@ -1524,7 +1523,7 @@ A door containing arms that render digits at bases 10, 16, 32, and
15241523 <4.gut [@ud <414.hhh 100.xkc 1.ypj %164>]>
15251524```
15261525
1527−------------------------------------------------------------------------
1526+---
15281527
15291528### `++d:ne`
15301529
@@ -1552,7 +1551,7 @@ Renders a decimal digit as an atom of an ACII byte value.
15521551
15531552```
15541553
1555−------------------------------------------------------------------------
1554+---
15561555
15571556### `++x:ne`
15581557
@@ -1582,7 +1581,7 @@ Renders a hexadecimal digit as an atom of an ASCII byte value.
15821581 'e'
15831582```
15841583
1585−------------------------------------------------------------------------
1584+---
15861585
15871586### `++v:ne`
15881587
@@ -1611,7 +1610,7 @@ Renders a base-32 digit as an atom of an ASCII byte value.
16111610 'p'
16121611```
16131612
1614−------------------------------------------------------------------------
1613+---
16151614
16161615### `++w:ne`
16171616
@@ -1652,5 +1651,4 @@ Renders a base-64 digit as an atom of an ASCII byte value.
16521651 '-'
16531652```
16541653
1655−
16561654---
content/docs/hoon/reference/stdlib/4k.md+5−5
@@ -4,7 +4,7 @@ weight = 38
44template = "doc.html"
55+++
66
7−### `++co`
7+## `++co`
88
99Literal rendering engine
1010
@@ -34,7 +34,7 @@ A door that contains arms that operate on the sample coin `lot`.
3434 >
3535```
3636
37−------------------------------------------------------------------------
37+---
3838
3939### `++rear:co`
4040
@@ -63,7 +63,7 @@ Renders a coin `lot` as a tape prepended to the sample tape `rom`.
6363 "0xc8--ha"
6464```
6565
66−------------------------------------------------------------------------
66+---
6767
6868### `++rent:co`
6969
@@ -92,7 +92,8 @@ Renders a coin `lot` as a span.
9292 > `@t`~(rent co %$ %ux 200)
9393 '0xc8'
9494```
95−------------------------------------------------------------------------
95+
96+---
9697
9798### `++rend:co`
9899
@@ -272,5 +273,4 @@ Renders a coin `lot` as a tape.
272273 0vph
273274```
274275
275−
276276---
content/docs/hoon/reference/stdlib/4l.md+11−13
@@ -4,7 +4,7 @@ weight = 39
44template = "doc.html"
55+++
66
7−### `++so`
7+## `++so`
88
99Coin parser engine
1010
@@ -28,7 +28,7 @@ Core containing arms that parse `++coin`.
2828 <10.mkn 414.hhh 100.xkc 1.ypj %164>
2929```
3030
31−------------------------------------------------------------------------
31+---
3232
3333### `++bisk:so`
3434
@@ -68,7 +68,7 @@ producing a `++dime`.
6868 [%ux q=1.205.249]
6969```
7070
71−------------------------------------------------------------------------
71+---
7272
7373### `++crub:so`
7474
@@ -260,7 +260,7 @@ and `@t`, producing a `++dime`.
260260 [%ta 7.561.581]
261261```
262262
263−------------------------------------------------------------------------
263+---
264264
265265### `++nuck:so`
266266
@@ -289,7 +289,6 @@ corresponding `++coin` parser.
289289 ==
290290```
291291
292−
293292#### Examples
294293
295294```
@@ -316,7 +315,7 @@ corresponding `++coin` parser.
316315 0vph
317316```
318317
319−------------------------------------------------------------------------
318+---
320319
321320### `++nusk:so`
322321
@@ -349,7 +348,7 @@ formatting).
349348 [~ %ta ~.asd_a]
350349```
351350
352−------------------------------------------------------------------------
351+---
353352
354353### `++perd:so`
355354
@@ -385,7 +384,7 @@ prefixes.
385384 [%many [[% p=[p=~.ud q=20]] ~[[% p=[p=~.tas q=120]]]]]
386385```
387386
388−------------------------------------------------------------------------
387+---
389388
390389### `++royl:so`
391390
@@ -456,7 +455,7 @@ Parsing rule. Parses a number into a `++dime` float.
456455 .~3.13999999999999
457456```
458457
459−------------------------------------------------------------------------
458+---
460459
461460### `++royl-cell:so`
462461
@@ -475,7 +474,7 @@ Intermediate parsed float convereter
475474 ::
476475```
477476
478−------------------------------------------------------------------------
477+---
479478
480479### `++tash:so`
481480
@@ -518,7 +517,7 @@ Parsing rule. Parses a signed number into a `++dime`.
518517 [%sx --0x2e]
519518```
520519
521−------------------------------------------------------------------------
520+---
522521
523522### `++twid:so`
524523
@@ -556,7 +555,7 @@ Parsing rule. Parses coins after a leading sig, `~`.
556555 [%blob [1 1]]
557556```
558557
559−------------------------------------------------------------------------
558+---
560559
561560### `++zust:so`
562561
@@ -604,5 +603,4 @@ Parsing rule. Parses an atom of either `@if` (IP address), `@f`
604603 [%rd .~12.00999999999999]
605604```
606605
607−
608606---
content/docs/hoon/reference/stdlib/4m.md+20−18
@@ -4,7 +4,7 @@ weight = 40
44template = "doc.html"
55+++
66
7−### `++scot`
7+## `++scot`
88
99Render dime as cord
1010
@@ -45,9 +45,9 @@ A `cord`.
4545 '~.asd_a'
4646```
4747
48−
4948---
50−### `++scow`
49+
50+## `++scow`
5151
5252Render dime as tape
5353
@@ -66,6 +66,7 @@ A `tape`.
6666```hoon
6767 ++ scow |=(mol/dime ~(rend co %$ mol))
6868```
69+
6970#### Examples
7071
7172```
@@ -79,9 +80,9 @@ A `tape`.
7980 "~.asd_a"
8081```
8182
82−
8383---
84−### `++slat`
84+
85+## `++slat`
8586
8687Curried slaw
8788
@@ -117,9 +118,9 @@ A `gate`.
117118 [~ ~.asd_a
118119```
119120
120−
121121---
122−### `++slav`
122+
123+## `++slav`
123124
124125Demand: parse cord with input aura
125126
@@ -164,7 +165,8 @@ The atom of a `(unit @)` from `++slaw`, or crash.
164165```
165166
166167---
167−### `++slaw`
168+
169+## `++slaw`
168170
169171Parse cord to input aura
170172
@@ -212,9 +214,9 @@ A `(unit @)`.
212214 ~
213215```
214216
215−
216217---
217−### `++slay`
218+
219+## `++slay`
218220
219221Parse cord to coin
220222
@@ -272,9 +274,9 @@ A `(unit coin)`.
272274 0vph
273275```
274276
275−
276277---
277−### `++smyt`
278+
279+## `++smyt`
278280
279281Render path as tank
280282
@@ -318,9 +320,9 @@ A `tank`.
318320 ]
319321```
320322
321−
322323---
323−### `++spat`
324+
325+## `++spat`
324326
325327Render path as cord
326328
@@ -351,9 +353,9 @@ A `cord`.
351353 '/as/les/top'
352354```
353355
354−
355356---
356−### `++spud`
357+
358+## `++spud`
357359
358360Render path as tape
359361
@@ -384,9 +386,9 @@ A `tape`.
384386 "/as/les/top"
385387```
386388
387−
388389---
389−### `++stab`
390+
391+## `++stab`
390392
391393Parse cord to path
392394
content/docs/hoon/reference/stdlib/4n.md+15−13
@@ -4,7 +4,7 @@ weight = 41
44template = "doc.html"
55+++
66
7−### `++mack`
7+## `++mack`
88
99Nock subject to unit
1010
@@ -48,9 +48,9 @@ The `++unit` of a noun.
4848 [~ %no]
4949```
5050
51−
5251---
53−### `++mink`
52+
53+## `++mink`
5454
5555Mock interpreter
5656
@@ -174,7 +174,8 @@ A `++tone`.
174174```
175175
176176---
177−### `++mock`
177+
178+## `++mock`
178179
179180Compute formula on subject with hint
180181
@@ -223,9 +224,9 @@ The `++unit` of a noun.
223224 "14"
224225```
225226
226−
227227---
228−### `++mong`
228+
229+## `++mong`
229230
230231Slam gate with sample
231232
@@ -279,9 +280,9 @@ A `++toon`.
279280 [%0 p=[8 6]]
280281```
281282
282−
283283---
284−### `++mook`
284+
285+## `++mook`
285286
286287Intelligently render crash annotation
287288
@@ -351,9 +352,9 @@ A `++toon`.
351352 [%2 p=~[[%leaf p="/b/repl/:<[1 1].[1 2]>"] [%leaf p="####"]]]
352353```
353354
354−
355355---
356−### `++mule`
356+
357+## `++mule`
357358
358359Typed virtual
359360
@@ -404,9 +405,9 @@ XX
404405 ]
405406```
406407
407−
408408---
409−### `++mute`
409+
410+## `++mute`
410411
411412Untyped virtual
412413
@@ -417,6 +418,7 @@ information.
417418#### Accepts
418419
419420`taq` is a `++trap`.
421+
420422#### Produces
421423
422424Either a noun or a `++list` of `++tank`.
@@ -444,4 +446,4 @@ Either a noun or a `++list` of `++tank`.
444446 [%.n p=~]
445447```
446448
447−---
449+---
content/docs/hoon/reference/stdlib/4o.md+31−127
@@ -4,7 +4,7 @@ weight = 42
44template = "doc.html"
55+++
66
7−### `++abel`
7+## `++abel`
88
99Biblical names in hoon are primarily aliases for the compiler.
1010
@@ -21,9 +21,9 @@ Biblical names in hoon are primarily aliases for the compiler.
2121 %void
2222```
2323
24−
2524---
26−### `++aura`
25+
26+## `++aura`
2727
2828'type' of atom
2929
@@ -46,37 +46,9 @@ See also: `++base`, aura reference
4646 ~.ux
4747```
4848
49−
50−---
51−### `++axis`
52−
53−Nock axis
54−
55−A Nock axis inside a noun. After the leading 1, in binary, a `1` signfies
56−right and `0` left.
57−
58−#### Source
59−
60−```hoon
61− ++ axis ,@ :: tree address
62−```
63−
64−#### Examples
65−
66−```
67− > *axis
68− 0
69−
70− > :: 0 is not actually a valid axis
71− > [[4 5] 6 7]
72− [[4 5] 6 7]
73− > `axis`0b110
74− 6
75−```
76−
7749---
7850
79−### `++base`
51+## `++base`
8052
8153Base type
8254
@@ -106,34 +78,7 @@ boolean or null labelled with an aura.
10678
10779---
10880
109−### `++bean`
110−
111−Boolean
112−
113−`0`, `&`, or `%.y` are true, and `1`, `|`, and `%.n` are false.
114−
115−#### Source
116−
117−```hoon
118− ++ bean ,? :: 0=&=yes, 1=|=no
119−```
120−
121−#### Examples
122−
123−```
124− > *bean
125− %.y
126−
127− > `bean`&
128− %.y
129− > `bean`|
130− %.n
131−```
132−
133−
134−---
135−
136−### `++beer`
81+## `++beer`
13782
13883Tape builder
13984
@@ -156,7 +101,7 @@ Used to build tapes internally.
156101
157102---
158103
159−### `++beet`
104+## `++beet`
160105
161106XML interpolation cases
162107
@@ -174,9 +119,9 @@ Used internally.
174119 == ::
175120```
176121
177−
178122---
179−### `++chum`
123+
124+## `++chum`
180125
181126Jet hint information
182127
@@ -206,10 +151,9 @@ XX there's a ++chum in zuse that's politely causing this not to work
206151 [%sgfs p=[std=%lob kel=314] q=[%zpzp ~]]
207152```
208153
209−
210154---
211155
212−### `++coil`
156+## `++coil`
213157
214158Tuple of core information
215159
@@ -225,9 +169,9 @@ intermediate step within Section 2fB. Converted by `++core` to %core type.
225169 == ::
226170```
227171
228−
229172---
230−### `++foot`
173+
174+## `++foot`
231175
232176Cases of arms by variance model.
233177
@@ -263,7 +207,7 @@ See also: `++ap`, `++ut`
263207
264208---
265209
266−### `++limb`
210+## `++limb`
267211
268212```hoon
269213 ++ limb $|(term $%([%& p=axis] [%| p=@ud q=term])) ::
@@ -284,9 +228,9 @@ See also: section 2fC-2fD
284228 [%.n p=3 q=%$]
285229```
286230
287−
288231---
289−### `++line`
232+
233+## `++line`
290234
291235XX move to `++ut`
292236
@@ -317,7 +261,7 @@ XX move to `++ut`
317261
318262---
319263
320−### `++metl`
264+## `++metl`
321265
322266```hoon
323267 ++ metl ?(%gold %iron %zinc %lead) :: core variance
@@ -327,15 +271,12 @@ XX move to `++ut`
327271
328272See also: `++coil`
329273
330−
331−
332274---
333275
334−### `++nock`
276+## `++nock`
335277
336278Virtual machine. See Nock.
337279
338−
339280#### Source
340281
341282```hoon
@@ -361,26 +302,9 @@ Virtual machine. See Nock.
361302 [p=[%4 p=[%0 p=1]] q=[%1 p=20]]
362303```
363304
364−
365−---
366−
367−### `++noun`
368−
369−```hoon
370− ++ noun ,* :: any noun
371−```
372−
373−Used nowhere XX
374−
375−```
376− > `noun`~[1 2 3]
377− [1 2 3 0]
378−```
379−
380−
381305---
382306
383−### `++null`
307+## `++null`
384308
385309```hoon
386310 ++ null ,~ :: null, nil, etc
@@ -394,10 +318,9 @@ Used nowhere XX
394318 %~
395319```
396320
397−
398321---
399322
400−### `++port`
323+## `++port`
401324
402325XX move to `++ut`
403326
@@ -421,10 +344,9 @@ Type and location of core-shaped thing? XX Compiler Internals
421344 [p=0 q=[%.y p=%void]]
422345```
423346
424−
425347---
426348
427−### `++span`
349+## `++span`
428350
429351ASCII atom
430352
@@ -439,7 +361,6 @@ besides numbers and lowercase letters are permitted.
439361 ++ span ,@ta :: text-atom (ASCII)
440362```
441363
442−
443364#### Examples
444365
445366```
@@ -458,10 +379,9 @@ besides numbers and lowercase letters are permitted.
458379 'foo-bar'
459380```
460381
461−
462382---
463383
464−### `++tiki`
384+## `++tiki`
465385
466386XX move to `++ut`
467387
@@ -496,10 +416,9 @@ A `++wing` or `++hoon`.
496416 ]
497417```
498418
499−
500419---
501420
502−### `++toga`
421+## `++toga`
503422
504423Tree of faces
505424
@@ -540,10 +459,9 @@ XX move to `++ut` and rune doc (for \^= examples)
540459 ]
541460```
542461
543−
544462---
545463
546−### `++tone`
464+## `++tone`
547465
548466Intermediate Nock computation result
549467
@@ -589,10 +507,9 @@ Similar to `++toon`, but stack trace is not yet rendered.
589507 ]
590508```
591509
592−
593510---
594511
595−### `++tuna`
512+## `++tuna`
596513
597514XML template tree
598515
@@ -616,11 +533,9 @@ tuna, and %f is a empty node.
616533
617534See also: `++sail`
618535
619−
620−
621536---
622537
623−### `++tusk`
538+## `++tusk`
624539
625540List of expressions
626541
@@ -642,10 +557,9 @@ a `++tusk`.
642557 ~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]
643558```
644559
645−
646560---
647561
648−### `++hoon`
562+## `++hoon`
649563
650564Expression
651565
@@ -653,11 +567,9 @@ An expression, or AST.
653567
654568See Rune section of Hoon reference
655569
656−
657−
658570---
659571
660−### `++tyke`
572+## `++tyke`
661573
662574List of 'maybe' hoons
663575
@@ -665,7 +577,6 @@ List of `++unit` `++hoon`, or gaps left to be inferred, in `++path`
665577parsing. When you use a path such as `/=main=/pub/src/doc` the path is in fact
666578a `++tyke`, where the `=` are inferred from your current path.
667579
668−
669580#### Source
670581
671582```hoon
@@ -681,10 +592,9 @@ a `++tyke`, where the `=` are inferred from your current path.
681592 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]
682593```
683594
684−
685595---
686596
687−### `++typo`
597+## `++typo`
688598
689599Pointer for `++type`
690600
@@ -701,11 +611,9 @@ context when upating.
701611
702612See also: `++seem`, `++vise`, `++type`
703613
704−
705−
706614---
707615
708−### `++tyre`
616+## `++tyre`
709617
710618List, term hoon
711619
@@ -717,10 +625,9 @@ Associative list of `++term` `++hoon`, used in jet hint processing.
717625 ++ tyre (list ,[p=term q=hoon]) ::
718626```
719627
720−
721628---
722629
723−### `++vase`
630+## `++vase`
724631
725632Typed data. A `++vase` is used wherever typed data is explicitly worked
726633with.
@@ -738,10 +645,9 @@ with.
738645 [p=[%cube p=0 q=[%atom p=%n]] q=0]
739646```
740647
741−
742648---
743649
744−### `++vise`
650+## `++vise`
745651
746652Convert during reboot
747653
@@ -757,11 +663,9 @@ Used to convert from previously-typed data during reboot.
757663
758664See also: `++typo`, `++seer`
759665
760−
761−
762666---
763667
764−### `++wing`
668+## `++wing`
765669
766670```hoon
767671 ++ wing (list limb) ::
content/docs/hoon/reference/stdlib/5c.md+77−1
@@ -4,4 +4,80 @@ weight = 45
44template = "doc.html"
55+++
66
7−(To be documented)
7+(To be fully documented)
8+
9+## `++slog`
10+
11+Deify printf
12+
13+Prints stack trace `a` if the stack trace isn't null, then produces the other
14+input. `+slog` first takes `a`, producing a gate. The gate then takes some hoon.
15+
16+#### Accepts
17+
18+`a` is a `tang`, and is the sample of `+slog`.
19+
20+`(slog a)` takes some `hoon`.
21+
22+#### Produces
23+
24+The result of the hoon given to `(slog a)`, with `a` printed to the terminal.
25+
26+#### Source
27+
28+```hoon
29+++ slog
30+ =| pri=@
31+ |= a=tang ^+ same
32+ ?~(a same ~>(%slog.[pri i.a] $(a t.a)))
33+```
34+
35+#### Examples
36+
37+```
38+foo
39+> ((slog leaf+"foo" ~) (add 1 1))
40+2
41+```
42+
43+#### Discussion
44+
45+`slog` is intended to be put in the middle of a bunch of chained function
46+calls that string a piece of data through them, so that an error message will be
47+printed if there's one to print.
48+
49+---
50+
51+## `++mean`
52+
53+Crash and printf
54+
55+Ends the program and prints `a`, a tracing error message.
56+
57+#### Accepts
58+
59+`a` is a `tang`.
60+
61+#### Produces
62+
63+A crash, with `a` printed to the terminal.
64+
65+#### Source
66+
67+```hoon
68+++ mean
69+ |= a=tang
70+ ^+ !!
71+ ?~ a !!
72+ ~_(i.a $(a t.a))
73+```
74+
75+#### Examples
76+
77+```
78+> (mean leaf+"foo" ~)
79+foo
80+dojo: hoon expression failed
81+```
82+
83+---
content/docs/hoon/reference/stdlib/5f.md+18−23
@@ -4,11 +4,11 @@ weight = 48
44template = "doc.html"
55+++
66
7−### `++mane`
7+## `++mane`
88
99XML name
1010
11−An XML name (tag name or attribute name) with an optional namespace. Parsed by
11+An XML name (tag name or attribute name) with an optional namespace. Parsed by
1212`++name:de-xml:html` in `zuse.hoon`, rendered by `++name:en-xml:html` in `zuse.hoon`.
1313
1414#### Source
@@ -31,9 +31,9 @@ See also: `++sail`
3131 [%div %namespace]
3232```
3333
34−
3534---
36−### `++manx`
35+
36+## `++manx`
3737
3838XML node.
3939
@@ -49,10 +49,9 @@ Parsed by `++apex` within `++apex:de-xml:html` in `zuse.hoon`, rendered by `++ap
4949
5050See also: `++sail` doc
5151
52−
53−
5452---
55−### `++marl`
53+
54+## `++marl`
5655
5756List of XML nodes
5857
@@ -66,10 +65,9 @@ A list of `++manx`.
6665
6766#### Examples
6867
69−
70−
7168---
72−### `++mars`
69+
70+## `++mars`
7371
7472XML CDATA
7573
@@ -83,10 +81,9 @@ Implicitly produced by `++chrd` within `++chrd:de-xml:html`
8381
8482#### Examples
8583
86−
87−
8884---
89−### `++mart`
85+
86+## `++mart`
9087
9188List of XML attributes
9289
@@ -103,9 +100,9 @@ Parsed by `++attr:de-xml:html` in `zuse.hoon`, rendered by `++attr:en-xml:html`
103100
104101#### Examples
105102
106−
107103---
108−### `++marx`
104+
105+## `++marx`
109106
110107XML tag
111108
@@ -120,10 +117,9 @@ A `++marx` is a pair of a tag name, `++mane` and a list of attributes,
120117
121118#### Examples
122119
123−
124−
125120---
126−### `++pass`
121+
122+## `++pass`
127123
128124Atom alias
129125
@@ -135,9 +131,9 @@ Used primarily in crypto.
135131 ++ pass @ :: public key
136132```
137133
138−
139134---
140−### `++ring`
135+
136+## `++ring`
141137
142138Atom alias
143139
@@ -149,9 +145,9 @@ Used primarily in crypto.
149145 ++ ring @ :: private key
150146```
151147
152−
153148---
154−### `++time`
149+
150+## `++time`
155151
156152Absolute date
157153
@@ -172,5 +168,4 @@ See also: `++date`, aura reference
172168 ~2014.1.1
173169```
174170
175−
176171---
content/docs/hoon/reference/stdlib/table-of-contents.md+95−63
@@ -26,6 +26,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
2626<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#addrh' title="Add (halfprecision float)"><code>++add:rh</code></a>
2727<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#addrs' title="Add (singleprecision float)"><code>++add:rs</code></a>
2828<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#addrq' title="Add (quadprecision float)"><code>++add:rq</code></a>
29+<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#aftr' title="Pair after"><code>++aftr</code></a>
2930<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#ag' title="Toplevel atom parser engine"><code>++ag</code></a>
3031<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#alf' title="Parse alphabetic characters"><code>++alf</code></a>
3132<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#allby' title="Logical AND (map and wet gate)"><code>++all:by</code></a>
@@ -38,19 +39,21 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
3839<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#apeag' title="Parse 0 or rule"><code>++ape:ag</code></a>
3940<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#aptby' title="Check correctness (map)"><code>++apt:by</code></a>
4041<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#aptin' title="Check correctness (set)"><code>++apt:in</code></a>
42+<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#aptto' title="Check correctness of queue"><code>++apt:to</code></a>
4143<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#at' title="(Undocumented)"><code>++at</code></a>
4244<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#aura' title="'Type' of atom"><code>++aura</code></a>
43−<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#axis' title="Nock axis"><code>++axis</code></a>
45+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#axis' title="Tree address"><code>+$axis</code></a>
4446
4547### b
4648
49+<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#bake' title="Convert wet gate to dry gate"><code>++bake</code></a>
4750<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#balto' title="Balance queue"><code>++bal:to</code></a>
4851<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#bar' title="Parse | (bar)"><code>++bar</code></a>
4952<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#bas' title="Parse \ (bas)"><code>++bas</code></a>
5053<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#base' title="Base type"><code>++base</code></a>
5154<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#bass' title="Parser modifier (LSBordered ++list as atom of ++base)"><code>++bass</code></a>
5255<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#bayag' title="Parses binary number"><code>++bay:ag</code></a>
53−<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#bean' title="Boolean"><code>++bean</code></a>
56+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#bean' title="Boolean"><code>+$bean</code></a>
5457<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#beer' title="Tape builder"><code>++beer</code></a>
5558<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#beet' title="XML interpolation cases"><code>++beet</code></a>
5659<a class="tooltip" href='/docs/hoon/reference/stdlib/4e/#bend' title="Conditional composer"><code>++bend</code></a>
@@ -77,6 +80,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
7780<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#both' title="Group unit values into pair"><code>++both</code></a>
7881<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#buc' title="Parse $ (buc)"><code>++buc</code></a>
7982<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#but' title="Parse binary digit"><code>++but</code></a>
83+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#byts' title="bytes, LSB first"><code>+$byts</code></a>
8084
8185### c
8286
@@ -87,10 +91,11 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
8791<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#cat' title="Concatenate"><code>++cat</code></a>
8892<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#cen' title="Parse % (cen)"><code>++cen</code></a>
8993<a class="tooltip" href='/docs/hoon/reference/stdlib/3c/#cetyo' title="Days in a century"><code>++cet:yo</code></a>
90−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#char' title="Character"><code>++char</code></a>
94+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#char' title="Character"><code>+$char</code></a>
9195<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#chum' title="Jet hint information"><code>++chum</code></a>
9296<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#cit' title="Octal digit"><code>++cit</code></a>
93−<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#clap' title="Apply function to two units"><code>++clap</code></a>
97+<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#clap' title="Combine two units with function"><code>++clap</code></a>
98+<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#clef' title="Compose two units with function"><code>++clef</code></a>
9499<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#cmpsi' title="Compare (signed integer)"><code>++cmp:si</code></a>
95100<a class="tooltip" href='/docs/hoon/reference/stdlib/4k/#co' title="Literal rendering engine"><code>++co</code></a>
96101<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#coil' title="Tuple of core information"><code>++coil</code></a>
@@ -101,7 +106,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
101106<a class="tooltip" href='/docs/hoon/reference/stdlib/4e/#comp' title="Arbitrary compose"><code>++comp</code></a>
102107<a class="tooltip" href='/docs/hoon/reference/stdlib/2d/#con' title="Binary OR"><code>++con</code></a>
103108<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#cook' title="Apply gate"><code>++cook</code></a>
104−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#cord' title="UTF8 text"><code>++cord</code></a>
109+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#cord' title="UTF8 text"><code>+$cord</code></a>
105110<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#cork' title="Compose forward"><code>++cork</code></a>
106111<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#corl' title="Compose backward"><code>++corl</code></a>
107112<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#crip' title="Tape to cord"><code>++crip</code></a>
@@ -115,7 +120,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
115120### d
116121
117122<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#dne' title="Render decimal"><code>++d:ne</code></a>
118−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#date' title="Point in time"><code>++date</code></a>
123+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#date' title="Parsed date"><code>+$date</code></a>
119124<a class="tooltip" href='/docs/hoon/reference/stdlib/3c/#dayyo' title="Seconds in day"><code>++day:yo</code></a>
120125<a class="tooltip" href='/docs/hoon/reference/stdlib/1a/#dec' title="Decrement"><code>++dec</code></a>
121126<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#delby' title="Delete (map)"><code>++del:by</code></a>
@@ -125,6 +130,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
125130<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#demag' title="Parse decmal with dots"><code>++dem:ag</code></a>
126131<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#denfl' title="Denormalizes (floating point)"><code>++den:fl</code></a>
127132<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#depto' title="Maximum depth (queue)"><code>++dep:to</code></a>
133+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#difby' title="Difference between maps"><code>++dif:by</code></a>
128134<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#diffe' title="Difference between atoms (modular basis)"><code>++dif:fe</code></a>
129135<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#diffo' title='Subtraction (modular base)'><code>++dif:fo</code></a>
130136<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#difin' title='Difference (set)'><code>++dif:in</code></a>
@@ -146,7 +152,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
146152<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#dog' title="Optional gap"><code>++dog</code></a>
147153<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#doh' title="@p separator"><code>++doh</code></a>
148154<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#doq' title="Parse double quote"><code>++doq</code></a>
149−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#dor' title="Numeric order"><code>++dor</code></a>
155+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#dor' title="Depth order"><code>++dor</code></a>
150156<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#dot' title="Parse period"><code>++dot</code></a>
151157<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#drgff' title="@r to decimal float"><code>++drg:ff</code></a>
152158<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#drgfl' title="Get printable decimal (signed and unsigned integer cell)"><code>++drg:fl</code></a>
@@ -200,7 +206,9 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
200206<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#fil' title="Fill bloqstream"><code>++fil</code></a>
201207<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#find' title="First index in list"><code>++find</code></a>
202208<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#fitre' title="Fit on one line test"><code>++fit:re</code></a>
209+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#flag' title="Boolean (flag)"><code>+$flag</code></a>
203210<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#flifl' title="Flip sign"><code>++fli:fl</code></a>
211+<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#flit' title="Make filter"><code>++flit</code></a>
204212<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#flop' title="Reverse list"><code>++flop</code></a>
205213<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fmaff' title="Fused multiplyadd (IEEE float)"><code>++fma:ff</code></a>
206214<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fmafl' title="Fused multiplyadd"><code>++fma:fl</code></a>
@@ -208,9 +216,9 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
208216<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fmarh' title="Fused multiplyadd (halfprecision float)"><code>++fma:rh</code></a>
209217<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fmars' title="Fused multiplyadd (singleprecision float)"><code>++fma:rs</code></a>
210218<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fmarq' title="Fused multiplyadd (quadprecision float)"><code>++fma:rq</code></a>
211−<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#fnv' title="FNV scrambler"><code>++fnv</code></a>
212219<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#fo' title="Modulo prime"><code>++fo</code></a>
213220<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#foot' title="Cases of arms by variance model"><code>++foot</code></a>
221+<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#fore' title="Pair before"><code>++fore</code></a>
214222<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#fosrh' title="@rs to @rh"><code>++fos:rh</code></a>
215223<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#frafo' title="Divide (modular base)"><code>++fra:fo</code></a>
216224<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#frasi' title="Divide (signed integer)"><code>++fra:si</code></a>
@@ -226,6 +234,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
226234<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#gar' title="Parse > (gar)"><code>++gar</code></a>
227235<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gasby' title="Concatenate (map)"><code>++gas:by</code></a>
228236<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#gasin' title="Concatenate (set)"><code>++gas:in</code></a>
237+<a class="tooltip" href='/docs/hoon/reference/stdlib/2j/#gasju' title="Concatenate (jug)"><code>++gas:ju</code></a>
229238<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#gasto' title="Push list into queue"><code>++gas:to</code></a>
230239<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#gate' title="Function"><code>++gate</code></a>
231240<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#gaw' title="Classic whitespace"><code>++gaw</code></a>
@@ -236,7 +245,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
236245<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#getto' title="Headtail pair"><code>++get:to</code></a>
237246<a class="tooltip" href='/docs/hoon/reference/stdlib/4e/#glue' title="Skip delimiter"><code>++glue</code></a>
238247<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#gon' title="Parse long numbers"><code>++gon</code></a>
239−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#gor' title="Hash order"><code>++gor</code></a>
248+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#gor' title="Mug order"><code>++gor</code></a>
240249<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gotby' title="Assert for value (map)"><code>++got:by</code></a>
241250<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#grdff' title="Decimal float to @r"><code>++grd:ff</code></a>
242251<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#grdfl' title="Decimal to float"><code>++grd:fl</code></a>
@@ -264,7 +273,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
264273### h
265274
266275<a class="tooltip" href='/docs/hoon/reference/stdlib/3g/#hair' title="Parsing line and column"><code>++hair</code></a>
267−<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#hard' title="Force remold"><code>++hard</code></a>
268276<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#hasby' title="Key existence check (map)"><code>++has:by</code></a>
269277<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#hasin' title="Key existence check (set)"><code>++has:in</code></a>
270278<a class="tooltip" href='/docs/hoon/reference/stdlib/2j/#hasju' title="Check contents (jug)"><code>++has:ju</code></a>
@@ -278,9 +286,9 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
278286<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#hig' title="Parse single uppercase letter"><code>++hig</code></a>
279287<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#hit' title="Parse single hexadecimal digit"><code>++hit</code></a>
280288<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#homo' title="Homogenize list"><code>++homo</code></a>
281−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#hor' title="Horizontal hash order"><code>++hor</code></a>
282289<a class="tooltip" href='/docs/hoon/reference/stdlib/3c/#horyo' title="Seconds in hour"><code>++hor:yo</code></a>
283290<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#hufab' title="Parse two phonetic pairs"><code>++huf:ab</code></a>
291+<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#hunt' title="Select between two units by a rule"><code>++hunt</code></a>
284292<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#hyfab' title="Parse 8 phonetic bytes"><code>++hyf:ab</code></a>
285293
286294### i
@@ -299,6 +307,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
299307### j
300308
301309<a class="tooltip" href='/docs/hoon/reference/stdlib/2j/#ja' title="Jar engine"><code>++ja</code></a>
310+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#jabby' title="Transform value (map)"><code>++jab:by</code></a>
302311<a class="tooltip" href='/docs/hoon/reference/stdlib/2p/#jam' title="Pack noun to atom"><code>++jam</code></a>
303312<a class="tooltip" href='/docs/hoon/reference/stdlib/2o/#jar' title="Mold generator (jar)"><code>++jar</code></a>
304313<a class="tooltip" href='/docs/hoon/reference/stdlib/3c/#jesyo' title="Maximum 64bit timestamp"><code>++jes:yo</code></a>
@@ -315,11 +324,13 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
315324<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#ket' title="Parse ^ (ket)"><code>++ket</code></a>
316325<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#keyby' title="Set of keys"><code>++key:by</code></a>
317326<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#knee' title="Recursive parsers"><code>++knee</code></a>
318−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#knot' title="Atom type of ASCII characters"><code>++knot</code></a>
327+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#knot' title="Atom type of ASCII characters"><code>+$knot</code></a>
319328
320329### l
321330
322331<a class="tooltip" href='/docs/hoon/reference/stdlib/4d/#last' title="Further trace"><code>++last</code></a>
332+<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#late' title="Put tail"><code>++late</code></a>
333+<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#lead' title="Put head"><code>++lead</code></a>
323334<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#lenl' title="Construct list from nullterminated noun"><code>++le:nl</code></a>
324335<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#lent' title="List length"><code>++lent</code></a>
325336<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#levy' title="Logical AND on list"><code>++levy</code></a>
@@ -334,7 +345,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
334345<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#lipag' title="Parse IPv4 address"><code>++lip:ag</code></a>
335346<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#list' title="Mold constructor (list)"><code>++list</code></a>
336347<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#lone' title="Mold generator (face on mold)"><code>++lone</code></a>
337−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#lor' title="Leg order"><code>++lor</code></a>
338348<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#low' title="Parse lowercase letter"><code>++low</code></a>
339349<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#lsh' title="Leftshift"><code>++lsh</code></a>
340350<a class="tooltip" href='/docs/hoon/reference/stdlib/1a/#lte' title="Less than / equal (atom)"><code>++lte</code></a>
@@ -366,14 +376,14 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
366376<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mack' title="Nock subject to unit"><code>++mack</code></a>
367377<a class="tooltip" href='/docs/hoon/reference/stdlib/2l/#malt' title="Map from list"><code>++malt</code></a>
368378<a class="tooltip" href='/docs/hoon/reference/stdlib/2o/#map' title="Mold generator (map)"><code>++map</code></a>
369−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#marby' title="Assert and add (map)"><code>++mar:by</code></a>
379+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#marby' title="Add with validation (map)"><code>++mar:by</code></a>
370380<a class="tooltip" href='/docs/hoon/reference/stdlib/1b/#mas' title="Address within head/tail"><code>++mas</code></a>
371381<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#mask' title="Match character"><code>++mask</code></a>
372382<a class="tooltip" href='/docs/hoon/reference/stdlib/2p/#mat' title="Lengthencode"><code>++mat</code></a>
373383<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#mate' title="Choose"><code>++mate</code></a>
374384<a class="tooltip" href='/docs/hoon/reference/stdlib/1a/#max' title="Maximum"><code>++max</code></a>
375385<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#meff' title="Minimum exponent of ff"><code>++me:ff</code></a>
376−<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#mean' title="Crash and printf"><code>++mean</code></a>
386+<a class="tooltip" href='/docs/hoon/reference/stdlib/5c/#mean' title="Crash and printf"><code>++mean</code></a>
377387<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#mes' title="Parse hexabyte"><code>++mes</code></a>
378388<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#mesc' title="Escape special characters"><code>++mesc</code></a>
379389<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#met' title="Measure"><code>++met</code></a>
@@ -388,6 +398,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
388398<a class="tooltip" href='/docs/hoon/reference/stdlib/2l/#molt' title="Map from pair list"><code>++molt</code></a>
389399<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mong' title="Slam gate with sample"><code>++mong</code></a>
390400<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mook' title="Intelligently render crash annotation"><code>++mook</code></a>
401+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#mor' title="(more) mug order"><code>++mor</code></a>
391402<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#more' title="Parse list with delimiter"><code>++more</code></a>
392403<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#most' title="Parse list of at least one match"><code>++most</code></a>
393404<a class="tooltip" href='/docs/hoon/reference/stdlib/3c/#moyyo' title="Days in months of leapyear"><code>++moy:yo</code></a>
@@ -403,7 +414,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
403414<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#mulrq' title="Multiply (quadprecision float)"><code>++mul:rq</code></a>
404415<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mule' title="Typed virtual"><code>++mule</code></a>
405416<a class="tooltip" href='/docs/hoon/reference/stdlib/4n/#mute' title="Untyped virtual"><code>++mute</code></a>
406−<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#mum' title="31bit MurmurHash3 scrambler"><code>++mum</code></a>
407417<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#murn' title="Maybe transform"><code>++murn</code></a>
408418<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#my' title="Map from raw noun"><code>++my</code></a>
409419<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#mynl' title="Construct map from nullterminated noun"><code>++my:nl</code></a>
@@ -423,7 +433,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
423433<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#nl' title="Noun to container operations"><code>++nl</code></a>
424434<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#nock' title="Virtual machine (see Nock)"><code>++nock</code></a>
425435<a class="tooltip" href='/docs/hoon/reference/stdlib/2d/#not' title="Binary NOT (atom)"><code>++not</code></a>
426−<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#noun' title="(Undocumented)"><code>++noun</code></a>
436+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#noun' title="Any noun"><code>+$noun</code></a>
427437<a class="tooltip" href='/docs/hoon/reference/stdlib/4l/#nuckso' title="Toplevel coin parser"><code>++nuck:so</code></a>
428438<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#nud' title="Parse numeric character"><code>++nud</code></a>
429439<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#null' title="(Undocumented)"><code>++null</code></a>
@@ -443,7 +453,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
443453<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#pair' title="Mold of pair of types"><code>++pair</code></a>
444454<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#pam' title="Parse & (pam)"><code>++pam</code></a>
445455<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#pat' title="Parse @ (pat)"><code>++pat</code></a>
446−<a class="tooltip" href='/docs/hoon/reference/stdlib/3g/#path' title="Filesystem path"><code>++path</code></a>
456+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#path' title="Like unix path"><code>+$path</code></a>
447457<a class="tooltip" href='/docs/hoon/reference/stdlib/1b/#peg' title="Address within address"><code>++peg</code></a>
448458<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#pel' title="Parse ( (pel)"><code>++pel</code></a>
449459<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#per' title="Parse ) (per)"><code>++per</code></a>
@@ -495,6 +505,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
495505<a class="tooltip" href='/docs/hoon/reference/stdlib/3d/#rawog' title="Random bits"><code>++raw:og</code></a>
496506<a class="tooltip" href='/docs/hoon/reference/stdlib/3d/#rawsog' title="Random bits continuation"><code>++raws:og</code></a>
497507<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#re' title="Prettyprinting engine (tank)"><code>++re</code></a>
508+<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#rear' title="Last item in list"><code>++rear</code></a>
498509<a class="tooltip" href='/docs/hoon/reference/stdlib/4k/#rearco' title="Prepend and render atom as tape"><code>++rear:co</code></a>
499510<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#reap' title="Replicate (list)"><code>++reap</code></a>
500511<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#reel' title="Right fold (list)"><code>++reel</code></a>
@@ -502,11 +513,11 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
502513<a class="tooltip" href='/docs/hoon/reference/stdlib/4k/#rendco' title="Render coin lot as tape"><code>++rend:co</code></a>
503514<a class="tooltip" href='/docs/hoon/reference/stdlib/4k/#rentco' title="Render coin lot as span"><code>++rent:co</code></a>
504515<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rep' title="Assemble single"><code>++rep</code></a>
505−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#repby' title="Replace by product (map)"><code>++rep:by</code></a>
516+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#repby' title="Reduce to product (map)"><code>++rep:by</code></a>
506517<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#repin' title="Accumulate elements (set)"><code>++rep:in</code></a>
507518<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rev' title="Reverse"><code>++rev</code></a>
508519<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#rfat' title="(Undocumented)"><code>++rf:at</code></a>
509−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#ribby' title="Replace values with accumulator (map)"><code>++rib:by</code></a>
520+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#ribby' title="Transform + product (map)"><code>++rib:by</code></a>
510521<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#rigre' title="Wrap tape in / (tank)"><code>++rig:re</code></a>
511522<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rip' title="Disassemble"><code>++rip</code></a>
512523<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#rnat' title="(Undocumented)"><code>++rn:at</code></a>
@@ -567,6 +578,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
567578<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#ser' title="Parse ] (ser)"><code>++ser</code></a>
568579<a class="tooltip" href='/docs/hoon/reference/stdlib/2o/#set' title="Mold generator (set)"><code>++set</code></a>
569580<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#sevab' title="Parse nonzero base 32 digit"><code>++sev:ab</code></a>
581+<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#sew' title="Stitch one atom into another"><code>++sew</code></a>
570582<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#sewab' title="Parse nonzero base 64 digit"><code>++sew:ab</code></a>
571583<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#sexab' title="Parse nonzero hexadecimal digit"><code>++sex:ab</code></a>
572584<a class="tooltip" href='/docs/hoon/reference/stdlib/4e/#sfix' title="Discard second rule"><code>++sfix</code></a>
@@ -610,14 +622,14 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
610622<a class="tooltip" href='/docs/hoon/reference/stdlib/4m/#slav' title="Demand: parse cord with input aura"><code>++slav</code></a>
611623<a class="tooltip" href='/docs/hoon/reference/stdlib/4m/#slaw' title="Parse cord to input aura"><code>++slaw</code></a>
612624<a class="tooltip" href='/docs/hoon/reference/stdlib/4m/#slay' title="Parse cord to coin"><code>++slay</code></a>
613−<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#slog' title="Deify printf"><code>++slog</code></a>
625+<a class="tooltip" href='/docs/hoon/reference/stdlib/5c/#slog' title="Deify printf"><code>++slog</code></a>
614626<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#slug' title="Use gate to parse delimited list"><code>++slug</code></a>
615627<a class="tooltip" href='/docs/hoon/reference/stdlib/4m/#smyt' title="Render path as tank"><code>++smyt</code></a>
616628<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#snag' title="Produce element at specific index (list)"><code>++snag</code></a>
617629<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#snagnl' title="Produce element from list at specific nullterminated noun"><code>++snag:nl</code></a>
630+<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#snip' title="Drop tail off list"><code>++snip</code></a>
618631<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#snoc' title="Append noun to list"><code>++snoc</code></a>
619632<a class="tooltip" href='/docs/hoon/reference/stdlib/4l/#so' title="Coin parser engine"><code>++so</code></a>
620−<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#soft' title="Maybe remold"><code>++soft</code></a>
621633<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#some' title="Wrap value in unit"><code>++some</code></a>
622634<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#soq' title="Parse ' (soq)"><code>++soq</code></a>
623635<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#sort' title="Quicksort (list)"><code>++sort</code></a>
@@ -643,9 +655,11 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
643655<a class="tooltip" href='/docs/hoon/reference/stdlib/4m/#stab' title="Parse cord to path"><code>++stab</code></a>
644656<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#stag' title="Add label"><code>++stag</code></a>
645657<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#star' title="Produce list of matches"><code>++star</code></a>
658+<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#step' title="Atom size or offset, in bloqs"><code>++step</code></a>
646659<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#stet' title="Add faces to rangeparser pairs in list"><code>++stet</code></a>
647660<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#stew' title="Switch by first"><code>++stew</code></a>
648661<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#stir' title="Parse repeatedly"><code>++stir</code></a>
662+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#stud' title="Standard name"><code>+$stud</code></a>
649663<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#stun' title="Parse several times"><code>++stun</code></a>
650664<a class="tooltip" href='/docs/hoon/reference/stdlib/1a/#sub' title="Subtract"><code>++sub</code></a>
651665<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#subff' title="Subtract from IEEE float"><code>++sub:ff</code></a>
@@ -654,6 +668,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
654668<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#subrh' title="Subtract from halfprecision float"><code>++sub:rh</code></a>
655669<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#subrs' title="Subtract from singleprecision float"><code>++sub:rs</code></a>
656670<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#subrq' title="Subtract from quadprecision float"><code>++sub:rq</code></a>
671+<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#succ' title="Successor"><code>++succ</code></a>
657672<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#sumfe' title="Sum two numbers in modular field"><code>++sum:fe</code></a>
658673<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#sumfo' title="Modular sum"><code>++sum:fo</code></a>
659674<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#sumsi' title="Addition (signed integer)"><code>++sum:si</code></a>
@@ -677,18 +692,18 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
677692<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#tail' title="Get tail of cell"><code>++tail</code></a>
678693<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#tapto' title="Queue to list"><code>++tap:to</code></a>
679694<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#tar' title="Parse * (tar)"><code>++tar</code></a>
680−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tang' title="Generic print structure"><code>++tang</code></a>
681−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tank' title="Prettyprinting structure"><code>++tank</code></a>
695+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tang' title="Bottom-first error"><code>+$tang</code></a>
696+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tank' title="Formatted print tree"><code>+$tank</code></a>
682697<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#tapby' title="Listify pairs"><code>++tap:by</code></a>
683698<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#tapin' title="Flatten set into list"><code>++tap:in</code></a>
684−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tape' title="List of characters"><code>++tape</code></a>
685−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tarp' title="Parsed time"><code>++tarp</code></a>
699+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tape' title="List of characters"><code>+$tape</code></a>
700+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tarp' title="Parsed time"><code>+$tarp</code></a>
686701<a class="tooltip" href='/docs/hoon/reference/stdlib/4l/#tashso' title="Parse signed dime"><code>++tash:so</code></a>
687702<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#tec' title="Parse ` (tec)"><code>++tec</code></a>
688703<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#tedab' title="Parse decimal number with <= 3 digits"><code>++ted:ab</code></a>
689704<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#teff' title="UTF8 length"><code>++teff</code></a>
690705<a class="tooltip" href='/docs/hoon/reference/stdlib/3f/#teilob' title="Reverse Feistellike cipher"><code>++teil:ob</code></a>
691−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#term' title="Hoon constant"><code>++term</code></a>
706+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#term' title="Hoon constant"><code>+$term</code></a>
692707<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#test' title="Test for equality"><code>++test</code></a>
693708<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#tidab' title="Parse 3 decimal digits"><code>++tid:ab</code></a>
694709<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#tiki' title="(Undocumented)"><code>++tiki</code></a>
@@ -711,6 +726,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
711726<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#topto' title="Produce head of queue"><code>++top:to</code></a>
712727<a class="tooltip" href='/docs/hoon/reference/stdlib/4a/#tospo' title="Fetch prefix"><code>++tos:po</code></a>
713728<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#tosrh' title="Convert halfprecision float to singleprecision float"><code>++tos:rh</code></a>
729+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tour' title="UTF-32 clusters"><code>+$tour</code></a>
714730<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#trap' title="Core with one arm $"><code>++trap</code></a>
715731<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#tree' title="Mold generator (tree)"><code>++tree</code></a>
716732<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#trel' title="Mold generator (tuple of three types)"><code>++trel</code></a>
@@ -731,10 +747,11 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
731747### u
732748
733749<a class="tooltip" href='/docs/hoon/reference/stdlib/3f/#un' title="Reversible scrambling"><code>++un</code></a>
734−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#uniby' title="Union (map between keys of two lists)"><code>++uni:by</code></a>
750+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#uniby' title="Union, merge (map)"><code>++uni:by</code></a>
735751<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#unifl' title="Change representation to odd"><code>++uni:fl</code></a>
736752<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#uniin' title="Union (sets)"><code>++uni:in</code></a>
737753<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#unit' title="Mold generator (maybe)"><code>++unit</code></a>
754+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#unoby' title="General union (map)"><code>++uno:by</code></a>
738755<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#urnby' title="Turn (with key) (map)"><code>++urn:by</code></a>
739756<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#ursab' title="Parse span characters"><code>++urs:ab</code></a>
740757<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#urtab' title="Parse non_ span"><code>++urt:ab</code></a>
@@ -749,7 +766,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
749766<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#vise' title="Convert during reboot"><code>++vise</code></a>
750767<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#vit' title="Parse base 64 digit"><code>++vit</code></a>
751768<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#vizag' title="Parse base 32 digit with dot separators"><code>++viz:ag</code></a>
752−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#vor' title="Vertical order"><code>++vor</code></a>
753769<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#voyab' title="Parse bas, soq, or bix"><code>++voy:ab</code></a>
754770<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#vul' title="Comments to null"><code>++vul</code></a>
755771<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#vumag' title="Parse base 32 string"><code>++vum:ag</code></a>
@@ -758,8 +774,8 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
758774
759775<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#wne' title="Render base 64 digit"><code>++w:ne</code></a>
760776<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#wack' title="Coin format encode"><code>++wack</code></a>
761−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#wain' title="List of cords"><code>++wain</code></a>
762−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#wall' title="List of list of characters"><code>++wall</code></a>
777+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#wain' title="List of cords"><code>+$wain</code></a>
778+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#wall' title="List of list of characters"><code>+$wall</code></a>
763779<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#weld' title="Concatenate two lists"><code>++weld</code></a>
764780<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#weldnl' title="Concatenate nullterminated nouns"><code>++weld:nl</code></a>
765781<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#welp' title="Perfect concatenate (lists)"><code>++welp</code></a>
@@ -844,6 +860,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
844860<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#pair' title="Mold of pair of types"><code>++pair</code></a>
845861<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#pole' title="Mold generator of faceless list"><code>++pole</code></a>
846862<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#quip' title="Mold generator (tuple of list and type)"><code>++quip</code></a>
863+<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#step' title="Atom size or offset, in bloqs"><code>++step</code></a>
847864<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#trap' title="Core with one arm $"><code>++trap</code></a>
848865<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#tree' title="Mold generator (tree)"><code>++tree</code></a>
849866<a class="tooltip" href='/docs/hoon/reference/stdlib/1c/#trel' title="Mold generator (tuple of three types)"><code>++trel</code></a>
@@ -855,9 +872,12 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
855872<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#bind' title="Nonunit function to unit, producing unit"><code>++bind</code></a>
856873<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#bond' title="Replace null"><code>++bond</code></a>
857874<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#both' title="Group unit values into pair"><code>++both</code></a>
858−<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#clap' title="Apply function to two units"><code>++clap</code></a>
875+<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#clap' title="Combine two units with function"><code>++clap</code></a>
876+<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#clef' title="Compose two units with function"><code>++clef</code></a>
859877<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#drop' title="Unit to list"><code>++drop</code></a>
860878<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#fall' title="Give unit a default value"><code>++fall</code></a>
879+<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#flit' title="Make filter"><code>++flit</code></a>
880+<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#hunt' title="Select between two units by a rule"><code>++hunt</code></a>
861881<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#lift' title="Curried bind"><code>++lift</code></a>
862882<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#mate' title="Choose"><code>++mate</code></a>
863883<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#need' title="Unwrap unit"><code>++need</code></a>
@@ -865,6 +885,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
865885
866886### 2b: list logic
867887
888+<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#bake' title="Convert wet gate to dry gate"><code>++bake</code></a>
868889<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#fand' title="All indices in list"><code>++fand</code></a>
869890<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#find' title="First index in list"><code>++find</code></a>
870891<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#flop' title="Reverse list"><code>++flop</code></a>
@@ -886,6 +907,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
886907<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#skip' title="Produce list of elements failing boolean gate"><code>++skip</code></a>
887908<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#slag' title="Produce all elements from index in list"><code>++slag</code></a>
888909<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#snag' title="Produce element at specific index (list)"><code>++snag</code></a>
910+<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#snip' title="Drop tail off list"><code>++snip</code></a>
889911<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#snoc' title="Append noun to list"><code>++snoc</code></a>
890912<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#sort' title="Quicksort (list)"><code>++sort</code></a>
891913<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#spin' title="Gate to list (with state)"><code>++spin</code></a>
@@ -921,6 +943,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
921943<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rip' title="Disassemble"><code>++rip</code></a>
922944<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rev' title="Reverse"><code>++rev</code></a>
923945<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rsh' title="Rightshift"><code>++rsh</code></a>
946+<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#sew' title="Stitch one atom into another"><code>++sew</code></a>
924947<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#swp' title="Reverse block order"><code>++swp</code></a>
925948<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#xeb' title="Binary logarithm"><code>++xeb</code></a>
926949
@@ -933,19 +956,15 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
933956
934957### 2e: insecure hashing
935958
936−<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#fnv' title="FNV scrambler"><code>++fnv</code></a>
937959<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#mug' title="FNV1a scrambler"><code>++mug</code></a>
938960<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#muk' title="Standard MurmurHash3"><code>++muk</code></a>
939−<a class="tooltip" href='/docs/hoon/reference/stdlib/2e/#mum' title="31bit MurmurHash3 scrambler"><code>++mum</code></a>
940961
941962### 2f: noun ordering
942963
943964<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#aor' title="Alphabetical order"><code>++aor</code></a>
944−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#dor' title="Numeric order"><code>++dor</code></a>
945−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#gor' title="Hash order"><code>++gor</code></a>
946−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#hor' title="Horizontal hash order"><code>++hor</code></a>
947−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#lor' title="Leg order"><code>++lor</code></a>
948−<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#vor' title="Vertical order"><code>++vor</code></a>
965+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#dor' title="Depth order"><code>++dor</code></a>
966+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#gor' title="Mug order"><code>++gor</code></a>
967+<a class="tooltip" href='/docs/hoon/reference/stdlib/2f/#mor' title="(more) mug order"><code>++mor</code></a>
949968
950969### 2g: unsigned powers
951970
@@ -980,20 +999,24 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
980999<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#aptby' title="Check correctness (map)"><code>++apt:by</code></a>
9811000<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#bifby' title="Bifurcate map"><code>++bif:by</code></a>
9821001<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#delby' title="Delete (map)"><code>++del:by</code></a>
1002+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#difby' title="Difference between maps"><code>++dif:by</code></a>
9831003<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#digby' title="Address of key (map)"><code>++dig:by</code></a>
9841004<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gasby' title="Concatenate (map)"><code>++gas:by</code></a>
9851005<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#getby' title="Grab unit value"><code>++get:by</code></a>
9861006<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#gotby' title="Assert for value (map)"><code>++got:by</code></a>
9871007<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#hasby' title="Key existence check (map)"><code>++has:by</code></a>
9881008<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#intby' title="Intersection (map)"><code>++int:by</code></a>
989−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#marby' title="Assert and add (map)"><code>++mar:by</code></a>
1009+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#jabby' title="Transform value (map)"><code>++jab:by</code></a>
1010+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#keyby' title="Set of keys"><code>++key:by</code></a>
1011+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#marby' title="Add with validation (map)"><code>++mar:by</code></a>
9901012<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#putby' title="Add keyvalue pair (map)"><code>++put:by</code></a>
991−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#repby' title="Replace by product (map)"><code>++rep:by</code></a>
992−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#ribby' title="Replace values with accumulator (map)"><code>++rib:by</code></a>
1013+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#repby' title="Reduce to product (map)"><code>++rep:by</code></a>
1014+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#ribby' title="Transform + product (map)"><code>++rib:by</code></a>
9931015<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#runby' title="Transform values (map)"><code>++run:by</code></a>
9941016<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#rutby' title="Transform nodes (map)"><code>++rut:by</code></a>
9951017<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#tapby' title="Listify pairs"><code>++tap:by</code></a>
996−<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#uniby' title="Union (map between keys of two lists)"><code>++uni:by</code></a>
1018+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#uniby' title="Union, merge (map)"><code>++uni:by</code></a>
1019+<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#unoby' title="General union (map)"><code>++uno:by</code></a>
9971020<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#urnby' title="Turn (with key) (map)"><code>++urn:by</code></a>
9981021<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#wytby' title="Produce depth of tree map"><code>++wyt:by</code></a>
9991022
@@ -1005,6 +1028,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
10051028
10061029<a class="tooltip" href='/docs/hoon/reference/stdlib/2j/#ju' title="Jug operations"><code>++ju</code></a>
10071030<a class="tooltip" href='/docs/hoon/reference/stdlib/2j/#delju' title="Delete (jug)"><code>++del:ju</code></a>
1031+<a class="tooltip" href='/docs/hoon/reference/stdlib/2j/#gasju' title="Concatenate (jug)"><code>++gas:ju</code></a>
10081032<a class="tooltip" href='/docs/hoon/reference/stdlib/2j/#getju' title="Retrieve set"><code>++get:ju</code></a>
10091033<a class="tooltip" href='/docs/hoon/reference/stdlib/2j/#hasju' title="Check contents (jug)"><code>++has:ju</code></a>
10101034<a class="tooltip" href='/docs/hoon/reference/stdlib/2j/#putju' title="Add keyset pair (jar)"><code>++put:ju</code></a>
@@ -1012,6 +1036,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
10121036### 2k: queue logic
10131037
10141038<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#to' title="Queue operations"><code>++to</code></a>
1039+<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#aptto' title="Check correctness of queue"><code>++apt:to</code></a>
10151040<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#balto' title="Balance queue"><code>++bal:to</code></a>
10161041<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#depto' title="Maximum depth (queue)"><code>++dep:to</code></a>
10171042<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#gasto' title="Push list into queue"><code>++gas:to</code></a>
@@ -1043,18 +1068,19 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
10431068
10441069### 2n: functional hacks
10451070
1071+<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#aftr' title="Pair after"><code>++aftr</code></a>
10461072<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#cork' title="Compose forward"><code>++cork</code></a>
10471073<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#corl' title="Compose backward"><code>++corl</code></a>
10481074<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#curr' title="Rightcurry a gate"><code>++curr</code></a>
10491075<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#cury' title="Curry left a gate"><code>++cury</code></a>
1050−<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#hard' title="Force remold"><code>++hard</code></a>
1076+<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#fore' title="Pair before"><code>++fore</code></a>
10511077<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#head' title="Get head of cell"><code>++head</code></a>
1052−<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#mean' title="Crash and printf"><code>++mean</code></a>
10531078<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#same' title="Identity (produces same value)"><code>++same</code></a>
1054−<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#slog' title="Deify printf"><code>++slog</code></a>
1055−<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#soft' title="Maybe remold"><code>++soft</code></a>
1079+<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#succ' title="Successor"><code>++succ</code></a>
10561080<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#tail' title="Get tail of cell"><code>++tail</code></a>
10571081<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#test' title="Test for equality"><code>++test</code></a>
1082+<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#lead' title="Put head"><code>++lead</code></a>
1083+<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#late' title="Put tail"><code>++late</code></a>
10581084
10591085### 2o: normalizing containers
10601086
@@ -1073,17 +1099,25 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
10731099
10741100### 2q: molds and mold builders
10751101
1076−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#char' title="Character"><code>++char</code></a>
1077−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#cord' title="UTF8 text"><code>++cord</code></a>
1078−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#date' title="Point in time"><code>++date</code></a>
1079−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#knot' title="Atom type of ASCII characters"><code>++knot</code></a>
1080−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tang' title="Generic print structure"><code>++tang</code></a>
1081−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tank' title="Prettyprinting structure"><code>++tank</code></a>
1082−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tape' title="List of characters"><code>++tape</code></a>
1083−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tarp' title="Parsed time"><code>++tarp</code></a>
1084−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#term' title="Hoon constant"><code>++term</code></a>
1085−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#wain' title="List of cords"><code>++wain</code></a>
1086−<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#wall' title="List of list of characters"><code>++wall</code></a>
1102+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#axis' title="Tree address"><code>+$axis</code></a>
1103+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#bean' title="Boolean"><code>+$bean</code></a>
1104+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#char' title="Character"><code>+$char</code></a>
1105+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#cord' title="UTF8 text"><code>+$cord</code></a>
1106+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#byts' title="bytes, LSB first"><code>+$byts</code></a>
1107+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#date' title="Parsed date"><code>+$date</code></a>
1108+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#flag' title="Boolean (flag)"><code>+$flag</code></a>
1109+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#knot' title="Atom type of ASCII characters"><code>+$knot</code></a>
1110+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#noun' title="Any noun"><code>+$noun</code></a>
1111+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#path' title="Like unix path"><code>+$path</code></a>
1112+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#stud' title="Standard name"><code>+$stud</code></a>
1113+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tang' title="Bottom-first error"><code>+$tang</code></a>
1114+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tank' title="Formatted print tree"><code>+$tank</code></a>
1115+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tape' title="List of characters"><code>+$tape</code></a>
1116+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tour' title="UTF-32 clusters"><code>+$tour</code></a>
1117+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#tarp' title="Parsed time"><code>+$tarp</code></a>
1118+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#term' title="Hoon constant"><code>+$term</code></a>
1119+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#wain' title="List of cords"><code>+$wain</code></a>
1120+<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#wall' title="List of list of characters"><code>+$wall</code></a>
10871121
10881122### 3a: modular and signed ints
10891123
@@ -1364,7 +1398,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
13641398<a class="tooltip" href='/docs/hoon/reference/stdlib/3g/#hair' title="Parsing line and column"><code>++hair</code></a>
13651399<a class="tooltip" href='/docs/hoon/reference/stdlib/3g/#like' title="Generic edge"><code>++like</code></a>
13661400<a class="tooltip" href='/docs/hoon/reference/stdlib/3g/#nail' title="Location, remainder of parsed text"><code>++nail</code></a>
1367−<a class="tooltip" href='/docs/hoon/reference/stdlib/3g/#path' title="Filesystem path"><code>++path</code></a>
13681401<a class="tooltip" href='/docs/hoon/reference/stdlib/3g/#pint' title="Parsing range"><code>++pint</code></a>
13691402<a class="tooltip" href='/docs/hoon/reference/stdlib/3g/#rule' title="Parsing rule (match this with _)"><code>++rule</code></a>
13701403<a class="tooltip" href='/docs/hoon/reference/stdlib/3g/#spot' title="Stack trace line"><code>++spot</code></a>
@@ -1668,9 +1701,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
16681701
16691702<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#abel' title="Compiler alias"><code>++abel</code></a>
16701703<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#aura' title="'Type' of atom"><code>++aura</code></a>
1671−<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#axis' title="Nock axis"><code>++axis</code></a>
16721704<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#base' title="Base type"><code>++base</code></a>
1673−<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#bean' title="Boolean"><code>++bean</code></a>
16741705<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#beer' title="Tape builder"><code>++beer</code></a>
16751706<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#beet' title="XML interpolation cases"><code>++beet</code></a>
16761707<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#chum' title="Jet hint information"><code>++chum</code></a>
@@ -1680,7 +1711,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
16801711<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#line' title="(Undocumented)"><code>++line</code></a>
16811712<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#metl' title="(Undocumented)"><code>++metl</code></a>
16821713<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#nock' title="Virtual machine (see Nock)"><code>++nock</code></a>
1683−<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#noun' title="(Undocumented)"><code>++noun</code></a>
16841714<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#null' title="(Undocumented)"><code>++null</code></a>
16851715<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#port' title="(Undocumented)"><code>++port</code></a>
16861716<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#span' title="ASCII atom"><code>++span</code></a>
@@ -1706,7 +1736,9 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
17061736
17071737### 5c: compiler backend and prettyprinter
17081738
1709−<a class="tooltip" href='/docs/hoon/reference/stdlib/5c/'>_(To be documented)_</a>
1739+<a class="tooltip" href='/docs/hoon/reference/stdlib/5c/'>_(To be fully documented)_</a>
1740+<a class="tooltip" href='/docs/hoon/reference/stdlib/5c/#slog' title="Deify printf"><code>++slog</code></a>
1741+<a class="tooltip" href='/docs/hoon/reference/stdlib/5c/#mean' title="Crash and printf"><code>++mean</code></a>
17101742
17111743### 5d: parser
17121744
content/grants/analytics-script.md+2−1
@@ -11,7 +11,8 @@ image = ""
1111description = "Write a generator that exports chat data into a CSV."
1212reward = 1
1313assignee = "~hosted-fornet"
14−completed = false
14+completed = true
15+canceled = false
1516work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=B0015&prefill_Grant+Name=Analytics%20Script"
1617+++
1718
content/grants/art-by-urbit.md+1
@@ -13,6 +13,7 @@ reward = 1
1313assignee = "nartes-fasrum"
1414id = "636838408"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/authenticate-with-urbit.mdnew file+36
@@ -0,0 +1,36 @@
1++++
2+title = "Authenticate with Urbit Gall App"
3+date = "2021-09-16"
4+[taxonomies]
5+grant_type = ["Proposal"]
6+grant_category = ["App Dev: Other"]
7+[extra]
8+image = ""
9+description = "Exernal service/websites can verify that a user is who they say they are"
10+reward = 1
11+assignee = "dcSpark"
12+grant_id = "P0081"
13+completed = false
14+canceled = false
15+link = ""
16++++
17+
18+## Authenticate with Urbit Gall App
19+
20+The authenticate with Urbit ID gall app will allow external services/websites to verify that a user is who they say they are via their running ship. In other words, the website will be able to integrate this gall app/exposed endpoints with their existing login process to allow users to "Login With Urbit".
21+
22+These websites need to be able to confirm with 100% certainty that a person owns the Urbit ship they claim to own, or else users can spoof and trick sites into thinking they are someone else. As such the gall app will enable identity verification via a streamlined process and will simply expose web server endpoints for the website back end to plug into (no airlock integration required).
23+
24+We are choosing to implement a gall app instead of using using cryptography and crypto keys explicitly because it narrows down the complexity, skips requiring websites being forced to follow the Ethereum chain, and improves the UX considerably for end users. If we used crypto keys to check for identity, users would be required to have an Ethereum wallet installed in their web browser, ensure it has their software wallet keys or hardware wallet connected with their Urbit ID, and have to go through a multi-step process to sign a message to prove their identity every single time they want to login.
25+
26+Furthermore with naive rollups on the way, this would leave out everyone on the rollups from being able to login using this scheme. This likewise would also be the case for users who jump into the Urbit ecosystem via an Urbit hosting service. As such we ruled out going down said route.
27+
28+Instead we will be using the user’s running ship to authenticate them over the Urbit network itself. This will provide users a simple experience for logging themselves in to standard database-driven websites securely.Expected completion:
29+
30+## Milestones
31+
32+### Milestone 1 - A gall application named %hermes which allows external applications to authenticate user identities
33+
34+Expected Completion: Mid-October 2021
35+
36+Payment: 1 star
content/grants/azimuth-cli.mdnew file+164
@@ -0,0 +1,164 @@
1++++
2+title = "Azimuth CLI"
3+date = "2021-09-20"
4+[taxonomies]
5+grant_type = ["Proposal"]
6+grant_category = ["App Dev: Other"]
7+[extra]
8+image = ""
9+description = "Bridge for the command line"
10+reward = 6
11+assignee = "~lavlyn-litmeg"
12+grant_id = "P0080"
13+completed = false
14+canceled = false
15+link = ""
16++++
17+
18+## Azimuth CLI
19+
20+The azimuth-cli is "Bridge for the command line." It should allow ship owners and operators to do the same things that they can in Bridge but via the command line, and in batch mode. For example, it should be possible to batch-spawn 10 planets from a star, or transfer ownership of several stars or planets with one command.
21+
22+## Background
23+
24+Azimuth is a set of Ethereum smart contracts that handle most things related to Urbit ID. The primary way of interacting with Azimuth, right now, is via Bridge, a dApp. However, hosting providers and people who run stars frequently need to automate their interactions with Azimuth, but there is currently not an easy way to do that.
25+
26+There is the excellent azimuth-js library that makes most bridge functions available as a JavaScript API, but it still requires substantial effort to automate things. Additionally, not all the features available in Bridge are currently accessible via npm package, requiring quite a bit of reverse engineering.
27+
28+Finally, with the upcoming Layer 2 (L2) solution, the need and desire to automate batch operations will likely increase.
29+
30+## Goals
31+
32+1. Implement a CLI that supports the most important Azimuth and Eliptic operations, such as list points, spawn points, set network keys, set proxy addresses, and transfer ownership.
33+2. Improve the current Urbit ID related JS projects, such as azimuth-js, and urbit-key-generation.
34+3. Support the new L2 solution.
35+4. Since most operations will require the private key or master ticket, there needs to be a way to keep them secure.
36+5. Design the CLI in such a way that it is safe to script operations. E.g., there is little risk of spawning too many planets.
37+
38+## Design
39+
40+### Node.JS CLI
41+
42+The CLI will be implemented in Node.js because most libraries that the project relies on are in JavaScript themselves.
43+
44+The CLI will initially support the following commands:
45+
46+- List: list points that an address controls; list child points of a point; list unspawned points
47+- Spawn: spawn a certain amount of child points from a parent. This can be provided as a list of patps or just a spawn count that will select points randomly from the unspawned list.
48+- Network Keys: Set the Arvo network keys
49+- Management Proxy: Set the management proxy of ships
50+- Spawn Proxy: Set the spawn proxy of ships
51+- Transfer: Transfer either to another address or to master tickets.
52+- Accept transfers: Accept incoming transfers on a certain address.
53+- Report: Generate an easy to use and easy to import CSV report of the current directory. E.g., a list of ship names, owner address, spawn cost in ETH and USD, and so on.
54+
55+### Idempotent Commands
56+
57+All commands that modify on-chain state should be able to run idempotently. That is, it should be safe to repeatedly call a command with a certain set of arguments. For example, calling the CLI multiple times to spawn 10 planets, should only spawn 10 planets exactly, even if it fails intermittently. This will make it possible to use the CLI to script and automate actions much more easily.
58+
59+To achieve this, each command should always operate in a working directory. Things like master tickets, network seeds, Ethereum transaction receipts are saved in this directory to ensure that all operations are deterministic once the relevant files have been created. For example, if the CLI is used to set the network keys, the program first generates a random seed (or uses the seed from an existing master ticket) and then saves that seed to the working directory. It then tries to set the network key for one or more points on Elliptic. If the Ethereum transaction fails (e.g., because of too high gas prices) then the command can just be rerun making sure that it eventually succeeds, trying until the on-chain key matches what is saved in the working directory.
60+
61+### Libraries
62+
63+The CLI will make use of several existing Urbit libraries, such as azimuth-js, urbit-ob, and urbit-key- generation. But there is also some code in the current bridge application that is needed, for example, the functions to generate the Arvo key file. Ideally, all code making use of cryptography should live upstream, in an Urbit org owned repository. Hence part of this grant is to make PRs for some of the existing libraries and push relevant code upstream. Of course, talking to the relevant owners and developers first.
64+
65+Some of the functions that the CLI needs can be made into its own library too, conceivably allowing developers to build on the functionality of the CLI for their own projects.
66+
67+### Security and Vetting
68+
69+Once the CLI is completed, it should be vetted by Tlon and then be taken under the Urbit org GitHub account. Many of the CLI operations will have access to the private keys of valuable Urbit address space. Hence the CLI repository is a likely target for someone trying to inject malicious code. The repository being owned by Urbit or Tlon should mitigate some of that.
70+
71+Moreover, the tool should try to integrate with some of the hardware wallets so that the transactions of CLI operations can be signed from an external wallet. Another option would be to load the private keys from a key chain, such as the MacOS key chain.
72+Nonetheless, if someone wants to fully automate operations with the CLI then the private key needs to be provided via command line argument or environment variable. This will have to be made clear via documentation, and users need to be made aware of the dangers.
73+
74+### Ethereum Gas Fees
75+
76+There should be an option to define the maximum gas fees for a command or operation. Or even provide something like a percentage of the 10 day moving average of gas fees. A CLI user can then script an operation and schedule the script to run, say, every hour. Since the operations are idempotent this will be safe to do. The script will then run every hour until the gas prices are low enough or affordable and will then succeed. This will be very helpful when doing larger batch operation, such as spawning several planets and keying them, because the Ethereum gas fees can vary by a factor of 10.
77+
78+### Layer 2
79+
80+The CLI should work with both the current Azimuth contracts and the new Layer 2 solution.
81+
82+### CSV Reports
83+
84+Since this tool will be used by power users, who want to import the data into different systems or keep track of cost, there should also be a CLI command that converts the raw data in a working directory to an easy consumable CSV report. This report should contain a list of p and patp, addresses (ownership, management, etc.), master tickets, Ethereum transaction costs, timestamps, and so on.
85+
86+## About Me (~lavlyn-litmeg)
87+
88+I am the maker of [UrbitHost](https://urbithost.com/). In the process of building that provider, I have already written many Node.js scripts that do approximately what this specification proposes. There are almost no unknowns, here, except, perhaps, the Layer 2 solution. To write this CLI, I would have essentially do a complete rewrite of all the scripts that I have developed over time, but it is very likely that I will be able to accomplish most tasks outline here.
89+
90+As someone who is running a hosting provider, I will be major user of the CLI as an automation tool myself. Consequently, I will likely maintain this project in the foreseeable future and will also be able to help people with support requests.
91+
92+## Milestones
93+
94+### Milestone 1 - First Working Version of the CLI
95+
96+Expected Completion: 2 months
97+
98+Payment: 2 stars
99+
100+The first milestone is to create the whole CLI framework and implement the first set of commands.
101+
102+Deliverables:
103+
104+- Node.JS project and CLI framework (based on yargs)
105+- Deployable npm package
106+- Work directory framework
107+- Extract relevant code from Bridge, for the time being, copied to the CLI repo
108+- Master ticket and Arvo key generation
109+- List command
110+- Spawn command
111+- Network Key command
112+- Management Proxy command
113+- Transfer command
114+- Document the project
115+- Document usage, give usage examples
116+
117+### Milestone 2 - Vetting and Second Phase of CLI
118+
119+Expected Completion: 1 month
120+
121+Payment: 1 star
122+
123+Having a working tool now, the question will be what parts to merge upstream. Also figure out what parts or projects should be taken under the Urbit umbrella (assuming people start using the CLI).
124+
125+Deliverables:
126+
127+- Merge high risk code (e.g., anything related to cryptography) upstream to Urbit org repositories, focusing on making as many CLI functions also usable as a library.
128+- Possibly move the CLI project under the Urbit org
129+- Ethereum Gas handling and configuration, allowing the automation of on chain transactions at a low cost.
130+- Report generation command.
131+
132+### Milestone 3 - Layer 2 Support
133+
134+Expected Completion: 2 months
135+
136+Payment: 2 stars
137+
138+As soon as the Layer 2 solution is released, the CLI should also support actions on that layer. With rollups, address owners are likely to do larger batch operations. The CLI will be a good tool for that.
139+
140+Deliverables:
141+
142+- Move points that are on Azimuth to L2, or move just the spawn proxy of stars.
143+- Connect to a Roller instead of an ETH node
144+- Spawn points on L2
145+- Set Network Keys on L2
146+- Set Proxies on L2
147+- Transfer points on L2
148+
149+### Milestone 4 - Additional Features
150+
151+Expected Completion: 1 month
152+
153+Payment: 1 star
154+
155+Adding a set of features that will make the CLI much more usable and secure
156+
157+Deliverables:
158+
159+- Hardware Wallet support (signing transactions on the wallet not using the web3 lib)
160+- Retrieving private keys from key-chains, at least MacOS or Linux
161+- More point list/search functionality
162+- Search for unspawned planets (for example, by English language worlds, like Venetia, or custom strings)
163+- Query Azimuth (and L2) for ship state: is it spawned, is it keyed, etc. (this is helpful to check if, say, a galaxy is likely to be alive when buying a star).
164+- Utils (p to patp)
content/grants/bridge-l2-revamp.md+1
@@ -12,6 +12,7 @@ description = "Our Layer 2 scaling solution is nearing completion, and the Bridg
1212reward = 5
1313assignee = "~datder-sonnet"
1414completed = false
15+canceled = false
1516link = ""
1617+++
1718
content/grants/calendar-ui.md+1
@@ -13,6 +13,7 @@ reward = 2
1313assignee = "finled-bansel"
1414id = "1555464949"
1515completed = false
16+canceled = true
1617link = ""
1718+++
1819
content/grants/comprehensive-local-server-and-mum-explanation-video.md+2−1
@@ -10,9 +10,10 @@ grant_category = [ "Community" ]
1010image = ""
1111description = "Series of three videos:1) Purchase planet, install and run on a local machine2) nginx setup3) Explaining Urbit to my tech illiterate mum "
1212reward = 1
13−assignee = "mislyr-midnyt"
13+assignee = "mislyr-misnyt"
1414id = "2020133197"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/contacts.md+1
@@ -13,6 +13,7 @@ reward = 1
1313mentor = "~timluc-miptev"
1414assignee = ""
1515completed = false
16+canceled = false
1617work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=B0034&prefill_Grant+Name=Contacts%20App"
1718+++
1819
content/grants/content-producer.md+1
@@ -13,6 +13,7 @@ reward = 3
1313assignee = "~sitful-hatred"
1414id = ""
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/cross-platform-desktop-urbit-app.md+2−1
@@ -12,7 +12,8 @@ description = "A native app that makes running Urbit near friction-less for ever
1212reward = 10
1313assignee = "nocsyx-lassul"
1414id = "740109059"
15−completed = false
15+completed = true
16+canceled = false
1617link = ""
1718+++
1819
content/grants/educational-guide-todomvc-urbit-edition.md+1
@@ -13,6 +13,7 @@ reward = 10
1313assignee = "~rabsef-bicrym"
1414id = "1372696624"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/feed-aggregator.md+1
@@ -13,6 +13,7 @@ reward = 5
1313assignee = "~mirtyl-wacdec"
1414grant_id = "P0043"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/graph-store-documentation-guide.md+1
@@ -13,6 +13,7 @@ reward = 4
1313assignee = "~sipfyn-pidmex"
1414id = "1888977136"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/guide-to-s3.md+1
@@ -13,6 +13,7 @@ reward = 1
1313assignee = "~tomnyr-tirsyr"
1414id = ""
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/host-two-urbit-meetups-12.md+2−1
@@ -10,10 +10,11 @@ grant_category = [ "Community" ]
1010image = ""
1111description = "Urbit needs champions! The Urbit Foundation is looking for community members to host local or online meetups to spread the word."
1212reward = 1
13−assignee = ""
13+assignee = "~tillys-fasryp"
1414id = ""
1515work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=B0031&prefill_Grant+Name=Host%20Two%20Urbit%20Meetups%20%2812%29"
1616completed = false
17+canceled = false
1718link = ""
1819+++
1920
content/grants/host-two-urbit-meetups-13.mdnew file+59
@@ -0,0 +1,59 @@
1++++
2+title = "Host Two Urbit Meetups (13)"
3+date = "2021-09-14"
4+
5+[taxonomies]
6+grant_type = [ "Bounty" ]
7+grant_category = [ "Community" ]
8+
9+[extra]
10+image = ""
11+description = "Urbit needs champions! The Urbit Foundation is looking for community members to host local or online meetups to spread the word."
12+reward = 1
13+assignee = "~mogmyr-talrus"
14+id = ""
15+work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=B0083&prefill_Grant+Name=Host%20Two%20Urbit%20Meetups%20%2813%29"
16+completed = false
17+canceled = false
18+link = ""
19+
20++++
21+
22+#### Background
23+
24+Urbit needs champions! The Urbit Foundation is looking for community members to host local or online meetups to spread the word.
25+
26+#### Bounty Description
27+
28+This bounty is to host an Urbit meetup in your city. The meetup should meet the following criteria:
29+
30+- The meetup must be public, and there must be a public web link for joining (like meetup.com)
31+- The meetup must have a presentation or talk about Urbit.
32+- The presentation or talk must be recorded and posted publicly online.
33+- You must promote the event vigorously; social media, a website, etc. Email support@urbit.org if you want a signal boost.
34+- You must host at least two meetups.
35+
36+You should go into this bounty with the mindset of creating a regularly scheduled meetup, one that might become the nucleus of your city's Urbit community. Also, email support@tlon.io once you've hosted a meetup, and we will add you to your [list of active meetups](https://urbit.org/community/meetups/)!
37+
38+#### Resources
39+
40+Check out our [guide](https://urbit.org/community/hosting-a-meetup/) to best practices for Urbit meetups.
41+
42+#### Contribution Guidelines
43+
44+- Do not begin work until your request to claim this bounty is accepted.
45+- When applying to work on the bounty, tell us a little about yourself and mention which city you'd be hosting the meetups in.
46+- Proof of the meetups happening will be determined by the recordings of the presentations. Email links to these recordings to grants@urbit.org.
47+- You have 100 days from the time of approval to complete this bounty.
48+
49+## Milestones
50+
51+### The first meetup is held
52+
53+0 stars
54+The first meetup is held, and a recording of that meetup's talk or presentation is sent to grants@urbit.org.
55+
56+### The second meetup is held
57+
58+1 stars
59+The second meetup is held, and a recording of that meetup's talk or presentation is sent to grants@urbit.org.
content/grants/host-two-urbit-meetups-14.mdnew file+59
@@ -0,0 +1,59 @@
1++++
2+title = "Host Two Urbit Meetups (14)"
3+date = "2021-09-21"
4+
5+[taxonomies]
6+grant_type = [ "Bounty" ]
7+grant_category = [ "Community" ]
8+
9+[extra]
10+image = ""
11+description = "Urbit needs champions! The Urbit Foundation is looking for community members to host local or online meetups to spread the word."
12+reward = 1
13+assignee = "~sarlev-sarsen"
14+id = ""
15+work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=B0083&prefill_Grant+Name=Host%20Two%20Urbit%20Meetups%20%2814%29"
16+completed = false
17+canceled = false
18+link = ""
19+
20++++
21+
22+#### Background
23+
24+Urbit needs champions! The Urbit Foundation is looking for community members to host local or online meetups to spread the word.
25+
26+#### Bounty Description
27+
28+This bounty is to host an Urbit meetup in your city. The meetup should meet the following criteria:
29+
30+- The meetup must be public, and there must be a public web link for joining (like meetup.com)
31+- The meetup must have a presentation or talk about Urbit.
32+- The presentation or talk must be recorded and posted publicly online.
33+- You must promote the event vigorously; social media, a website, etc. Email support@urbit.org if you want a signal boost.
34+- You must host at least two meetups.
35+
36+You should go into this bounty with the mindset of creating a regularly scheduled meetup, one that might become the nucleus of your city's Urbit community. Also, email support@tlon.io once you've hosted a meetup, and we will add you to your [list of active meetups](https://urbit.org/community/meetups/)!
37+
38+#### Resources
39+
40+Check out our [guide](https://urbit.org/community/hosting-a-meetup/) to best practices for Urbit meetups.
41+
42+#### Contribution Guidelines
43+
44+- Do not begin work until your request to claim this bounty is accepted.
45+- When applying to work on the bounty, tell us a little about yourself and mention which city you'd be hosting the meetups in.
46+- Proof of the meetups happening will be determined by the recordings of the presentations. Email links to these recordings to grants@urbit.org.
47+- You have 100 days from the time of approval to complete this bounty.
48+
49+## Milestones
50+
51+### The first meetup is held
52+
53+0 stars
54+The first meetup is held, and a recording of that meetup's talk or presentation is sent to grants@urbit.org.
55+
56+### The second meetup is held
57+
58+1 stars
59+The second meetup is held, and a recording of that meetup's talk or presentation is sent to grants@urbit.org.
content/grants/host-two-urbit-meetups-15.mdnew file+59
@@ -0,0 +1,59 @@
1++++
2+title = "Host Two Urbit Meetups (15)"
3+date = "2021-09-21"
4+
5+[taxonomies]
6+grant_type = [ "Bounty" ]
7+grant_category = [ "Community" ]
8+
9+[extra]
10+image = ""
11+description = "Urbit needs champions! The Urbit Foundation is looking for community members to host local or online meetups to spread the word."
12+reward = 1
13+assignee = ""
14+id = ""
15+work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=B0083&prefill_Grant+Name=Host%20Two%20Urbit%20Meetups%20%2815%29"
16+completed = false
17+canceled = false
18+link = ""
19+
20++++
21+
22+#### Background
23+
24+Urbit needs champions! The Urbit Foundation is looking for community members to host local or online meetups to spread the word.
25+
26+#### Bounty Description
27+
28+This bounty is to host an Urbit meetup in your city. The meetup should meet the following criteria:
29+
30+- The meetup must be public, and there must be a public web link for joining (like meetup.com)
31+- The meetup must have a presentation or talk about Urbit.
32+- The presentation or talk must be recorded and posted publicly online.
33+- You must promote the event vigorously; social media, a website, etc. Email support@urbit.org if you want a signal boost.
34+- You must host at least two meetups.
35+
36+You should go into this bounty with the mindset of creating a regularly scheduled meetup, one that might become the nucleus of your city's Urbit community. Also, email support@tlon.io once you've hosted a meetup, and we will add you to your [list of active meetups](https://urbit.org/community/meetups/)!
37+
38+#### Resources
39+
40+Check out our [guide](https://urbit.org/community/hosting-a-meetup/) to best practices for Urbit meetups.
41+
42+#### Contribution Guidelines
43+
44+- Do not begin work until your request to claim this bounty is accepted.
45+- When applying to work on the bounty, tell us a little about yourself and mention which city you'd be hosting the meetups in.
46+- Proof of the meetups happening will be determined by the recordings of the presentations. Email links to these recordings to grants@urbit.org.
47+- You have 100 days from the time of approval to complete this bounty.
48+
49+## Milestones
50+
51+### The first meetup is held
52+
53+0 stars
54+The first meetup is held, and a recording of that meetup's talk or presentation is sent to grants@urbit.org.
55+
56+### The second meetup is held
57+
58+1 stars
59+The second meetup is held, and a recording of that meetup's talk or presentation is sent to grants@urbit.org.
content/grants/json-jet.md+1
@@ -13,6 +13,7 @@ reward = 1
1313mentor = "~timluc-miptev"
1414assignee = "~finmep-lanteb"
1515completed = false
16+canceled = false
1617work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=B0036&prefill_Grant+Name=JSON%20Parsing%2FSerialization%20Jet"
1718+++
1819
content/grants/links-in-urbit-reference-docs.md+2−1
@@ -12,7 +12,8 @@ description = "Add links to our reference doc pages so that people can easily di
1212reward = 1
1313assignee = "alecbrick"
1414id = "45608361"
15−completed = false
15+completed = true
16+canceled = false
1617link = ""
1718+++
1819
content/grants/login-with-urbit.md+1
@@ -13,6 +13,7 @@ reward = 8
1313assignee = "dcSpark"
1414id = ""
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/machine-learning.md+1
@@ -11,6 +11,7 @@ reward = 7
1111assignee = "~tamdev-nocdun"
1212grant_id = "P0075"
1313completed = false
14+canceled = false
1415link = ""
1516+++
1617
content/grants/minimal-urbit-os.md+1
@@ -13,6 +13,7 @@ reward = 6
1313assignee = "~forfel-norfel"
1414id = "1935638429"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/network-explorer-data-pipeline-http-api.md+1
@@ -13,6 +13,7 @@ reward = 5
1313assignee = "Christopher King"
1414id = "1101665172"
1515completed = false
16+canceled = true
1617link = ""
1718+++
1819
content/grants/network-explorer.mddeleted−233
@@ -1,233 +0,0 @@
1−+++
2−title = "Network Explorer: Data Pipeline and HTTP API"
3−date = "2021-03-11"
4−
5−[taxonomies]
6−grant_type = [ "Bounty" ]
7−grant_category = [ "App Dev: Other" ]
8−
9−[extra]
10−image = ""
11−description = "Build a public, open HTTP API for exploring metrics about the Urbit network."
12−reward = 5
13−assignee = "Christopher King"
14−id = ""
15−completed = false
16−link = ""
17−+++
18−
19−## Overview
20−
21−![network explorer screenshot](https://wolref-podlex.s3.us-west-2.amazonaws.com/wolref-podlex/2021.2.23..20.58.30-Screen%20Shot%202021-02-23%20at%209%2C01%2C03%20AM.png)
22−
23−### Goal
24−
25−Build a public, open HTTP API for exploring metrics about the Urbit network.
26−
27−### Background
28−
29−The project known as the **Network Explorer** has been in the works at Tlon for
30−quite some time. The idea is to build a publicly-accessible tool (hosted on
31−https://network.urbit.org) that provides key metrics and insights into the state
32−of the Urbit network. A series of high-fidelity designs have been produced.
33−
34−### Scope
35−
36−This bounty covers the creation of the:
37−
38−- **data pipeline**: we're concerned with data from the PKI (Azimuth) and
39− the Urbit network itself. These two datasets will need to be aggregated and
40− indexed for efficient querying.
41−- **HTTP API**: the interface for querying data from a client, like the Network
42− Explorer.
43−
44−The Network Explorer interface will be covered in a separate bounty.
45−
46−## Implementation
47−
48−### Data Model
49−
50−Let's start with the data model. There are two sources of data that we need:
51−
52−- **PKI (Azimuth)**: The public-key infrastructure, currently known as Azimuth,
53− is our primary source of data. This information is currently found on Ethereum
54−- **Radar output**: [`radar`](https://github.com/urbit/urbit/blob/2c412d658a74dca3b3f584b92f8b390f38a05ba1/pkg/arvo/app/radar.hoon) is a program run from within an Urbit
55− ship that pings (`|hi`) every Urbit ship and records the results. This data is exposed in a single JSON file that is added to over time as the script runs.
56−
57−Most of the required information in the Network Explorer will come from Azimuth.
58−It's important to know though that the source of PKI information will likely
59−change in the near future in light of [ongoing work to reduce the
60−cost](https://groups.google.com/a/urbit.org/g/dev/c/p6rP_WsxLS0) of bringing
61−nodes onto the network.
62−
63−The below [entity-relationship
64−diagram](https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model)
65−defines a data model in terms of a relational database:
66−
67−![erd diagram](https://wolref-podlex.s3.us-west-2.amazonaws.com/wolref-podlex/2021.2.23..20.58.39-Network%20Explorer%20ERD.png)
68−
69−Some notes about the above diagram:
70−
71−- The data model should be _agnostic to any particular PKI storage
72− infrastructure_ to future-proof it against PKI changes.
73−- For non-`ping` data, it should be possible to compute the table of `node` from
74− a time-ordered traversal of `pki_event` (kind of like Arvo!). This means that
75− many fields listed on the `node` table could instead be derived from analysis
76− of the `pki_event` table. The implementer will be responsible for determining
77− which fields should be represented on the `node` directly and which should be
78− determined from `pki_event` for performance purposes.
79−- We don't have data for comets or moons, because they're not registered on
80− Azimuth and `radar` only checks for activity from ships with keys that have
81− been set on Azimuth. There will likely be a future in which we'll have a way
82− to provide data about these ship types though.
83−
84−### Data Ingestion
85−
86−Data from Azimuth and `radar` will need to be regularly extracted, parsed, and
87−persisted to the local database for querying.
88−
89−For Azimuth, using a tool like [infura](https://infura.io) should be used.. Tlon
90−currently uses infura, so it should be possible to use a free account for
91−development and Tlon's pre-existing service in production.
92−
93−The output of the `radar` script is saved to a JSON file that can be found
94−[here](http://35.247.74.19:8080/~radar.json). This file is updated as new ping
95−information is obtained, so data ingestion from this service should happen on
96−some regular schedule.
97−
98−### API
99−
100−The following are are necessary API endpoints for the Network Explorer UI to
101−function properly. It's likely that some details have been missed, so apply your
102−own judgement when designing the API.
103−
104−This interface is meant to be agnostic to the API mechanism you choose, which
105−could be either REST or GraphQL.
106−
107−#### get-node
108−
109−Produce the details for a single node.
110−
111−**Parameters**
112−
113−- `urbit_id`: `@p`
114−
115−**Returns**
116−
117−- `urbit_id`: `@p`
118−- `node_type`: `#{galaxy,star,planet,moon,comet}`
119−- `status`: `#{locked,unlocked,spawned,activated,online}`
120−- `continuity`: `int`, current continuity
121−- `key_revision`: `int`, current revision of keys
122−- `num_owners`: `int`, number of owners
123−- `sponsors`: `[node]` (sponsor and sponsor's sponsor, if applicable)
124−- `kids`: `[node]` (nodes sponsored by this one)
125−- `proxy_addresses`:
126− - `ownership`
127− - `spawn`
128− - `transfer`
129− - `voting`
130− - `management`
131−
132−#### get-nodes
133−
134−Produce a list of nodes, optionally with parameters. Absence of parameters queries all nodes.
135−
136−**Parameters**
137−
138−- `q`: `string` (optional: query term to search for)
139−- `node_types`: `[node_type]` (optional: produce just events for specific node types)
140−- `limit`: `int` (number of results to return)
141−- `offset`: `int` (number of results to offset by)
142−
143−**Returns**
144−An array of `node` in ascending order by `point`.
145−
146−#### get-pki-events
147−
148−Produce the stream of PKI events for a specific Urbit ID, or globally in descending order of `time`.
149−
150−**Parameters**
151−
152−- `urbit_id`: `@p` (optional: unspecified implies global)
153−- `since`: `timestamp` (optional: unspecified implies all events)
154−- `node_types`: `[node_type]` (optional: produce just events for specific node types)
155−- `limit`: `int` (number of results to return)
156−- `offset`: `int` (number of results to offset by\*\*
157−
158−**Returns**
159−An array of `pki_event` in descending order of `time`.
160−
161−#### get-activity
162−
163−Produce the network activity of a node or nodes.
164−
165−**Parameters**
166−
167−- `urbit_id`: `@p` (optional: specific ship to pull activity for)
168−- `since`: `timestamp` (optional: activity since provided time)
169−- `until`: `timestamp` (optional: activity up until the provided time)
170−
171−If `urbit_id` is unspecified, implies all ships.
172−
173−If `since` and `until` are unspecified, produces all activity for all time. If
174−only `since` is provided, produces activity from `since` to the present. If only
175−`until` is provided, produces activity for all of time up until `until`. If both
176−are provided, queries activity within a range.
177−
178−**Returns**
179−Array of:
180−
181−- `urbit_id`: `@p`
182−- `date`: `date` (no time)
183−- `active`: `boolean` (active or inactive)
184−
185−### Technology Requirements/Guidelines
186−
187−That which is not explicitly specified here is up to the choice of the
188−implementer.
189−
190−- **Database**: PostgreSQL
191−- **Ethereum Interaction**: Infura
192−- **HTTP API methodology**: GraphQL or REST
193−- **ORM**: None. Implementer should be sufficiently familiar with SQL.
194−- **API Hosting**: The API will be hosted on `api.network.urbit.org` or
195− `network.urbit.org/api`.
196−
197−## Requirements
198−
199−- 2+ years of experience with developing HTTP APIs
200−- 2+ years of experience working with relational databases
201−- Code hosted at https://github.com/urbit/network-api
202−- Attend regular (weekly or bi-weekly) checkin meetings with the director of
203− urbit.org to provide status updates
204−
205−## Resources
206−
207−- A complete set of high-fidelity designs in Figma will be made available to the
208− worker.
209−- The director of urbit.org will ensure access to other resources or personnel
210− as needed.
211−
212−## Milestones
213−
214−### Data ETL
215−
216−2 stars
217−The database has been designed and data from both sources is ingested
218−(extracted, transformed and loaded) on a regular schedule. Analysis can be
219−performed at the database layer.
220−
221−### HTTP API
222−
223−2 stars
224−An HTTP API is written per the above specification and deployed to
225−`https://api.network.urbit.org`.
226−
227−### UI Integration
228−
229−1 star
230−The Network Explorer UI will be a separate proposal, but integration with an
231−interface inevitably surfaces oversights in the original design. An additional
232−star will be awarded for providing ongoing maintenance as-needed during
233−front-end integration.
content/grants/nuck-jet.md+1
@@ -13,6 +13,7 @@ reward = 1
1313mentor = "~timluc-miptev"
1414assignee = ""
1515completed = false
16+canceled = true
1617work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=B0035&prefill_Grant+Name=Nuck%20Jet"
1718+++
1819
content/grants/overhaul-the-urbitorg-website.md+1
@@ -13,6 +13,7 @@ reward = 6
1313assignee = "~radbur-sivmus"
1414id = "246698762"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/planet-sales.md+1
@@ -11,6 +11,7 @@ reward = 6
1111assignee = "~tacryt-socryp"
1212grant_id = "P0071"
1313completed = false
14+canceled = false
1415link = ""
1516+++
1617
content/grants/pokur.mdnew file+90
@@ -0,0 +1,90 @@
1++++
2+title = "Pokur: Texas Holdem on Urbit"
3+date = "2021-09-16"
4+[taxonomies]
5+grant_type = ["Proposal"]
6+grant_category = ["App Dev: Other"]
7+[extra]
8+image = ""
9+description = "Multiplayer Poker App on Urbit"
10+reward = 2
11+assignee = "~hodzod-walrus"
12+grant_id = "P0084"
13+completed = false
14+canceled = false
15+link = ""
16++++
17+
18+## Pokur: Texas Hold 'em on Urbit
19+
20+## Purpose
21+
22+The goal of this project is to release a multiplayer Poker app on Urbit. Most users understand Urbit as an excellent communication tool, but so far there are few apps which showcase Urbit’s full potential as a general networked OS. Games are an excellent way to introduce people to this, and poker’s turn-based gameplay is ideal for development on Urbit in its current state. This project will also lay the groundwork for future financial transactions on Urbit in the form of BTC wagering for cash games and tournaments. For now, though, this facet of the app will wait for future payment rails.
23+
24+## Background
25+
26+I was first motivated to build a game on Urbit after seeing ~ponrep build a chess app. I’m also a casual poker fan, so seeing it as a suggested apprenticeship project was great.
27+
28+I’ve spent the last several weeks working on an apprenticeship grant, which was extremely successful --I was able to become proficient in Hoon and app development using Gall. I now have a [basic poker app](https://github.com/benmcc100/pokur). There are several tasks required to get this program release-ready, and this grant is intended to cover that.
29+
30+## Implementation
31+
32+I intend to follow the same general structure of my apprenticeship app. Pokur exists as two Gall apps, a client and a server. While there exist fully-p2p algorithms for playing trustless poker, marking one ship as a server has many benefits for ease-of-play (notably turn timers), and remains an effective decentralized implementation of the game. Players can select a server of their choosing when creating a new game, or host a game themselves. When it comes to fairness, players are only required to trust the ship hosting the server. This model of trust is similar to someships acting as btc-providers, and the Urbit address space is well-designed for marking stars as high-trust nodes capable of providing services such as poker hosting.
33+
34+I’ve already implemented the basic game logic. There are a few edge cases that remain unresolved, notably the logic surrounding side pots in a situation with multiple all-ins. I’m aware of these issues and will be able to manage them easily. My primary development task is now to build on this basic logic to create tournament and cash game modes, and add useful features such as rule customization, invite management, and messaging in-game.I’ll probably need to refactor certain elements of my apprenticeship code. As I wrote it, I learned much more about Hoon, so older parts of the codebase arenaturally lower-quality. I’d like to rewrite these parts to make the app more extensible. Everything works in its current state, but I think this will allow me to more easily build the aforementioned features.
35+
36+One of the key reasons for this proposal is ensuring that Pokur can have an extended open beta process. I think this is a good way, as a solo developer, to ensure every in-game scenario is bug-free. This is critical if ships are to play for ‘real money’ in the future.
37+
38+For this reason I intend to release a beta version of Pokur that does not include BTC integration. After publicising the beta release, I hope to get lots of community feedback on gameplay, any bug reports, and use these to push improvements.
39+
40+## User Stories
41+
42+● As a user, I can create a newtable and specify the hosting server and the game rules (tournament/cash, buy-in, timers, etc.)
43+
44+● I can invite other users to play with me, who can then invite their friends before the game begins
45+
46+● Once in-game, I can play poker within the rules specified for the table, and concede if I so choose
47+
48+● If I install the Pokur server app, I can use it for my own games or invite others to use it for theirs
49+
50+● I can look at a history of the games I’ve played in
51+
52+## Milestones
53+
54+### Milestone 1 - Development & Polish
55+
56+Expected completion: Nov 2021
57+
58+Payment: 1 star
59+
60+● I’ll start by refactoring some elements of the codebase from my apprenticeship and fixing the known gameplay issues (main one is lack of proper side-pot logic).
61+
62+● Next I’ll polish the game, adding features including but not limited to:
63+
64+\* Tournament vs cash mode
65+
66+\* In-game turn timers
67+
68+\* Invite management (decline game invite, cancel invite, etc)
69+
70+\* Custom user-designed game rules (starting stack size, turn time limit, etc)
71+
72+\* In-game chat
73+
74+● Also included in ‘polish’ will be a cleaner and nicer looking UI.
75+
76+### Milestone 2: Release and testing
77+
78+Expected completion: 2022
79+
80+Payment: 1 star
81+
82+● Will begin by publicising the github repo to the Urbit community and dedicating a star to hosting a Pokur server for people to use. I will also host a group for installation help, organizing tournaments, reporting bugs, and generally encouraging the use of Pokur beta.
83+
84+● Pokur is also a prime candidate for an Urbit software distribution system. I will take any steps required to publish Pokur on that platform and hope to be one of the first independent apps available there.
85+
86+● Reward for this phase is to cover all maintenance and upgrades required to:
87+
88+\* Reveal latent gameplay bugs and fix them
89+
90+\* Ensure Pokur is available on any future Urbit software distribution platform(c)establish a Pokur-playing community on Urbit and maintain a Pokur server on a dedicated ship for at least a year or until at least 2 others are active.
content/grants/search-in-groups.md+1−1
@@ -12,7 +12,7 @@ description = "Implement a basic text search in groups channels"
1212reward = 2
1313assignee = "@nrtxrmnd"
1414id = "835369230"
15−completed = false
15+completed = true
1616link = ""
1717+++
1818
content/grants/slaw-scot-jets.md+1−1
@@ -11,7 +11,7 @@ image = ""
1111description = "Tune slaw/scot jets for better perfomance."
1212reward = 1
1313mentor = "~timluc-miptev"
14−assignee = ""
14+assignee = "~lagrev-nocfep"
1515completed = false
1616work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=B0042&prefill_Grant+Name=Tune%20slaw%2Fscot%20jets"
1717+++
content/grants/-smol-future-sustained-knowledge-sharing-and-marketing.md → content/grants/smol-future-sustained-knowledge-sharing-and-marketing.mdrenamed

The content is the same.

content/grants/speech-recognition.md+1
@@ -11,6 +11,7 @@ reward = 2
1111assignee = "~hosted-fornet"
1212grant_id = "P0053"
1313completed = false
14+canceled = false
1415link = ""
1516+++
1617
content/grants/translate-key-parts-of-urbitorg-into-german.md+1
@@ -13,6 +13,7 @@ reward = 1
1313assignee = "~hocdep-labtel"
1414id = "1163466965"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/translate-key-parts-of-urbitorg-into-korean.md+1
@@ -13,6 +13,7 @@ reward = 1
1313assignee = "~sibped-dabdul, 홍송이"
1414id = "1921641407"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/translate-key-parts-of-urbitorg-into-spanish.md+1
@@ -13,6 +13,7 @@ reward = 1
1313assignee = "Tom Holford"
1414id = "446864346"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/try-urbit-website.md+2−1
@@ -10,9 +10,10 @@ grant_category = [ "App Dev" ]
1010image = ""
1111description = "A website where prospective Martians can experience the Landscape interface without any technical chops."
1212reward = 2
13−assignee = "mikeosborne"
13+assignee = "~taller-ravnut"
1414id = "1413934727"
1515completed = false
16+canceled = true
1617link = ""
1718+++
1819
content/grants/ucal-google-and-outlook-integration.md+1
@@ -13,6 +13,7 @@ reward = 2
1313assignee = ""
1414id = ""
1515completed = false
16+canceled = false
1617work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=B0014&prefill_Grant+Name=ucal%20Google%20and%20Outlook%20Integration"
1718+++
1819
content/grants/urbian-a-customized-linux-distribution-for-urbit-appliances.md+1
@@ -13,6 +13,7 @@ reward = 2
1313assignee = "~botter-nidnul"
1414id = "337545546"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/urbit-community-concierge-east-coast-2q2021.md+2−1
@@ -12,7 +12,8 @@ description = "Provide concierge service assisting new users in the Urbit Commun
1212reward = 1
1313assignee = "tocrex"
1414id = "427340266"
15−completed = false
15+completed = true
16+canceled = false
1617link = ""
1718+++
1819
content/grants/urbit-community-concierge-east-coast.md+2−1
@@ -12,7 +12,8 @@ description = "Provide concierge service assisting new users in the Urbit Commun
1212reward = 1
1313assignee = "tocrex"
1414id = "928966814"
15−completed = false
15+completed = true
16+canceled = false
1617link = ""
1718+++
1819
content/grants/urbit-community-concierge-west-coast-2q2021.md+2−1
@@ -12,7 +12,8 @@ description = "Provide concierge service assisting new users in the Urbit Commun
1212reward = 1
1313assignee = "~sibhul-soctul"
1414id = "1693084001"
15−completed = false
15+completed = true
16+canceled = false
1617link = ""
1718+++
1819
content/grants/urbit-community-concierge-west-coast.md+2−1
@@ -12,7 +12,8 @@ description = "Provide concierge service assisting new users in the Urbit Commun
1212reward = 1
1313assignee = "~sibhul-soctul"
1414id = "669964979"
15−completed = false
15+completed = true
16+canceled = false
1617link = ""
1718+++
1819
content/grants/urbit-event-series.md+1
@@ -13,6 +13,7 @@ reward = 6
1313assignee = "~naplet-hildec"
1414id = "1751024973"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/urbit-explainer-video.md+1
@@ -13,6 +13,7 @@ reward = 2
1313assignee = "~rivpyl-sidfyl, ~minder-folden"
1414id = "1350087489"
1515completed = true
16+canceled = false
1617link = ""
1718+++
1819
content/grants/urbit-http-api-for-emacs-elisp.md+1
@@ -13,6 +13,7 @@ reward = 3
1313assignee = "~winduc-dozser"
1414id = "1206158911"
1515completed = false
16+canceled = true
1617link = ""
1718+++
1819
content/grants/urbit-http-api-for-kotlin.md+1
@@ -13,6 +13,7 @@ reward = 3
1313assignee = "@nrtxrmnd"
1414id = "865786150"
1515completed = false
16+canceled = true
1617link = ""
1718+++
1819
content/grants/urbit-http-api-for-python.md+1
@@ -13,6 +13,7 @@ reward = 1
1313assignee = "novbyr-miclux"
1414id = "P0029"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/urbit-http-api-for-rust.md+1
@@ -13,6 +13,7 @@ reward = 3
1313assignee = "~mocrux-nomdep"
1414id = "1120978319"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/urbit-http-interface-java-edition.md+1
@@ -13,6 +13,7 @@ reward = 3
1313assignee = "~sipfyn-pidmex"
1414id = "288224550"
1515completed = false
16+canceled = true
1617link = ""
1718+++
1819
content/grants/urbit-http-library-for-ruby.md+1
@@ -13,6 +13,7 @@ reward = 3
1313assignee = "~winter-paches"
1414id = "227255220"
1515completed = false
16+canceled = true
1617link = ""
1718+++
1819
content/grants/urbit-irc-bridge.md+1
@@ -13,6 +13,7 @@ reward = 1
1313assignee = "~fitnub-basbud"
1414id = ""
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/urbit-lfs-filehosting.md+1
@@ -13,6 +13,7 @@ reward = 4
1313assignee = "tabnus-fondeg"
1414id = "1736585775"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/urbit-react-cookbook.md+1
@@ -13,6 +13,7 @@ reward = 3
1313assignee = "~witfyl-ravped"
1414id = "1312404336"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/video-content-manager.md+1
@@ -13,6 +13,7 @@ reward = 3
1313assignee = "~wolnyl-pasreg"
1414id = "790269488"
1515completed = false
16+canceled = false
1617link = ""
1718+++
1819
content/grants/volt-lightning-on-urbit.md+1
@@ -12,6 +12,7 @@ description = "An Urbit-native Lightning client and integration with `lnd` on 'p
1212reward = 7
1313assignee = "~martyr-binbex, ~dasrun-fadben"
1414completed = false
15+canceled = false
1516link = ""
1617+++
1718
content/grants/webrtc-gall-agent-and-external-app.md+15−17

This diff is too big to show here.

content/grants/webrtc.mddeleted−80

This diff is too big to show here.

lib/glossary.js+665−532

This diff is too big to show here.

next.config.js−8

This diff is too big to show here.

package-lock.json+865−3153

This diff is too big to show here.

package.json+1−5

This diff is too big to show here.

pages/events.js+15−4

This diff is too big to show here.

pages/events/[slug].js+2−2

This diff is too big to show here.

pages/index.js+11−6

This diff is too big to show here.

yarn.lockdeleted−1865

This diff is too big to show here.