Design decisions

157. Enum variants are PascalCase, including Some and None (2026-11-21)

  • Decision. Every enum variant is PascalCase: Some(x), None, Ev.Add(v), Anchor.Start, Sign.Neg. true and false stay lowercase literals. In a pattern a capitalized name is a variant or constant and a lowercase name always binds.
  • Why. Case then settles patterns with no lookup, so a mistyped or out-of-scope variant can't silently become a fresh binding (Rust lints for this; Haskell and OCaml make it grammar). Payload variants are constructors, and constructors are already capitalized (Edge(u, v)). It is the familiar spelling from Rust (Some/None) and Python (None). Chapters 01 and 02 had contradicted each other, and the corpus mixed both styles.
  • Reverse. Make variants snake_case in chapters 01 and 02, rerun the sweep in reverse over spec/ and corpus/problems/, and drop the Some/None spellings from the lexer and parser.