View Source TypeCheck.Builtin.CompoundFixedMap (TypeCheck v0.13.7)

Special type for map-typespecs that contain a combination of fixed keys as well as an optional(...) or required(...) part.

Its checks compile down to a combination of TypeCheck.Builtin.FixedMap and TypeCheck.Builtin.Map for the fixed resp. non-fixed parts.

Summary

Types

(This type is managed by TypeCheck, which allows checking values against the type at runtime.)

t()

(This type is managed by TypeCheck, which allows checking values against the type at runtime.)

Types

@type problem_tuple() ::
  {t(), :not_a_map, %{}, any()}
  | {t(), :missing_keys, %{keys: [atom()]}, map()}
  | {t(), :superfluous_keys, %{keys: [atom()]}, map()}
  | {t(), :value_error,
     %{problem: TypeCheck.TypeError.Formatter.problem_tuple(), key: any()},
     map()}
  | {t(), :key_error,
     %{problem: TypeCheck.TypeError.Formatter.problem_tuple(), key: any()},
     map()}

(This type is managed by TypeCheck, which allows checking values against the type at runtime.)

Full definition:

problem_tuple :: {t(), :not_a_map, %{}, any()}
| {t(), :missing_keys, %{keys: list(atom())}, map()}
| {t(), :superfluous_keys, %{keys: list(atom())}, map()}
| {t(), :value_error, %{problem: lazy(TypeCheck.TypeError.Formatter.problem_tuple()), key: any()},
   map()}
| {t(), :key_error, %{problem: lazy(TypeCheck.TypeError.Formatter.problem_tuple()), key: any()},
   map()}
@type t() :: %TypeCheck.Builtin.CompoundFixedMap{
  fixed: TypeCheck.Builtin.FixedMap.t(),
  flexible: TypeCheck.Builtin.Map.t() | TypeCheck.Builtin.OptionalFixedMap.t()
}

(This type is managed by TypeCheck, which allows checking values against the type at runtime.)

Full definition:

t :: %TypeCheck.Builtin.CompoundFixedMap{
  fixed: TypeCheck.Builtin.FixedMap.t(),
  flexible: TypeCheck.Builtin.Map.t() | TypeCheck.Builtin.OptionalFixedMap.t()
}