Noun (Anoma v0.25.0)

The noun data structure.

Represented as Elixir cons cells, which might get annoying.

Summary

Types

@type noun_atom() :: non_neg_integer() | binary() | []
@type noun_cell() :: nonempty_improper_list(t(), t())
@type t() :: noun_atom() | noun_cell()

Functions

Link to this function

atom_binary_to_integer(binary)

@spec atom_binary_to_integer(noun_atom()) :: non_neg_integer()
Link to this function

atom_integer_to_binary(integer)

@spec atom_integer_to_binary(noun_atom()) :: binary()
Link to this function

atom_integer_to_binary(integer, length)

@spec atom_integer_to_binary(noun_atom(), non_neg_integer()) :: binary()
Link to this function

axis(axis, noun)

@spec axis(non_neg_integer(), t()) :: {:ok, t()} | :error
Link to this function

condensed_print(atom)

@spec condensed_print(t()) :: String.t()
Link to this function

equal(noun_1, noun_2)

@spec equal(t(), t()) :: boolean()
Link to this function

index_to_offset(n)

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

Calculates the index from the given access offset

Link to this macro

is_noun_atom(term)

(macro)
Link to this macro

is_noun_cell(term)

(macro)
@spec is_zero(t()) :: boolean()
Link to this function

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()]
Link to this function

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

@spec mug(t()) :: non_neg_integer()
Link to this function

normalize_noun(atom)

@spec normalize_noun(noun_atom()) :: binary()
@spec normalize_noun(noun_cell()) :: t()
Link to this function

pad_trailing(binary, len)

@spec pad_trailing(binary(), non_neg_integer()) :: binary()
Link to this function

replace(axis, replacement, noun)

@spec replace(non_neg_integer(), t(), t()) :: {:ok, t()} | :error
Link to this function

to_normalized_noun(value)

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