Typing context for bound variables.
Bindings are stored nearest-binder first. A binding's type is stored relative to the context where the binder was introduced. Lookup weakens the stored type into the current context.
Summary
Types
@type binding() :: {atom(), Theoria.Term.t()}
@type t() :: %Theoria.Context{bindings: [binding()]}
Functions
@spec fetch(t(), non_neg_integer()) :: {:ok, binding()} | :error
@spec new() :: t()
@spec push(t(), atom(), Theoria.Term.t()) :: t()
@spec size(t()) :: non_neg_integer()