on master help sign in
fixed molds doc
e2f2b27David Kerschner
learn/hoon/hoon-tutorial/molds.md+4−4
@@ -1,11 +1,10 @@
1+++
1+++
2−title = "Molds"
2+title = "2.3.1 Molds"
3−weight = 0
3+weight = 28
4template = "doc.html"
4template = "doc.html"
5+++
5+++
6
6
7−A mold is a
7+A mold is a function that coerces a noun to a type or crashes.
8−[//]: # (You should finish this thought :P)
9
8
10Let's take some examples from `hoon.hoon`. `|$` is a new rune as of the writing of this document so you may see this spelled in slightly different way if you don't have the latest version of `hoon.hoon`. `|$` is the mold builder rune which takes a list of molds and produces a mold.
9Let's take some examples from `hoon.hoon`. `|$` is a new rune as of the writing of this document so you may see this spelled in slightly different way if you don't have the latest version of `hoon.hoon`. `|$` is the mold builder rune which takes a list of molds and produces a mold.
11
10
@@ -14,6 +13,7 @@ Let's take some examples from `hoon.hoon`. `|$` is a new rune as of the writing
14 |$ [head tail]
13 |$ [head tail]
15 [p=head q=tail]
14 [p=head q=tail]
16```
15```
16+
17Here is a very simple mold builder. It takes two molds and produces a mold that is a pair of those with the faces `p` and `q`. An example of using this would be `(pair @ud @ud)` which would produce a mold for a cell of `@ud` and `@ud`.
17Here is a very simple mold builder. It takes two molds and produces a mold that is a pair of those with the faces `p` and `q`. An example of using this would be `(pair @ud @ud)` which would produce a mold for a cell of `@ud` and `@ud`.
18
18
19```
19```