Sourceror.Identifier (Sourceror v0.11.0) View Source

Functions to identify an classify forms and quoted expressions.

Link to this section Summary

Functions

Checks if the given identifier is a binary op.

Checks if the given identifier is a pipeline operator.

Checks if the given identifier is an unary op.

Checks if the given atom is a valid module alias.

Link to this section Functions

Link to this macro

is_binary_op(op)

View Source (macro)

Specs

is_binary_op(Macro.t()) :: Macro.t()

Checks if the given identifier is a binary op.

Examples

iex> is_binary_op(:+)
true
Link to this macro

is_pipeline_op(op)

View Source (macro)

Checks if the given identifier is a pipeline operator.

Examples

iex> is_pipeline_op(:|>)
true
Link to this macro

is_unary_op(op)

View Source (macro)

Specs

is_unary_op(Macro.t()) :: Macro.t()

Checks if the given identifier is an unary op.

Examples

iex> is_unary_op(:+)
true

Checks if the given atom is a valid module alias.

Examples

iex> valid_alias?(Foo)
true
iex> valid_alias?(:foo)
false