diff --git a/argocd/base/statefulset.yaml b/argocd/base/statefulset.yaml index 1d6f5727..71857abe 100644 --- a/argocd/base/statefulset.yaml +++ b/argocd/base/statefulset.yaml @@ -26,7 +26,7 @@ spec: # Note: use the *dev* version of the package here, so that # PRs can deploy `primer-service` container images that have # not yet been merged to `primer` `main`. - image: ghcr.io/hackworthltd/primer-service-dev:git-e8e9f14d326e82e0814a79185a1246327abc62f7 + image: ghcr.io/hackworthltd/primer-service-dev:git-4a105b7c084cdbf599acb2bc5bb9283d0eae46ff ports: - containerPort: 8081 env: diff --git a/flake.lock b/flake.lock index 5e979332..1b19b10d 100644 --- a/flake.lock +++ b/flake.lock @@ -1407,17 +1407,17 @@ "pre-commit-hooks-nix": "pre-commit-hooks-nix_4" }, "locked": { - "lastModified": 1700649959, - "narHash": "sha256-DDPIT5oP63llnI9vjUi2VSVAOf5a96xW+FuzPzifmZ8=", + "lastModified": 1700667305, + "narHash": "sha256-C6BTQ6G7m6fqqN0wMkG0ApZdoXNd+zO1xDvXkWTSIsY=", "owner": "hackworthltd", "repo": "primer", - "rev": "e8e9f14d326e82e0814a79185a1246327abc62f7", + "rev": "4a105b7c084cdbf599acb2bc5bb9283d0eae46ff", "type": "github" }, "original": { "owner": "hackworthltd", "repo": "primer", - "rev": "e8e9f14d326e82e0814a79185a1246327abc62f7", + "rev": "4a105b7c084cdbf599acb2bc5bb9283d0eae46ff", "type": "github" } }, diff --git a/flake.nix b/flake.nix index dccd0f34..ea06eb7f 100644 --- a/flake.nix +++ b/flake.nix @@ -19,7 +19,7 @@ # Note: don't override any of primer's Nix flake inputs, or else # we won't hit its binary cache. - primer.url = github:hackworthltd/primer/e8e9f14d326e82e0814a79185a1246327abc62f7; + primer.url = github:hackworthltd/primer/4a105b7c084cdbf599acb2bc5bb9283d0eae46ff; flake-parts.url = "github:hercules-ci/flake-parts"; }; diff --git a/src/components/TreeReactFlow/TreeReactFlow.stories.tsx b/src/components/TreeReactFlow/TreeReactFlow.stories.tsx index 910a4937..032b58fd 100644 --- a/src/components/TreeReactFlow/TreeReactFlow.stories.tsx +++ b/src/components/TreeReactFlow/TreeReactFlow.stories.tsx @@ -93,25 +93,37 @@ const typeDef1: TypeDef = { nodeId: "1111", childTrees: [ { - body: { tag: "NoBody", contents: "KType" }, - nodeId: "1112", - childTrees: [], + fst: "FunIn", + snd: { + body: { tag: "NoBody", contents: "KType" }, + nodeId: "1112", + childTrees: [], + }, }, { - body: { tag: "NoBody", contents: "KFun" }, - nodeId: "1113", - childTrees: [ - { - body: { tag: "NoBody", contents: "KHole" }, - nodeId: "1114", - childTrees: [], - }, - { - body: { tag: "NoBody", contents: "KType" }, - nodeId: "1115", - childTrees: [], - }, - ], + fst: "FunOut", + snd: { + body: { tag: "NoBody", contents: "KFun" }, + nodeId: "1113", + childTrees: [ + { + fst: "FunIn", + snd: { + body: { tag: "NoBody", contents: "KHole" }, + nodeId: "1114", + childTrees: [], + }, + }, + { + fst: "FunOut", + snd: { + body: { tag: "NoBody", contents: "KType" }, + nodeId: "1115", + childTrees: [], + }, + }, + ], + }, }, ], }, @@ -142,43 +154,55 @@ const typeDef1: TypeDef = { body: { tag: "NoBody", contents: "TApp" }, childTrees: [ { - nodeId: "1102", - body: { tag: "NoBody", contents: "TApp" }, - childTrees: [ - { - nodeId: "1103", - body: { - tag: "TextBody", - contents: { - fst: "TVar", - snd: { baseName: "b" }, + fst: "AppFun", + snd: { + nodeId: "1102", + body: { tag: "NoBody", contents: "TApp" }, + childTrees: [ + { + fst: "AppFun", + snd: { + nodeId: "1103", + body: { + tag: "TextBody", + contents: { + fst: "TVar", + snd: { baseName: "b" }, + }, + }, + childTrees: [], }, }, - childTrees: [], - }, - { - nodeId: "1104", - body: { - tag: "TextBody", - contents: { - fst: "TCon", - snd: { baseName: "Bool" }, + { + fst: "AppArg", + snd: { + nodeId: "1104", + body: { + tag: "TextBody", + contents: { + fst: "TCon", + snd: { baseName: "Bool" }, + }, + }, + childTrees: [], }, }, - childTrees: [], - }, - ], + ], + }, }, { - nodeId: "1105", - body: { - tag: "TextBody", - contents: { - fst: "TCon", - snd: { baseName: "Pair" }, + fst: "AppArg", + snd: { + nodeId: "1105", + body: { + tag: "TextBody", + contents: { + fst: "TCon", + snd: { baseName: "Pair" }, + }, }, + childTrees: [], }, - childTrees: [], }, ], }, diff --git a/src/components/TreeReactFlow/index.tsx b/src/components/TreeReactFlow/index.tsx index f2500f7c..3872fd80 100644 --- a/src/components/TreeReactFlow/index.tsx +++ b/src/components/TreeReactFlow/index.tsx @@ -523,14 +523,14 @@ const augmentTree = async ( f: (tree: APITreeNode) => Promise<[T, (child: T, isRight: boolean) => E]> ): Promise> => { const childTrees = await Promise.all( - tree.childTrees.map((t) => augmentTree(t, f)) + tree.childTrees.map((t) => augmentTree(t.snd, f)) ); const [node, makeEdge] = await f({ children: tree.childTrees.length + (tree.rightChild ? 1 : 0), ...tree, }); const rightChild = await (tree.rightChild - ? augmentTree(tree.rightChild, f) + ? augmentTree(tree.rightChild.snd, f) : undefined); return { ...(rightChild diff --git a/src/components/examples/trees.ts b/src/components/examples/trees.ts index b5148d3f..df859108 100644 --- a/src/components/examples/trees.ts +++ b/src/components/examples/trees.ts @@ -17,12 +17,15 @@ export const tree2: Tree = { body: { tag: "TextBody", contents: { fst: "Lam", snd: { baseName: "x" } } }, childTrees: [ { - body: { - tag: "TextBody", - contents: { fst: "LocalVar", snd: { baseName: "x" } }, + fst: "Hole", + snd: { + body: { + tag: "TextBody", + contents: { fst: "LocalVar", snd: { baseName: "x" } }, + }, + childTrees: [], + nodeId: "201", }, - childTrees: [], - nodeId: "201", }, ], nodeId: "200", @@ -35,12 +38,15 @@ export const tree3: Tree = { }, childTrees: [ { - body: { - tag: "TextBody", - contents: { fst: "LocalVar", snd: { baseName: "y" } }, + fst: "Hole", + snd: { + body: { + tag: "TextBody", + contents: { fst: "LocalVar", snd: { baseName: "y" } }, + }, + childTrees: [], + nodeId: "301", }, - childTrees: [], - nodeId: "301", }, ], nodeId: "300", @@ -50,75 +56,105 @@ export const tree4: Tree = { body: { tag: "NoBody", contents: "App" }, childTrees: [ { - body: { tag: "NoBody", contents: "Ann" }, - childTrees: [ - { - body: { - tag: "TextBody", - contents: { fst: "LAM", snd: { baseName: "a" } }, - }, - childTrees: [ - { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "Ann" }, + childTrees: [ + { + fst: "Hole", + snd: { body: { tag: "TextBody", - contents: { fst: "Lam", snd: { baseName: "x" } }, + contents: { fst: "LAM", snd: { baseName: "a" } }, }, childTrees: [ { - body: { - tag: "TextBody", - contents: { fst: "LocalVar", snd: { baseName: "x" } }, + fst: "Hole", + snd: { + body: { + tag: "TextBody", + contents: { fst: "Lam", snd: { baseName: "x" } }, + }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + tag: "TextBody", + contents: { + fst: "LocalVar", + snd: { baseName: "x" }, + }, + }, + childTrees: [], + nodeId: "404", + }, + }, + ], + nodeId: "403", }, - childTrees: [], - nodeId: "404", }, ], - nodeId: "403", + nodeId: "402", }, - ], - nodeId: "402", - }, - { - body: { - tag: "TextBody", - contents: { fst: "TForall", snd: { baseName: "a" } }, }, - childTrees: [ - { - body: { tag: "NoBody", contents: "TFun" }, + { + fst: "Hole", + snd: { + body: { + tag: "TextBody", + contents: { fst: "TForall", snd: { baseName: "a" } }, + }, childTrees: [ { - body: { - tag: "TextBody", - contents: { fst: "TVar", snd: { baseName: "a" } }, - }, - childTrees: [], - nodeId: "407", - }, - { - body: { - tag: "TextBody", - contents: { fst: "TVar", snd: { baseName: "a" } }, + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "TFun" }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + tag: "TextBody", + contents: { fst: "TVar", snd: { baseName: "a" } }, + }, + childTrees: [], + nodeId: "407", + }, + }, + { + fst: "Hole", + snd: { + body: { + tag: "TextBody", + contents: { fst: "TVar", snd: { baseName: "a" } }, + }, + childTrees: [], + nodeId: "408", + }, + }, + ], + nodeId: "406", }, - childTrees: [], - nodeId: "408", }, ], - nodeId: "406", + nodeId: "405", }, - ], - nodeId: "405", - }, - ], - nodeId: "401", + }, + ], + nodeId: "401", + }, }, { - body: { - tag: "TextBody", - contents: { fst: "Con", snd: { baseName: "Unit" } }, + fst: "Hole", + snd: { + body: { + tag: "TextBody", + contents: { fst: "Con", snd: { baseName: "Unit" } }, + }, + childTrees: [], + nodeId: "409", }, - childTrees: [], - nodeId: "409", }, ], nodeId: "400", @@ -131,28 +167,40 @@ export const tree5: Tree = { }, childTrees: [ { - body: { tag: "NoBody", contents: "Case" }, - childTrees: [ - { - body: { - tag: "TextBody", - contents: { fst: "LocalVar", snd: { baseName: "x" } }, + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "Case" }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + tag: "TextBody", + contents: { fst: "LocalVar", snd: { baseName: "x" } }, + }, + childTrees: [], + nodeId: "502", + }, }, - childTrees: [], - nodeId: "502", - }, - { - body: { tag: "NoBody", contents: "EmptyHole" }, - childTrees: [], - nodeId: "503", - }, - { - body: { tag: "NoBody", contents: "EmptyHole" }, - childTrees: [], - nodeId: "506", - }, - ], - nodeId: "501", + { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "EmptyHole" }, + childTrees: [], + nodeId: "503", + }, + }, + { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "EmptyHole" }, + childTrees: [], + nodeId: "506", + }, + }, + ], + nodeId: "501", + }, }, ], nodeId: "500", @@ -168,31 +216,43 @@ export const tree6: Tree = { }, childTrees: [ { - body: { tag: "NoBody", contents: "Case" }, - childTrees: [ - { - body: { - tag: "TextBody", - contents: { - fst: "LocalVar", - snd: { baseName: "a very very very long variable name" }, + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "Case" }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + tag: "TextBody", + contents: { + fst: "LocalVar", + snd: { baseName: "a very very very long variable name" }, + }, + }, + childTrees: [], + nodeId: "602", }, }, - childTrees: [], - nodeId: "602", - }, - { - body: { tag: "NoBody", contents: "EmptyHole" }, - childTrees: [], - nodeId: "603", - }, - { - body: { tag: "NoBody", contents: "EmptyHole" }, - childTrees: [], - nodeId: "606", - }, - ], - nodeId: "601", + { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "EmptyHole" }, + childTrees: [], + nodeId: "603", + }, + }, + { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "EmptyHole" }, + childTrees: [], + nodeId: "606", + }, + }, + ], + nodeId: "601", + }, }, ], nodeId: "600", @@ -208,136 +268,169 @@ export const oddEvenTrees: [string, Tree][] = [ }, childTrees: [ { - body: { tag: "NoBody", contents: "Case" }, - childTrees: [ - { - body: { - contents: { fst: "LocalVar", snd: { baseName: "x" } }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "5", - }, - { - body: { tag: "NoBody", contents: "CaseWith" }, - childTrees: [ - { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "Case" }, + childTrees: [ + { + fst: "Hole", + snd: { body: { - contents: { - fst: "Pattern", + contents: { fst: "LocalVar", snd: { baseName: "x" } }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "5", + }, + }, + { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "CaseWith" }, + childTrees: [ + { + fst: "Hole", snd: { body: { contents: { - fst: "PatternCon", + fst: "Pattern", snd: { - baseName: "Zero", - qualifiedModule: ["Builtins"], + body: { + contents: { + fst: "PatternCon", + snd: { + baseName: "Zero", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "4P0B", }, }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "4P0B", - }, - }, - tag: "BoxBody", - }, - childTrees: [ - { - body: { - contents: { - fst: "Con", - snd: { - baseName: "True", - qualifiedModule: ["Builtins"], - }, + tag: "BoxBody", }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "6", - }, - ], - nodeId: "4P0", - }, - { - body: { - contents: { - fst: "Pattern", - snd: { - body: { tag: "NoBody", contents: "App" }, childTrees: [ { - body: { - contents: { - fst: "PatternCon", - snd: { - baseName: "Succ", - qualifiedModule: ["Builtins"], + fst: "Hole", + snd: { + body: { + contents: { + fst: "Con", + snd: { + baseName: "True", + qualifiedModule: ["Builtins"], + }, }, + tag: "TextBody", }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "4P1B", - }, - { - body: { - contents: { - fst: "PatternBind", - snd: { baseName: "n" }, - }, - tag: "TextBody", + childTrees: [], + nodeId: "6", }, - childTrees: [], - nodeId: "7", }, ], - nodeId: "7A", + nodeId: "4P0", }, }, - tag: "BoxBody", - }, - childTrees: [ { - body: { tag: "NoBody", contents: "App" }, - childTrees: [ - { - body: { - contents: { - fst: "GlobalVar", - snd: { - baseName: "odd", - qualifiedModule: ["Even3"], - }, + fst: "Hole", + snd: { + body: { + contents: { + fst: "Pattern", + snd: { + body: { tag: "NoBody", contents: "App" }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "PatternCon", + snd: { + baseName: "Succ", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "4P1B", + }, + }, + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "PatternBind", + snd: { baseName: "n" }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "7", + }, + }, + ], + nodeId: "7A", }, - tag: "TextBody", }, - childTrees: [], - nodeId: "9", + tag: "BoxBody", }, - { - body: { - contents: { - fst: "LocalVar", - snd: { baseName: "n" }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "App" }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "GlobalVar", + snd: { + baseName: "odd", + qualifiedModule: ["Even3"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "9", + }, + }, + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "LocalVar", + snd: { baseName: "n" }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "10", + }, + }, + ], + nodeId: "8", }, - tag: "TextBody", }, - childTrees: [], - nodeId: "10", - }, - ], - nodeId: "8", + ], + nodeId: "4P1", + }, }, ], - nodeId: "4P1", + nodeId: "4W", }, - ], - nodeId: "4W", - }, - ], - nodeId: "4", + }, + ], + nodeId: "4", + }, }, ], nodeId: "3", @@ -349,86 +442,110 @@ export const oddEvenTrees: [string, Tree][] = [ body: { tag: "NoBody", contents: "App" }, childTrees: [ { - body: { - contents: { - fst: "GlobalVar", - snd: { baseName: "even", qualifiedModule: ["Even3"] }, + fst: "Hole", + snd: { + body: { + contents: { + fst: "GlobalVar", + snd: { baseName: "even", qualifiedModule: ["Even3"] }, + }, + tag: "TextBody", }, - tag: "TextBody", + childTrees: [], + nodeId: "24", }, - childTrees: [], - nodeId: "24", }, { - body: { tag: "NoBody", contents: "App" }, - childTrees: [ - { - body: { - contents: { - fst: "Con", - snd: { baseName: "Succ", qualifiedModule: ["Builtins"] }, - }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "26", - }, - { - body: { tag: "NoBody", contents: "App" }, - childTrees: [ - { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "App" }, + childTrees: [ + { + fst: "Hole", + snd: { body: { contents: { fst: "Con", - snd: { - baseName: "Succ", - qualifiedModule: ["Builtins"], - }, + snd: { baseName: "Succ", qualifiedModule: ["Builtins"] }, }, tag: "TextBody", }, childTrees: [], - nodeId: "28", + nodeId: "26", }, - { + }, + { + fst: "Hole", + snd: { body: { tag: "NoBody", contents: "App" }, childTrees: [ { - body: { - contents: { - fst: "Con", - snd: { - baseName: "Succ", - qualifiedModule: ["Builtins"], + fst: "Hole", + snd: { + body: { + contents: { + fst: "Con", + snd: { + baseName: "Succ", + qualifiedModule: ["Builtins"], + }, }, + tag: "TextBody", }, - tag: "TextBody", + childTrees: [], + nodeId: "28", }, - childTrees: [], - nodeId: "30", }, { - body: { - contents: { - fst: "Con", - snd: { - baseName: "Zero", - qualifiedModule: ["Builtins"], + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "App" }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "Con", + snd: { + baseName: "Succ", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "30", + }, }, - }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "31", + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "Con", + snd: { + baseName: "Zero", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "31", + }, + }, + ], + nodeId: "29", + }, }, ], - nodeId: "29", + nodeId: "27", }, - ], - nodeId: "27", - }, - ], - nodeId: "25", + }, + ], + nodeId: "25", + }, }, ], nodeId: "23", @@ -443,131 +560,161 @@ export const oddEvenTrees: [string, Tree][] = [ }, childTrees: [ { - body: { tag: "NoBody", contents: "Case" }, - childTrees: [ - { - body: { - contents: { fst: "LocalVar", snd: { baseName: "x" } }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "16", - }, - { - body: { tag: "NoBody", contents: "CaseWith" }, - childTrees: [ - { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "Case" }, + childTrees: [ + { + fst: "Hole", + snd: { body: { - contents: { - fst: "Pattern", - snd: { - body: { - contents: { - fst: "PatternCon", - snd: { - baseName: "Zero", - qualifiedModule: ["Builtins"], - }, - }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "15P0B", - }, - }, - tag: "BoxBody", + contents: { fst: "LocalVar", snd: { baseName: "x" } }, + tag: "TextBody", }, + childTrees: [], + nodeId: "16", + }, + }, + { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "CaseWith" }, childTrees: [ { - body: { - contents: { - fst: "Con", - snd: { - baseName: "False", - qualifiedModule: ["Builtins"], - }, - }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "17", - }, - ], - nodeId: "15P0", - }, - { - body: { - contents: { - fst: "Pattern", + fst: "Hole", snd: { body: { contents: { - fst: "PatternCon", + fst: "Pattern", snd: { - baseName: "Succ", - qualifiedModule: ["Builtins"], + body: { + contents: { + fst: "PatternCon", + snd: { + baseName: "Zero", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "15P0B", }, }, - tag: "TextBody", + tag: "BoxBody", }, childTrees: [ { - body: { - contents: { - fst: "PatternBind", - snd: { baseName: "n" }, + fst: "Hole", + snd: { + body: { + contents: { + fst: "Con", + snd: { + baseName: "False", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", }, - tag: "TextBody", + childTrees: [], + nodeId: "17", }, - childTrees: [], - nodeId: "18", }, ], - nodeId: "15P1B", + nodeId: "15P0", }, }, - tag: "BoxBody", - }, - childTrees: [ { - body: { tag: "NoBody", contents: "App" }, - childTrees: [ - { - body: { - contents: { - fst: "GlobalVar", - snd: { - baseName: "even", - qualifiedModule: ["Even3"], + fst: "Hole", + snd: { + body: { + contents: { + fst: "Pattern", + snd: { + body: { + contents: { + fst: "PatternCon", + snd: { + baseName: "Succ", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "PatternBind", + snd: { baseName: "n" }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "18", + }, + }, + ], + nodeId: "15P1B", }, - tag: "TextBody", }, - childTrees: [], - nodeId: "20", + tag: "BoxBody", }, - { - body: { - contents: { - fst: "LocalVar", - snd: { baseName: "n" }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "App" }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "GlobalVar", + snd: { + baseName: "even", + qualifiedModule: ["Even3"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "20", + }, + }, + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "LocalVar", + snd: { baseName: "n" }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "21", + }, + }, + ], + nodeId: "19", }, - tag: "TextBody", }, - childTrees: [], - nodeId: "21", - }, - ], - nodeId: "19", + ], + nodeId: "15P1", + }, }, ], - nodeId: "15P1", + nodeId: "15W", }, - ], - nodeId: "15W", - }, - ], - nodeId: "15", + }, + ], + nodeId: "15", + }, }, ], nodeId: "14", @@ -585,117 +732,150 @@ export const oddEvenTreesMiscStyles: [string, Tree][] = [ }, childTrees: [ { - body: { tag: "NoBody", contents: "Case" }, - childTrees: [ - { - body: { - contents: { fst: "LocalVar", snd: { baseName: "x" } }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "5", - }, - ], - nodeId: "4", - rightChild: { - body: { - contents: { - fst: "Pattern", + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "Case" }, + childTrees: [ + { + fst: "Hole", snd: { body: { - contents: { - fst: "PatternCon", - snd: { - baseName: "Zero", - qualifiedModule: ["Builtins"], - }, - }, + contents: { fst: "LocalVar", snd: { baseName: "x" } }, tag: "TextBody", }, childTrees: [], - nodeId: "4P0B", - }, - }, - tag: "BoxBody", - }, - childTrees: [ - { - body: { - contents: { - fst: "Con", - snd: { baseName: "True", qualifiedModule: ["Builtins"] }, - }, - tag: "TextBody", + nodeId: "5", }, - childTrees: [], - nodeId: "6", }, ], - nodeId: "4P0", + nodeId: "4", rightChild: { - body: { - contents: { - fst: "Pattern", - snd: { - body: { - contents: { - fst: "PatternCon", - snd: { - baseName: "Succ", - qualifiedModule: ["Builtins"], - }, - }, - tag: "TextBody", - }, - childTrees: [ - { - body: { - contents: { - fst: "PatternBind", - snd: { baseName: "n" }, + fst: "Hole", + snd: { + body: { + contents: { + fst: "Pattern", + snd: { + body: { + contents: { + fst: "PatternCon", + snd: { + baseName: "Zero", + qualifiedModule: ["Builtins"], }, - tag: "TextBody", }, - childTrees: [], - nodeId: "7", + tag: "TextBody", }, - ], - nodeId: "4P1B", + childTrees: [], + nodeId: "4P0B", + }, }, + tag: "BoxBody", }, - tag: "BoxBody", - }, - childTrees: [ - { - body: { tag: "NoBody", contents: "App" }, - childTrees: [ - { + childTrees: [ + { + fst: "Hole", + snd: { body: { contents: { - fst: "GlobalVar", + fst: "Con", snd: { - baseName: "odd", - qualifiedModule: ["Even3"], + baseName: "True", + qualifiedModule: ["Builtins"], }, }, tag: "TextBody", }, childTrees: [], - nodeId: "9", + nodeId: "6", }, - { - body: { - contents: { fst: "LocalVar", snd: { baseName: "n" } }, - tag: "TextBody", + }, + ], + nodeId: "4P0", + rightChild: { + fst: "Hole", + snd: { + body: { + contents: { + fst: "Pattern", + snd: { + body: { + contents: { + fst: "PatternCon", + snd: { + baseName: "Succ", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", + }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "PatternBind", + snd: { baseName: "n" }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "7", + }, + }, + ], + nodeId: "4P1B", + }, }, - childTrees: [], - nodeId: "10", + tag: "BoxBody", }, - ], - nodeId: "8", + childTrees: [ + { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "App" }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "GlobalVar", + snd: { + baseName: "odd", + qualifiedModule: ["Even3"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "9", + }, + }, + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "LocalVar", + snd: { baseName: "n" }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "10", + }, + }, + ], + nodeId: "8", + }, + }, + ], + nodeId: "4P1", + }, }, - ], - nodeId: "4P1", + }, }, }, }, @@ -709,86 +889,110 @@ export const oddEvenTreesMiscStyles: [string, Tree][] = [ body: { tag: "NoBody", contents: "App" }, childTrees: [ { - body: { - contents: { - fst: "GlobalVar", - snd: { baseName: "even", qualifiedModule: ["Even3"] }, + fst: "Hole", + snd: { + body: { + contents: { + fst: "GlobalVar", + snd: { baseName: "even", qualifiedModule: ["Even3"] }, + }, + tag: "TextBody", }, - tag: "TextBody", + childTrees: [], + nodeId: "24", }, - childTrees: [], - nodeId: "24", }, { - body: { tag: "NoBody", contents: "App" }, - childTrees: [ - { - body: { - contents: { - fst: "Con", - snd: { baseName: "Succ", qualifiedModule: ["Builtins"] }, - }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "26", - }, - { - body: { tag: "NoBody", contents: "App" }, - childTrees: [ - { + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "App" }, + childTrees: [ + { + fst: "Hole", + snd: { body: { contents: { fst: "Con", - snd: { - baseName: "Succ", - qualifiedModule: ["Builtins"], - }, + snd: { baseName: "Succ", qualifiedModule: ["Builtins"] }, }, tag: "TextBody", }, childTrees: [], - nodeId: "28", + nodeId: "26", }, - { + }, + { + fst: "Hole", + snd: { body: { tag: "NoBody", contents: "App" }, childTrees: [ { - body: { - contents: { - fst: "Con", - snd: { - baseName: "Succ", - qualifiedModule: ["Builtins"], + fst: "Hole", + snd: { + body: { + contents: { + fst: "Con", + snd: { + baseName: "Succ", + qualifiedModule: ["Builtins"], + }, }, + tag: "TextBody", }, - tag: "TextBody", + childTrees: [], + nodeId: "28", }, - childTrees: [], - nodeId: "30", }, { - body: { - contents: { - fst: "Con", - snd: { - baseName: "Zero", - qualifiedModule: ["Builtins"], + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "App" }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "Con", + snd: { + baseName: "Succ", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "30", + }, }, - }, - tag: "TextBody", + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "Con", + snd: { + baseName: "Zero", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "31", + }, + }, + ], + nodeId: "29", }, - childTrees: [], - nodeId: "31", }, ], - nodeId: "29", + nodeId: "27", }, - ], - nodeId: "27", - }, - ], - nodeId: "25", + }, + ], + nodeId: "25", + }, }, ], nodeId: "23", @@ -803,117 +1007,150 @@ export const oddEvenTreesMiscStyles: [string, Tree][] = [ }, childTrees: [ { - body: { tag: "NoBody", contents: "Case" }, - childTrees: [ - { - body: { - contents: { fst: "LocalVar", snd: { baseName: "x" } }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "16", - }, - ], - nodeId: "15", - rightChild: { - body: { - contents: { - fst: "Pattern", + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "Case" }, + childTrees: [ + { + fst: "Hole", snd: { body: { - contents: { - fst: "PatternCon", - snd: { baseName: "Zero", qualifiedModule: ["Builtins"] }, - }, + contents: { fst: "LocalVar", snd: { baseName: "x" } }, tag: "TextBody", }, childTrees: [], - nodeId: "15P0B", + nodeId: "16", }, }, - tag: "BoxBody", - }, - childTrees: [ - { + ], + nodeId: "15", + rightChild: { + fst: "Hole", + snd: { body: { contents: { - fst: "Con", + fst: "Pattern", snd: { - baseName: "False", - qualifiedModule: ["Builtins"], + body: { + contents: { + fst: "PatternCon", + snd: { + baseName: "Zero", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "15P0B", }, }, - tag: "TextBody", + tag: "BoxBody", }, - childTrees: [], - nodeId: "17", - }, - ], - nodeId: "15P0", - rightChild: { - body: { - contents: { - fst: "Pattern", + childTrees: [ + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "Con", + snd: { + baseName: "False", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "17", + }, + }, + ], + nodeId: "15P0", + rightChild: { + fst: "Hole", snd: { body: { contents: { - fst: "Con", + fst: "Pattern", snd: { - baseName: "Succ", - qualifiedModule: ["Builtins"], + body: { + contents: { + fst: "Con", + snd: { + baseName: "Succ", + qualifiedModule: ["Builtins"], + }, + }, + tag: "TextBody", + }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "PatternBind", + snd: { baseName: "n" }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "18", + }, + }, + ], + nodeId: "15P1B", }, }, - tag: "TextBody", + tag: "BoxBody", }, childTrees: [ { - body: { - contents: { - fst: "PatternBind", - snd: { baseName: "n" }, - }, - tag: "TextBody", + fst: "Hole", + snd: { + body: { tag: "NoBody", contents: "App" }, + childTrees: [ + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "GlobalVar", + snd: { + baseName: "even", + qualifiedModule: ["Even3"], + }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "20", + }, + }, + { + fst: "Hole", + snd: { + body: { + contents: { + fst: "LocalVar", + snd: { baseName: "n" }, + }, + tag: "TextBody", + }, + childTrees: [], + nodeId: "21", + }, + }, + ], + nodeId: "19", }, - childTrees: [], - nodeId: "18", }, ], - nodeId: "15P1B", + nodeId: "15P1", }, }, - tag: "BoxBody", }, - childTrees: [ - { - body: { tag: "NoBody", contents: "App" }, - childTrees: [ - { - body: { - contents: { - fst: "GlobalVar", - snd: { - baseName: "even", - qualifiedModule: ["Even3"], - }, - }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "20", - }, - { - body: { - contents: { fst: "LocalVar", snd: { baseName: "n" } }, - tag: "TextBody", - }, - childTrees: [], - nodeId: "21", - }, - ], - nodeId: "19", - }, - ], - nodeId: "15P1", }, }, }, diff --git a/src/primer-api/model/edgeFlavor.ts b/src/primer-api/model/edgeFlavor.ts new file mode 100644 index 00000000..9b8f8568 --- /dev/null +++ b/src/primer-api/model/edgeFlavor.ts @@ -0,0 +1,30 @@ +/** + * Generated by orval v6.19.1 🍺 + * Do not edit manually. + * Primer backend API + * A backend service implementing a pedagogic functional programming language. + * OpenAPI spec version: 0.7 + */ + +export type EdgeFlavor = typeof EdgeFlavor[keyof typeof EdgeFlavor]; + + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const EdgeFlavor = { + Hole: 'Hole', + AnnTerm: 'AnnTerm', + Ann: 'Ann', + AppFun: 'AppFun', + AppArg: 'AppArg', + ConField: 'ConField', + Lam: 'Lam', + LetEqual: 'LetEqual', + LetIn: 'LetIn', + MatchInput: 'MatchInput', + Pattern: 'Pattern', + MatchOutput: 'MatchOutput', + FunIn: 'FunIn', + FunOut: 'FunOut', + ForallKind: 'ForallKind', + Forall: 'Forall', +} as const; diff --git a/src/primer-api/model/index.ts b/src/primer-api/model/index.ts index 378e5824..331628f1 100644 --- a/src/primer-api/model/index.ts +++ b/src/primer-api/model/index.ts @@ -18,6 +18,7 @@ export * from './createDefinitionParams'; export * from './createTypeDefBody'; export * from './def'; export * from './defSelection'; +export * from './edgeFlavor'; export * from './evalFullClosed'; export * from './evalFullParams'; export * from './evalFullResp'; @@ -70,6 +71,7 @@ export * from './primConOneOfTag'; export * from './primConOneOfThree'; export * from './primConOneOfThreeTag'; export * from './prog'; +export * from './recordPairEdgeFlavorTree'; export * from './recordPairNodeFlavorBoxBodyTree'; export * from './recordPairNodeFlavorPrimBodyPrimCon'; export * from './recordPairNodeFlavorTextBodyName'; diff --git a/src/primer-api/model/recordPairEdgeFlavorTree.ts b/src/primer-api/model/recordPairEdgeFlavorTree.ts new file mode 100644 index 00000000..16b3f7c0 --- /dev/null +++ b/src/primer-api/model/recordPairEdgeFlavorTree.ts @@ -0,0 +1,14 @@ +/** + * Generated by orval v6.19.1 🍺 + * Do not edit manually. + * Primer backend API + * A backend service implementing a pedagogic functional programming language. + * OpenAPI spec version: 0.7 + */ +import type { EdgeFlavor } from './edgeFlavor'; +import type { Tree } from './tree'; + +export interface RecordPairEdgeFlavorTree { + fst: EdgeFlavor; + snd: Tree; +} diff --git a/src/primer-api/model/tree.ts b/src/primer-api/model/tree.ts index b74de47e..9be88d16 100644 --- a/src/primer-api/model/tree.ts +++ b/src/primer-api/model/tree.ts @@ -6,10 +6,11 @@ * OpenAPI spec version: 0.7 */ import type { NodeBody } from './nodeBody'; +import type { RecordPairEdgeFlavorTree } from './recordPairEdgeFlavorTree'; export interface Tree { body: NodeBody; - childTrees: Tree[]; + childTrees: RecordPairEdgeFlavorTree[]; nodeId: string; - rightChild?: Tree; + rightChild?: RecordPairEdgeFlavorTree; }