Std.Literal

View source →

User-defined contextual integer literals.

A bare numeral still defaults to Int. In a checking position the elaborator asks these interfaces to construct the expected type. The result wrapper keeps conversion total: finite domains such as Bounded(n) reject an out-of-range literal during compilation rather than trapping or silently wrapping at runtime.

Types

  • type LiteralResult = LiteralValue | InvalidLiteral