Optimal.Type (optimal v0.3.7)

View Source

Exposes functions for validating types, and determining if a value matches a type.

Summary

Functions

matches_type?(types, value)

@spec matches_type?(type :: term(), value :: term()) :: boolean()

merge(same, same)

@spec merge(left :: term(), right :: term()) :: term()

valid_type?(types)

@spec valid_type?(term()) :: boolean()

validate_types(types, field_name, opts, schema)

@spec validate_types(
  types :: Keyword.t(),
  field_name :: atom(),
  opts :: Keyword.t(),
  schema :: Optimal.schema()
) :: [{atom(), String.t()}]