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

noun_atom()

@type noun_atom() :: non_neg_integer() | binary() | []

noun_cell()

@type noun_cell() :: nonempty_improper_list(t(), t())

t()

@type t() :: noun_atom() | noun_cell()

Functions

abnormalize_noun(atom)

atom_binary_to_integer(binary)

@spec atom_binary_to_integer(noun_atom()) :: non_neg_integer()

atom_binary_to_signed_integer(atom)

@spec atom_binary_to_signed_integer(noun_atom()) :: integer()

I convert the noun atom to a signed integer.

atom_integer_to_binary(integer)

@spec atom_integer_to_binary(noun_atom()) :: binary()

atom_integer_to_binary(integer, length)

@spec atom_integer_to_binary(noun_atom(), non_neg_integer()) :: binary()

axis(axis, noun)

@spec axis(non_neg_integer(), t()) :: {:ok, t()} | :error

bool_to_noun(bool)

@spec bool_to_noun(bool()) :: 1 | 0

I convert an Elixir boolean to a Nock one.

condensed_print(atom)

@spec condensed_print(t()) :: String.t()

decode_signed(x)

@spec decode_signed(non_neg_integer()) :: integer()

I decode the signed integer from its ZigZag representation.

encode_signed(x)

@spec encode_signed(integer()) :: non_neg_integer()

I convert the signed integer to a noun using the ZigZag encoding.

equal?(noun_1, noun_2)

@spec equal?(t(), t()) :: boolean()

index_to_offset(n)

@spec index_to_offset(non_neg_integer()) :: non_neg_integer()

Calculates the index from the given access offset

is_noun_atom(term)

(macro)

is_noun_cell(term)

(macro)

is_noun_zero(term)

(macro)

list_nock_to_erlang(arg1)

@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()]

list_nock_to_erlang_safe(x)

@spec list_nock_to_erlang_safe(any()) :: {:ok, t()} | :error

I try to turn an Elixir term to a proper list. If the term is a nock list, return {:ok, result} Otheriwse :error

mug(atom)

@spec mug(t()) :: non_neg_integer()

mum(seed, fal, key)

mum_rec(i, seed, fal, key)

normalize_noun(atom)

@spec normalize_noun(noun_atom()) :: binary()
@spec normalize_noun(noun_cell()) :: t()

pad_trailing(binary, len)

@spec pad_trailing(binary(), non_neg_integer()) :: binary()

replace(axis, replacement, noun)

@spec replace(non_neg_integer(), t(), t()) :: {:ok, t()} | :error

to_normalized_noun(value)

@spec to_normalized_noun(Noun.Nounable.t()) :: t()

zero?(arg1)

@spec zero?(t()) :: boolean()