Enumex (Enumex v1.0.0)
View SourceA 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:
- A generic
Enumex.Value
structure andEnumex.Component
DSL. Enumex.Dynamic
which manages dynamic enum valuesEnumex.Static
which manages fixed list of values known at compile time
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
@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()