Enumex (Enumex v1.0.0)

View Source

A comprehensive library for working with both static and dynamic enum structures in Elixir.

The Enumex library provides a unified approach to handling enumerated values, supporting both compile-time constants and runtime-determined values. It consists of three 3 main parts:

The library is designed to be flexible and extensible enough to handle various use cases.

Summary

Types

A custom type that specifies the type of input data that is expected by a macro.

Types

macro_input(type)

@type macro_input(type) :: type | Macro.input()

A custom type that specifies the type of input data that is expected by a macro.

Usage

# specification for the example macro which accepts non negative integer
# directly or as a result of any `Elixir` expression
@spec example(Enumex.macro_input(non_neg_integer())) :: Macro.output()