# `Croma.SubtypeOfList`
[🔗](https://github.com/skirino/croma/blob/main/lib/croma/subtype.ex#L350)

Helper module to define list-based types.
The following members are generated by `use Croma.SubtypeOfList`:

- `@type t`
- `@spec valid?(term) :: boolean`
- If `elem_module` exports `new/1`,
    - `@spec new(term) :: Croma.Result.t(t)`
    - `@spec new!(term) :: t`

Options:
- `:elem_module` - A type module for elements.
- `: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 generates `default/0`.

## Examples
    defmodule MyList do
      use Croma.SubtypeOfList, elem_module: MyInt, default: []
    end

---

*Consult [api-reference.md](api-reference.md) for complete listing*
