on master help sign in
adds expansions for :dip / ;~
commit29ed50092a4984a38f97f9da74b2bad4a39c2d75 authorJoseph Bryan <joemfb@gmail.com> dateThu 20 Jul 2017, 00:02 (9 years ago) parentc96ea9c
1 file changed+34
docs/hoon/twig/sem-make/sig-dip.md+34
docs/hoon/twig/sem-make/sig-dip.md+34
@@ -13,6 +13,40 @@ product-sample adapter.
1313The gates in `q` connected together using the gate `p`, which
1414transforms a `q` product and a `q` gate into a `q` sample.
1515
16+## Expands to
17+
18+*Note: these are structurally correct, but elide some type-system complexity.*
19+
20+`;~(a b)` reduces to `b`.
21+
22+`;~(a b c)` expands to
23+
24+```
25+|= arg/*
26+(a (b arg) c(+6 arg))
27+```
28+
29+`;~(a b c d)` expands to
30+
31+```
32+|= arg/*
33+%+ a (b arg)
34+=+ arg=arg
35+|. (a (c arg) d(+6 arg))
36+```
37+
38+### Compiler macro
39+
40+```
41+?~ q !!
42+|-
43+?~ t.q i.q
44+=/ a $(q t.q)
45+=/ b i.q
46+=/ c ,.+6.b
47+|. (p (b c) a(,.+6 c))
48+```
49+
1650## Discussion
1751
1852Apparently `:dip` is a "Kleisli arrow." Whatevs. It's also