on 5e6a67f help sign in
42 lines 612 B history raw
1### `++bond`
3Replace null
5Replaces an empty ++unit `b` with the product of a called trap
6`a`. If the unit is not empty, then the original unit is produced.
8Accepts
9-------
11`a` is a trap.
13`b` is a unit.
15Produces
16--------
18Either the product of `a` or the value inside of unit `b`.
20Source
21------
23 ++ bond :: replace
24 |* a/(trap)
25 |* b/(unit)
26 ?~ b $:a
27 u.b
30Examples
31--------
33 ~zod/try=> (bex 10)
34 1.024
35 ~zod/try=> ((bond |.((bex 10))) ~)
36 1.024
37 ~zod/try=> ((bond |.((bex 10))) (slaw %ud '123'))
38 123
42***