glance

Types

pub type AssignmentKind {
  Let
  Assert
}

Constructors

  • Let
  • Assert
pub type AssignmentName {
  Named(String)
  Discarded(String)
}

Constructors

  • Named(String)
  • Discarded(String)
pub type Attribute {
  Attribute(name: String, arguments: List(Expression))
}

Constructors

  • Attribute(name: String, arguments: List(Expression))
pub type BinaryOperator {
  And
  Or
  Eq
  NotEq
  LtInt
  LtEqInt
  LtFloat
  LtEqFloat
  GtEqInt
  GtInt
  GtEqFloat
  GtFloat
  Pipe
  AddInt
  AddFloat
  SubInt
  SubFloat
  MultInt
  MultFloat
  DivInt
  DivFloat
  RemainderInt
  Concatenate
}

Constructors

  • And
  • Or
  • Eq
  • NotEq
  • LtInt
  • LtEqInt
  • LtFloat
  • LtEqFloat
  • GtEqInt
  • GtInt
  • GtEqFloat
  • GtFloat
  • Pipe
  • AddInt
  • AddFloat
  • SubInt
  • SubFloat
  • MultInt
  • MultFloat
  • DivInt
  • DivFloat
  • RemainderInt
  • Concatenate
pub type BitStringSegmentOption(t) {
  BytesOption
  IntOption
  FloatOption
  BitsOption
  Utf8Option
  Utf16Option
  Utf32Option
  Utf8CodepointOption
  Utf16CodepointOption
  Utf32CodepointOption
  SignedOption
  UnsignedOption
  BigOption
  LittleOption
  NativeOption
  SizeValueOption(t)
  SizeOption(Int)
  UnitOption(Int)
}

Constructors

  • BytesOption
  • IntOption
  • FloatOption
  • BitsOption
  • Utf8Option
  • Utf16Option
  • Utf32Option
  • Utf8CodepointOption
  • Utf16CodepointOption
  • Utf32CodepointOption
  • SignedOption
  • UnsignedOption
  • BigOption
  • LittleOption
  • NativeOption
  • SizeValueOption(t)
  • SizeOption(Int)
  • UnitOption(Int)
pub type Clause {
  Clause(
    patterns: List(List(Pattern)),
    guard: Option(Expression),
    body: Expression,
  )
}

Constructors

  • Clause(
      patterns: List(List(Pattern)),
      guard: Option(Expression),
      body: Expression,
    )
pub type Constant {
  Constant(
    name: String,
    publicity: Publicity,
    annotation: Option(Type),
    value: Expression,
  )
}

Constructors

  • Constant(
      name: String,
      publicity: Publicity,
      annotation: Option(Type),
      value: Expression,
    )
pub type CustomType {
  CustomType(
    name: String,
    publicity: Publicity,
    opaque_: Bool,
    parameters: List(String),
    variants: List(Variant),
  )
}

Constructors

  • CustomType(
      name: String,
      publicity: Publicity,
      opaque_: Bool,
      parameters: List(String),
      variants: List(Variant),
    )
pub type Definition(definition) {
  Definition(attributes: List(Attribute), definition: definition)
}

Constructors

  • Definition(attributes: List(Attribute), definition: definition)
pub type Error {
  UnexpectedEndOfInput
  UnexpectedToken(token: Token, position: Position)
}

Constructors

  • UnexpectedEndOfInput
  • UnexpectedToken(token: Token, position: Position)
