View Source TypedStructor.Definer.Utils (TypedStructor v0.5.0)

Utilities for definer modules.

Summary

Functions

Extracts fields and enforce keys from a definition.

Extracts types from a definition.

Functions

Link to this function

fields_and_enforce_keys(definition)

View Source
@spec fields_and_enforce_keys(TypedStructor.Definition.t()) :: {Keyword.t(), [atom()]}

Extracts fields and enforce keys from a definition.

Link to this function

types(definition, caller)

View Source
@spec types(TypedStructor.Definition.t(), Macro.Env.t()) ::
  {type_kind :: :type | :opaque | :typep, type_name :: atom(),
   parameters :: [{parameter_name :: atom(), [], context :: atom()}],
   fields :: [{field_name :: atom(), Macro.t()}]}

Extracts types from a definition.