Noun (Anoma v0.34.0)
The noun data structure.
Represented as Elixir cons cells, which might get annoying.
Summary
Functions
I convert the noun atom to a signed integer.
I convert an Elixir boolean to a Nock one.
I decode the signed integer from its ZigZag representation.
I convert the signed integer to a noun using the ZigZag encoding.
Calculates the index from the given access offset
I try to turn an Elixir term to a proper list. If the term is a nock list, return {:ok, result} Otheriwse :error
Types
@type noun_atom() :: non_neg_integer() | binary() | []
@type noun_cell() :: nonempty_improper_list(t(), t())
Functions
@spec atom_binary_to_integer(noun_atom()) :: non_neg_integer()
I convert the noun atom to a signed integer.
@spec atom_integer_to_binary(noun_atom(), non_neg_integer()) :: binary()
@spec axis(non_neg_integer(), t()) :: {:ok, t()} | :error
@spec bool_to_noun(bool()) :: 1 | 0
I convert an Elixir boolean to a Nock one.
@spec decode_signed(non_neg_integer()) :: integer()
I decode the signed integer from its ZigZag representation.
@spec encode_signed(integer()) :: non_neg_integer()
I convert the signed integer to a noun using the ZigZag encoding.
@spec index_to_offset(non_neg_integer()) :: non_neg_integer()
Calculates the index from the given access offset
@spec list_nock_to_erlang(0) :: []
@spec list_nock_to_erlang(<<_::0>>) :: []
@spec list_nock_to_erlang([]) :: []
@spec list_nock_to_erlang(nonempty_improper_list(t(), t())) :: [t()]
I try to turn an Elixir term to a proper list. If the term is a nock list, return {:ok, result} Otheriwse :error
@spec mug(t()) :: non_neg_integer()
@spec pad_trailing(binary(), non_neg_integer()) :: binary()
@spec replace(non_neg_integer(), t(), t()) :: {:ok, t()} | :error
@spec to_normalized_noun(Noun.Nounable.t()) :: t()