RTypes v0.1.0 RTypes.Extractor View Source
Link to this section Summary
Functions
Recursively extract and instantiate AST representation of a type.
Link to this section Types
Link to this type
type() View Source
Link to this type
unfolded_type() View Source
Link to this type
value() View Source
Link to this section Functions
Link to this function
extract_type(mod, type_name, type_args)
View Source
extract_type(mod, type_name, type_args)
View Source
extract_type(module(), atom(), [type() | value()]) :: unfolded_type()
extract_type(module(), atom(), [type() | value()]) :: unfolded_type()
Recursively extract and instantiate AST representation of a type.
Arguments
mod
- moduletype_name
- type nametype_args
- arguments, if any, for the type. The arguments should be represented as AST, for example,{:type, 0, :list, []}
Usage
iex> extract_type(:inet, :port_number, [])
{:type, 102, :range, [{:integer, 102, 0}, {:integer, 102, 65535}]}
iex> extract_type(Keyword, :t, [{:type, 0, :list, []}])
{:type, 0, :list, [{:type, 0, :tuple, [{:type, 74, :atom, []}, {:var, 78, :value}]}]}