Domo v1.0.1 Domo.TypeSpecMatchable protocol View Source

A protocol to match a value against a typespec.

Link to this section Summary

Functions

Returns true if the given term matches a single typespec given in the quoted form.

Link to this section Types

Specs

metadata() :: %{
  :env => Macro.Env.t(),
  optional(:stacktrace) => [any()],
  optional(:types) => Domo.TypeSpecMatchable.BeamType.module_types()
}

Specs

t() :: t()

Specs

t_spec() :: Macro.t()

Link to this section Functions

Link to this function

match_spec?(term, spec, metadata)

View Source

Specs

match_spec?(t(), t_spec(), metadata()) :: boolean()

Returns true if the given term matches a single typespec given in the quoted form.

The metadata is a map with info to resolve remote types. Should contain the caller environment with the env key. Other keys can be populated during the run internally.