Violet

Violet

A small dependently typed language with inductive types, universe polymorphism, and user-defined operators.

See examples View on Codeberg

A taste of Violet

\data Nat : U
  | zero : Nat
  | suc : Nat -> Nat

\let add : (m n : Nat) -> Nat \where
  add m n <= \elim m
  | add zero n => n
  | add (suc m) n => suc (add m n)

\operator "~x + ~y" => add
  \associativity: \left

Why Violet?

Inductive types

Define Nat, List, Vec, and equality with auto-generated eliminators.

Universe polymorphism

Write definitions once and reuse them across universe levels.

Stack-based pattern matching

Compose \elim, \intro, and \split to build clauses step by step.

User-defined operators

Declare infix operators with associativity and precedence, like + and *.

Records with eta

First-class record types with punning, update syntax, and definitional eta.

Modules & imports

Top-level \import and \export; definitions are private by default.