@@ -59,6 +59,97 @@ Irregular: `:(add a b c)` is `;:(add a b c)`.
64+`[%mcgl p=spec q=hoon r=hoon s=hoon]`: monadic do notation.
71+;< mold=mold bind=hoon expr1=hoon expr2=hoon
76+A `;<` is for sequencing two computations, `expr1` and `expr2`, using a provided
77+implementation of monadic bind. This rune takes a gate `bind` which takes a mold
78+`mold` and produces an implementation of monadic bind.
92+`;<` is much like Haskell `do` notation. You have a sequence of events you'd
93+like to run such that each past the first depends on the output of the previous
94+one. The output of the previous one may not be of the correct type to use as an
95+input to the next one, and so an adapter such as `+bind` or `+biff` is needed.
97+`;<` differs from [`;~`](#micsig) in that it takes a gate which takes a mold
98+that produces an implementation of monadic bind, rather than taking an
99+implementation of monadic bind directly.
101+`;<` can be used to glue a pipeline together to run an asynchronous function or event. This can be helpful when deferring parts of a computation based on external data.
103+We remark that you can switch binds in the middle of a sequence of `;<`.
107+[`+biff`](@/docs/hoon/reference/stdlib/2a/#biff) is the unit monad's
108+implementation of monadic bind. That is to say, it takes a unit `a` and a gate
109+`b` that accepts a noun that produces a unit, and extracts the value from `a` to
110+pass as a sample to `b`. [`+bind`](@/docs/hoon/reference/stdlib/2a/#bind) takes
111+a unit `a` and a gate `b` that neither accepts nor produces a unit, and applies
112+`b` to the value of `a` and produces a unit. Note that if you do pass `+bind` a
113+gate that produces a unit, `+bind` will treat it as though it does not.
115+We illustrate the usage of `;<`, `+biff`, and `+bind` with a `map` of atoms.
117+~zod:dojo> =m (my ~[[1 3] [2 2] [3 1]])
121+A single usage of `;<` only serves to apply the binding function to the output
124+~zod:dojo> ;< a=@ _bind (~(get by m) 1)
127+~zod:dojo> ;< a=@ _biff (~(get by m) 1)
131+Here we see the results of chaining them together:
133+~zod:dojo> ;< a=@ _biff (~(get by m) 1)
134+ ;< b=@ _biff (~(get by m) a)
137+~zod:dojo> ;< a=@ _bind (~(get by m) 1)
138+ ;< b=@ _biff (~(get by m) a)
141+~zod:dojo> ;< a=@ _biff (~(get by m) 1)
142+ ;< b=@ _bind (~(get by m) a)
145+~zod:dojo> ;< a=@ _bind (~(get by m) 1)
146+ ;< b=@ _bind (~(get by m) a)
62### `;+` "miclus"
153### `;+` "miclus"
64make a single XML node (Sail)
155make a single XML node (Sail)