RTypes v0.3.1 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 section Functions
Recursively extract and instantiate AST representation of a type.
Arguments
mod- a module name or a tuple of a module name and object codetype_name- type nametype_args- arguments, if any, for the type. The arguments should be represented as AST, for example,{:type, 0, :list, []}
Usage
iex> t = RTypes.Extractor.extract_type(:inet, :port_number, [])
iex> match?({:type, _, :range, [{:integer, _, 0}, {:integer, _, 65535}]}, t)
true
iex> t = RTypes.Extractor.extract_type(Keyword, :t, [{:type, 0, :list, []}])
iex> match?({:type, _, :list, [{:type, _, :tuple, [{:type, _, :atom, []}, {:type, _, :list, []}]}]}, t)
true