1// @inline export traverseFun1 arity=1
2// @inline export rewriteBottomUpM arity=1
3import * as $runtime from "../runtime.js";
4const $Fun = (tag, _1, _2) => ({tag, _1, _2});
5const Abs = value0 => value1 => $Fun("Abs", value0, value1);
6const App = value0 => value1 => $Fun("App", value0, value1);
7const traverseFun1 = dictApplicative => {
8 const Apply0 = dictApplicative.Apply0();
9 const $0 = Apply0.Functor0();
11 if (v.tag === "Abs") { return $0.map(Abs(v._1))(k(v._2)); }
12 if (v.tag === "App") { return Apply0.apply($0.map(App)(k(v._1)))(k(v._2)); }
16const rewriteBottomUpM = dictMonad => {
17 const Apply0 = dictMonad.Applicative0().Apply0();
18 const $0 = Apply0.Functor0();
19 const $1 = dictMonad.Bind1();
22 if (a.tag === "Abs") { return $0.map(Abs(a._1))($1.bind(go(a._2))(k)); }
23 if (a.tag === "App") { return Apply0.apply($0.map(App)($1.bind(go(a._1))(k)))($1.bind(go(a._2))(k)); }
26 return a => $1.bind(go(a))(k);
29const rewriteBottomUp = k => {
31 if (a.tag === "Abs") { return $Fun("Abs", a._1, k(go(a._2))); }
32 if (a.tag === "App") { return $Fun("App", k(go(a._1)), k(go(a._2))); }
37export {$Fun, Abs, App, rewriteBottomUp, rewriteBottomUpM, traverseFun1};
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list