Package-level declarations

Types

Link copied to clipboard
sealed interface CodecErrorKind : DiagnosticKind
Link copied to clipboard
data class ParzFile(val root: Type.Ref, val rootSpan: SourceSpan?, val body: List<Sexp>)

A representation of an S Expression file

Link copied to clipboard
data class SchemaId(val name: String, val version: Int)
Link copied to clipboard
sealed interface Sexp
Link copied to clipboard
sealed interface SexpErrorKind : DiagnosticKind

Properties

Link copied to clipboard
const val FORMAT_VERSION: Int = 1

Functions

Link copied to clipboard
context(sink: Sink<AnyDiagnostic>)
fun decode(sexp: Sexp, type: Type, schema: Schema = Schema.EMPTY): Value?
Link copied to clipboard
fun decodeFile(text: String, schema: Schema, id: SchemaId, expected: Type.Ref? = null): Checked<Value?, AnyDiagnostic>
Link copied to clipboard
fun decodeString(text: String, type: Type, schema: Schema = Schema.EMPTY): Checked<Value?, AnyDiagnostic>
Link copied to clipboard
fun encode(value: Value, type: Type, schema: Schema = Schema.EMPTY): Sexp
Link copied to clipboard
fun encodeFile(value: Value, root: Type.Ref, schema: Schema, id: SchemaId, targetWidth: Int = 80): String
Link copied to clipboard
fun encodeToString(value: Value, type: Type, schema: Schema = Schema.EMPTY): String
Link copied to clipboard
Link copied to clipboard
fun Sexp.pretty(targetWidth: Int = 80): String
Link copied to clipboard
Link copied to clipboard
fun readFile(text: String, schema: Schema, id: SchemaId): Checked<ParzFile?, AnyDiagnostic>
Link copied to clipboard
context(sink: Sink<Diagnostic<SexpErrorKind>>)
fun readSexps(source: String): List<Sexp>