Package-level declarations

Types

Link copied to clipboard
sealed interface Decl
Link copied to clipboard
data class Mismatch(val path: List<Segment>, val reason: Reason)

A mismatch between a type and a value.

Link copied to clipboard
sealed interface Reason

A reason for a mismatch.

Link copied to clipboard
sealed interface Resolved
Link copied to clipboard
data class Schema(val decls: List<Decl>)
Link copied to clipboard
sealed interface SchemaErrorKind : DiagnosticKind
Link copied to clipboard
sealed interface Segment

A segment of a path, used to locate mismatches.

Link copied to clipboard
sealed interface ShapeErrorKind : DiagnosticKind
Link copied to clipboard
sealed interface Type

The type system for the IDL.

Link copied to clipboard
sealed interface Value

Concrete values for the Type system. Used for conformance vectors and literals.

Functions

Link copied to clipboard
infix fun Type.accepts(v: Value): Boolean

Convenience method to check a value against a type with no named declarations, ignoring the specifications of mismatches.

fun Type.accepts(v: Value, schema: Schema): Boolean

Convenience method to check a value against a type, ignoring the specifications of mismatches.

Link copied to clipboard
fun Decl.blame(known: Set<String>, declared: Set<String>): String?

Returns the name of the first declaration that blocks the creation of a finite value.

Link copied to clipboard
fun buildable(decls: List<Decl>): Set<String>

Returns the names of every declaration a finite value can be built for.

Link copied to clipboard
infix fun Type.check(v: Value): List<Mismatch>

Check a value against a type with no named declarations to resolve against.

fun Type.check(v: Value, schema: Schema): List<Mismatch>

Check a value against a type, resolving any Type.Ref through schema.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun validate(decls: List<Decl>): Errors<Diagnostic<SchemaErrorKind>>

Validates a list of declarations, reporting any errors found.