View Source Domainex.Common (domainex v0.1.0)
Summary
Functions
extract_element_from_tuple/2
used for extract some element from a tuple. This function already
cover some exceptions using try/rescue
mechanism. If some exceptions was raised it will be catched
and return an error. It use elem/2
under the hood.
is_tuple_has_context?/2
is a function to check the first element of some tuple. The context
definition here is like an :ok
or an :error
or anything that define the tuple's value itself,
such for a success return value, the first element should be an :ok
.
is_tuple_length_valid?/2
is a function to check tuple's length
Functions
@spec extract_element_from_tuple(given :: tuple(), index :: integer()) :: Domainex.result()
extract_element_from_tuple/2
used for extract some element from a tuple. This function already
cover some exceptions using try/rescue
mechanism. If some exceptions was raised it will be catched
and return an error. It use elem/2
under the hood.
is_tuple_has_context?/2
is a function to check the first element of some tuple. The context
definition here is like an :ok
or an :error
or anything that define the tuple's value itself,
such for a success return value, the first element should be an :ok
.
is_tuple_length_valid?/2
is a function to check tuple's length