Skip to content

Commit

Permalink
Ctx -- has types (stack) -- for cut
Browse files Browse the repository at this point in the history
- `Net` is like `Env`
  • Loading branch information
xieyuheng committed Aug 1, 2023
1 parent 73720d3 commit 6c25698
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# type

`freshenTypes` -- consistently add subscript to type variable names
`Word.cut`

`defrule` -- check type -- cut -- words composition

- `freshenTypes` -- consistently add subscript to type variable names

`defnet` -- type check -- cut -- words composition

`defnode` -- check type -- arity of defined types
Expand Down
5 changes: 5 additions & 0 deletions src/lang/ctx/Ctx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Type } from "../type"

export type Ctx = {
types: Array<Type>
}
7 changes: 7 additions & 0 deletions src/lang/ctx/createCtx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Ctx } from "./Ctx"

export function createCtx(): Ctx {
return {
types: [],
}
}
1 change: 1 addition & 0 deletions src/lang/ctx/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./Ctx"

0 comments on commit 6c25698

Please sign in to comment.