Types for canonical filter expressions and parse errors.
Most applications interact with the parse/1, to_expr/1, and type aliases
generated in a module that uses Fltr. The types here describe the shared
representation used by those modules.
Summary
Types
A canonical tuple for one declared filter.
The operator for a Boolean group.
A reason external input could not be converted to a canonical filter.
A canonical leaf filter or a Boolean group containing at least one expression.
Types
@type filter() :: tuple()
A canonical tuple for one declared filter.
The first element is the filter name and the remaining elements are its
validated arguments, for example {:active} or {:id, 7}.
@type group_operator() :: :any | :all
The operator for a Boolean group.
:all requires every child expression; :any requires at least one.
@type parse_error() :: {:invalid_filter, term()} | {:unknown_filter, String.t() | atom()} | {:invalid_arguments, atom(), [term()]}
A reason external input could not be converted to a canonical filter.
:invalid_filteridentifies an unsupported input shape.:unknown_filteridentifies a name not declared by the filter module.:invalid_argumentsidentifies the original arguments when their count is wrong or a custom parser rejects them.
@type t() :: filter() | {group_operator(), [t(), ...]}
A canonical leaf filter or a Boolean group containing at least one expression.