croma v0.6.0 Croma.SubtypeOfList
Helper module to define list-based types.
The following members are generated by use Croma.SubtypeOfList:
@type t@spec validate(term) :: Croma.Result.t(t)
Options:
:elem_module- A module that defines the type of the element. The module must provide@type tand@spec validate(term) :: Croma.Result.t(t).:min_length- Minimum length of valid values of this type (inclusive).:max_length- Maximum length of valid values of this type (inclusive).:default- Default value for this type. Passing this option generatesdefault/0.
Examples
defmodule MyList do
use Croma.SubtypeOfList, elem_module: MyInt, default: []
end