Sign in

panproto

@panproto.dev
34 followers 8 following 36 posts

Schematic version control. panproto.dev

PostsRepliesMedia
panproto @panproto.dev · 12/09/2026
Didactic can attach an indexed family to Model fields. For example, a record with kind="number" can require a numeric body, and kind="text" can require text. Construction, JSON decoding, and immutable updates enforce the same cross-field dependency.
Syntax-highlighted Python defining a Payload universe whose text and number codes select different Python types. A Record model links kind to body through Payload.at("kind"). Pytest assertions confirm that a mismatched body and an inconsistent immutable update both raise Didactic ValidationError.
000
panproto @panproto.dev · 12/09/2026
Implicit indices now work in eliminator equations. head : Vec(succ n) → A can omit n at the call site. panproto can infer it from the vector. The nil case is impossible. Including it is rejected as unreachable.
Syntax-highlighted Python defining cons and head with implicit length index n. The displayed case equation makes head return the cons value. Calling head on cons(first(), nil()) supplies no length index, and normalization returns first().
100
panproto @panproto.dev · 12/09/2026
User-defined eliminators may have dependent motives. eval : Expr(t) → El(t) is checked branch by branch after refining t. Returning an integer carrier from a Boolean expression branch is a type error.
Syntax-highlighted Python defining a dependent evaluate eliminator. It accepts an expression of Expr(t), has motive El(t), handles IntLit and BoolLit by returning their values, and passes Panproto theory checking.
100
panproto @panproto.dev · 12/09/2026
Constructors may refine result indices. For instance: nil : Vec(0) and cons : A × Vec(n) → Vec(succ n). Panproto uses those refinements during type checking. A constructor or branch at the wrong index is rejected.
Syntax-highlighted Python defining zero and successor, followed by highlighted vector constructors. nil returns Vec(zero), while cons accepts a value and Vec(n) and returns Vec(succ(n)).
100
panproto @panproto.dev · 12/09/2026
You can now declare arbitrary indexed families, such Vec(n), Expr(t), Matrix(rows, columns), or Term(context, type). Family parameters form dependent telescopes, so a later parameter may depend on an earlier one.
Syntax-highlighted Python declaring a Didactic GADT named TypedLanguage. Highlighted definitions show Vec indexed by a Nat length and Term indexed by a context and a type belonging to that context.
100