tyc cheatsheet
tyc cheatsheetPrints the 30-second Typhon cheat sheet to stdout — every keyword and pattern you need to write or read a .ty file, on one screen. Source lives at docs/cheatsheet.md and is embedded into the tyc binary so it works offline.
Examples
tyc cheatsheet # straight to stdouttyc cheatsheet | less # paginate ittyc cheatsheet > cheatsheet.txt # save it locallyWhat it covers
- Bindings —
let/mut, the function-body rule, module-level default tolet. - Annotations — Rule 1,
T?forT | None, explicit-> None. - Classes —
class(dataclass),class frozen(immutable),plain class(no decorator),class!(raw with synthesised__init__),model(Pydantic). - Methods in
implblocks — Rule 4. - Sealed unions + exhaustive
match— declaration and pattern arms. Result[T, E]+?— Ok/Err, error propagation, with-chains.- Checked boundary cast —
as!, e.g.let d = resp.json() as! dict[str, int]— sound, runtime-checked one-liner at an untyped boundary. - Concurrency —
gather:,go,lazy import. - Comptime —
comptime let,env(), build-time evaluation. - CLI — every common
tycsubcommand with a one-line purpose.
The full reference lives across Language Tour and Language Reference; the cheat sheet is the rapid-lookup view.
When to reach for it
- Quick keyword refresh during code review without context-switching to a browser.
- Pair-programming or workshop scenarios where copy-pasting the syntax saves time.
- Generating documentation snippets that need the canonical pattern shapes.
Flags
tyc cheatsheet takes no arguments today. The content matches docs/cheatsheet.md byte-for-byte.
Where next
- The Five Rules of Typhon — the deeper “if you remember nothing else” tour.
- Language Reference — the full surface, syntax-form by syntax-form.
tyc explain— diagnostic-specific catalog pages.