kata/ast

Types

pub type Ast {
  AstString(refinements: List(StringRef))
  AstInt(refinements: List(IntRef))
  AstFloat(refinements: List(FloatRef))
  AstBool
  AstNull
  AstList(item: Ast)
  AstDict(key: Ast, value: Ast)
  AstOption(inner: Ast)
  AstObject(fields: List(FieldSpec))
  AstUnion(discriminator: String, variants: List(#(String, Ast)))
  AstLazy(fn() -> Ast)
  AstTransformed(name: option.Option(String), base: Ast)
  AstBrand(name: String, base: Ast)
}

Constructors

  • AstString(refinements: List(StringRef))
  • AstInt(refinements: List(IntRef))
  • AstFloat(refinements: List(FloatRef))
  • AstBool
  • AstNull
  • AstList(item: Ast)
  • AstDict(key: Ast, value: Ast)
  • AstOption(inner: Ast)
  • AstObject(fields: List(FieldSpec))
  • AstUnion(discriminator: String, variants: List(#(String, Ast)))
  • AstLazy(fn() -> Ast)
  • AstTransformed(name: option.Option(String), base: Ast)

    Wraps a transformed schema, preserving the base AST

  • AstBrand(name: String, base: Ast)

    Nominal typing wrapper

pub type FieldSpec {
  FieldSpec(key: String, ast: Ast, optional: Bool)
}

Constructors

  • FieldSpec(key: String, ast: Ast, optional: Bool)
pub type FloatRef {
  FloatMin(Float)
  FloatMax(Float)
}

Constructors

  • FloatMin(Float)
  • FloatMax(Float)
pub type IntRef {
  IntMin(Int)
  IntMax(Int)
}

Constructors

  • IntMin(Int)
  • IntMax(Int)
pub type StringRef {
  MinLength(Int)
  MaxLength(Int)
  Pattern(String)
}

Constructors

  • MinLength(Int)
  • MaxLength(Int)
  • Pattern(String)
Search Document