Nock (Anoma v0.34.0)
Nock, a universal function on nouns.
Summary
Types
@type error() :: :crash_bang | :scry_no_return | :scry_forbidden | :jet_does_not_match | :invalid_instruction | :instruction_match_error | {:jet_failed, Nock.Jets.error()} | {:scry_failure, any()} | {:scry_failure_formula, error()} | {:invalid_formula, Noun.t()} | {:inc_non_atom, Noun.t()} | {:gas, non_neg_integer()} | {:axis, Noun.t(), Noun.t()} | {:invalid_formula, Noun.t()} | {:replace, Noun.t(), Noun.t(), Noun.t()} | {:gas_error, error(), non_neg_integer()}
@type t() :: %Nock{ gas_limit: non_neg_integer() | nil, meter_pid: pid() | nil, scry_function: (term() -> {:ok, term()} | {:error, any()}), stdio: any() }
I contain environmental information on how Nock shall be evaluated.
For example Ι contain information on jettedness to determine if we should be using jets or not
Functions
@spec decrement_arm() :: Noun.t()
@spec decrement_core() :: Noun.t()
@spec gas_meter() :: non_neg_integer()
@spec gas_meter(non_neg_integer()) :: non_neg_integer()
@spec get_jet(Noun.t()) :: {:ok, {String.t(), non_neg_integer(), non_neg_integer(), (Noun.t() -> {:error, Nock.Jets.error()} | {:ok, Noun.t()}), atom(), non_neg_integer()}} | :error
@spec metered_nock(Noun.t(), Noun.t()) :: {:ok, Noun.t(), non_neg_integer()} | {:error, error()}