pub type Expression {
  Int(String)
  Float(String)
  String(String)
  Variable(String)
  NegateInt(Expression)
  NegateBool(Expression)
  Block(List(Statement))
  Panic(Option(Expression))
  Todo(Option(Expression))
  Tuple(List(Expression))
  List(elements: List(Expression), rest: Option(Expression))
  Fn(
    arguments: List(FnParameter),
    return_annotation: Option(Type),
    body: List(Statement),
  )
  RecordUpdate(
    module: Option(String),
    constructor: String,
    record: Expression,
    fields: List(#(String, Expression)),
  )
  FieldAccess(container: Expression, label: String)
  Call(function: Expression, arguments: List(Field(Expression)))
  TupleIndex(tuple: Expression, index: Int)
  FnCapture(
    label: Option(String),
    function: Expression,
    arguments_before: List(Field(Expression)),
    arguments_after: List(Field(Expression)),
  )
  BitString(
    segments: List(
      #(Expression, List(BitStringSegmentOption(Expression))),
    ),
  )
  Case(subjects: List(Expression), clauses: List(Clause))
  BinaryOperator(
    name: BinaryOperator,
    left: Expression,
    right: Expression,
  )
}

Constructors

  • Int(String)
  • Float(String)
  • String(String)
  • Variable(String)
  • NegateInt(Expression)
  • NegateBool(Expression)
  • Block(List(Statement))
  • Panic(Option(Expression))
  • Todo(Option(Expression))
  • Tuple(List(Expression))
  • List(elements: List(Expression), rest: Option(Expression))
  • Fn(
      arguments: List(FnParameter),
      return_annotation: Option(Type),
      body: List(Statement),
    )
  • RecordUpdate(
      module: Option(String),
      constructor: String,
      record: Expression,
      fields: List(#(String, Expression)),
    )
  • FieldAccess(container: Expression, label: String)
  • Call(function: Expression, arguments: List(Field(Expression)))
  • TupleIndex(tuple: Expression, index: Int)
  • FnCapture(
      label: Option(String),
      function: Expression,
      arguments_before: List(Field(Expression)),
      arguments_after: List(Field(Expression)),
    )
  • BitString(
      segments: List(
        #(Expression, List(BitStringSegmentOption(Expression))),
      ),
    )
  • Case(subjects: List(Expression), clauses: List(Clause))
  • BinaryOperator(
      name: BinaryOperator,
      left: Expression,
      right: Expression,
    )
pub type Field(t) {
  Field(label: Option(String), item: t)
}

Constructors

  • Field(label: Option(String), item: t)
pub type FnParameter {
  FnParameter(name: AssignmentName, type_: Option(Type))
}

Constructors

  • FnParameter(name: AssignmentName, type_: Option(Type))
pub type Function {
  Function(
    name: String,
    publicity: Publicity,
    parameters: List(FunctionParameter),
    return: Option(Type),
    body: List(Statement),
    location: Span,
  )
}

Constructors

  • Function(
      name: String,
      publicity: Publicity,
      parameters: List(FunctionParameter),
      return: Option(Type),
      body: List(Statement),
      location: Span,
    )
pub type FunctionParameter {
  FunctionParameter(
    label: Option(String),
    name: AssignmentName,
    type_: Option(Type),
  )
}

Constructors

  • FunctionParameter(
      label: Option(String),
      name: AssignmentName,
      type_: Option(Type),
    )
pub type Import {
  Import(
    module: String,
    alias: Option(AssignmentName),
    unqualified_types: List(UnqualifiedImport),
    unqualified_values: List(UnqualifiedImport),
  )
}

Constructors

  • Import(
      module: String,
      alias: Option(AssignmentName),
      unqualified_types: List(UnqualifiedImport),
      unqualified_values: List(UnqualifiedImport),
    )
pub type Module {
  Module(
    imports: List(Definition(Import)),
    custom_types: List(Definition(CustomType)),
    type_aliases: List(Definition(TypeAlias)),
    constants: List(Definition(Constant)),
    functions: List(Definition(Function)),
  )
}

Constructors

  • Module(
      imports: List(Definition(Import)),
      custom_types: List(Definition(CustomType)),
      type_aliases: List(Definition(TypeAlias)),
      constants: List(Definition(Constant)),
      functions: List(Definition(Function)),
    )
pub type Pattern {
  PatternInt(value: String)
  PatternFloat(value: String)
  PatternString(value: String)
  PatternDiscard(name: String)
  PatternVariable(name: String)
  PatternTuple(elems: List(Pattern))
  PatternList(elements: List(Pattern), tail: Option(Pattern))
  PatternAssignment(pattern: Pattern, name: String)
  PatternConcatenate(left: String, right: AssignmentName)
  PatternBitString(
    segments: List(
      #(Pattern, List(BitStringSegmentOption(Pattern))),
    ),
  )
  PatternConstructor(
    module: Option(String),
    constructor: String,
    arguments: List(Field(Pattern)),
    with_spread: Bool,
  )
}

Constructors

  • PatternInt(value: String)
  • PatternFloat(value: String)
  • PatternString(value: String)
  • PatternDiscard(name: String)
  • PatternVariable(name: String)
  • PatternTuple(elems: List(Pattern))
  • PatternList(elements: List(Pattern), tail: Option(Pattern))
  • PatternAssignment(pattern: Pattern, name: String)
  • PatternConcatenate(left: String, right: AssignmentName)
  • PatternBitString(
      segments: List(
        #(Pattern, List(BitStringSegmentOption(Pattern))),
      ),
    )
  • PatternConstructor(
      module: Option(String),
      constructor: String,
      arguments: List(Field(Pattern)),
      with_spread: Bool,
    )
pub type Publicity {
  Public
  Private
}

Constructors

  • Public
  • Private
pub type Span {
  Span(start: Int, end: Int)
}

Constructors

  • Span(start: Int, end: Int)

    A span within a file, indicated by byte offsets.

pub type Statement {
  Use(patterns: List(Pattern), function: Expression)
  Assignment(
    kind: AssignmentKind,
    pattern: Pattern,
    annotation: Option(Type),
    value: Expression,
  )
  Expression(Expression)
}

Constructors

  • Use(patterns: List(Pattern), function: Expression)
  • Assignment(
      kind: AssignmentKind,
      pattern: Pattern,
      annotation: Option(Type),
      value: Expression,
    )
  • Expression(Expression)
pub type Type {
  NamedType(
    name: String,
    module: Option(String),
    parameters: List(Type),
  )
  TupleType(elements: List(Type))
  FunctionType(parameters: List(Type), return: Type)
  VariableType(name: String)
  HoleType(name: String)
}

Constructors

  • NamedType(
      name: String,
      module: Option(String),
      parameters: List(Type),
    )
  • TupleType(elements: List(Type))
  • FunctionType(parameters: List(Type), return: Type)
  • VariableType(name: String)
  • HoleType(name: String)
pub type TypeAlias {
  TypeAlias(
    name: String,
    publicity: Publicity,
    parameters: List(String),
    aliased: Type,
  )
}

Constructors

  • TypeAlias(
      name: String,
      publicity: Publicity,
      parameters: List(String),
      aliased: Type,
    )
pub type UnqualifiedImport {
  UnqualifiedImport(name: String, alias: Option(String))
}

Constructors

  • UnqualifiedImport(name: String, alias: Option(String))
pub type Variant {
  Variant(name: String, fields: List(Field(Type)))
}

Constructors

  • Variant(name: String, fields: List(Field(Type)))

Functions

pub fn module(src: String) -> Result(Module, Error)
pub fn precedence(operator: BinaryOperator) -> Int
Search Document