What problem does it solve?
Idiomatic patterns for writing code with formality-core, focusing on generated constructors, Upcast/UpcastFrom coercions, judgment_fn patterns, and conventions for term-related enums and structs. This guidance helps reduce boilerplate, prevent subtle bugs, and improve readability in projects built on formality-core.
Core Features & Use Cases
- Generated constructors for structs and enums enable clean, concise construction and automatic upcast handling.
- Upcast/UpcastFrom coercions reduce manual conversions and cloning by accepting references where owned types are expected.
- judgment_fn patterns guide safe rule definitions and structured conclusions within judgments.
- Common pitfalls and best practices to ensure reliable type definitions and parser-related code in formality-core projects.
Quick Start
Apply these idioms when writing or reviewing formality-core code to ensure generated constructors, Upcast/UpcastFrom coercions, and judgment_fn patterns are used idiomatically.