Theoria.Equation.Context (theoria v0.5.0)

Copy Markdown View Source

Experimental/internal API for 0.2; subject to change before 0.3. Internal named values available while materializing an equation branch body.

Summary

Functions

Returns a named branch or outer value from an equation body context.

Builds a context from branch variables and outer values.

Returns a named outer value captured by the branch.

Returns a named branch variable.

Types

t()

@type t() :: %Theoria.Equation.Context{
  a: Theoria.Term.t() | nil,
  b: Theoria.Term.t() | nil,
  element_type: Theoria.Term.t() | nil,
  head: Theoria.Term.t() | nil,
  ih: Theoria.Term.t() | nil,
  length: Theoria.Term.t() | nil,
  n: Theoria.Term.t() | nil,
  outer: %{optional(atom()) => Theoria.Term.t()},
  pred: Theoria.Term.t() | nil,
  tail: Theoria.Term.t() | nil,
  vars: %{optional(atom()) => Theoria.Term.t()},
  x: Theoria.Term.t() | nil,
  xs: Theoria.Term.t() | nil
}

Functions

fetch!(context, name)

@spec fetch!(t(), atom()) :: Theoria.Term.t()

Returns a named branch or outer value from an equation body context.

new(vars \\ %{}, outer \\ %{})

@spec new(map(), map()) :: t()

Builds a context from branch variables and outer values.

outer!(context, name)

@spec outer!(t(), atom()) :: Theoria.Term.t()

Returns a named outer value captured by the branch.

var!(context, name)

@spec var!(t(), atom()) :: Theoria.Term.t()

Returns a named branch variable.