Home / Docs / Language guide

Canonical form

Release v0.4.0

Every file has one canonical form. una fmt rewrites a file into it, and una check reports every difference as U7001, an error with a mechanical repair. Code that a program generates should go through una fmt before una check. A file with a syntax error has no canonical form: it is neither formatted nor checked for U7001. The rules, from spec/15:

File

Lines and indentation

Spacing. Tokens are separated by one space, except:

Functions and bodies

Sums. A sum with two or more variants has no leading |. A sum with one variant keeps it, since the grammar requires it: kind PhoneError = | Malformed.

Constructors

Imports

Blank lines

Comments

How U7001 is reported