Index
Docstrings for the TypeParameterAccessors.jl public API.
Contents
Index
TypeParameterAccessors.PositionTypeParameterAccessors.default_type_parametersTypeParameterAccessors.get_type_parametersTypeParameterAccessors.is_parameter_specifiedTypeParameterAccessors.nparametersTypeParameterAccessors.positionTypeParameterAccessors.set_default_type_parametersTypeParameterAccessors.set_type_parametersTypeParameterAccessors.specify_default_type_parametersTypeParameterAccessors.specify_type_parametersTypeParameterAccessors.type_parametersTypeParameterAccessors.unspecify_type_parameters
Type parameter interface
TypeParameterAccessors.position — Function
position(type::Type, position_name)::PositionAn optional interface function. Defining this allows accessing a parameter at the defined position using the position_name.
For example, defining TypeParameterAccessors.position(::Type{<:MyType}, ::typeof(eltype)) = Position(1) allows accessing the first type parameter with type_parameters(MyType(...), eltype), in addition to the standard type_parameters(MyType(...), 1) or type_parameters(MyType(...), Position(1)).
TypeParameterAccessors.Position — Type
struct Position{P} endSingleton type to statically represent the type-parameter position. This is meant for internal use as a Val-like structure to improve type-inference.
TypeParameterAccessors.type_parameters — Function
type_parameters(type_or_obj, [pos])Return a tuple containing the type parameters of a given type or object. Optionally you can specify a position to just get the parameter for that position, or a tuple of positions to get a subset of parameters.
Errors if parameters are unspecified. For an unchecked version, see get_type_parameters.
TypeParameterAccessors.get_type_parameters — Function
get_type_parameters(type_or_obj, [pos])Return a tuple containing the type parameters of a given type or object. Optionally you can specify a position to just get the parameter for that position, or a tuple of positions to get a subset of parameters.
If parameters are unspecified, returns a TypeVar. For a checked version, see type_parameters.
TypeParameterAccessors.default_type_parameters — Function
default_type_parameters(type::Type)::TupleAn optional interface function. Defining this allows filling type parameters of the specified type with default values.
This function should output a Tuple of the default values, with exactly one for each type parameter slot of the type.
TypeParameterAccessors.nparameters — Function
nparameters(type_or_obj)Return the number of type parameters for a given type or object.
TypeParameterAccessors.is_parameter_specified — Function
isparameterspecified(type::Type, pos)
Return whether or not the type parameter at a given position is considered specified.
TypeParameterAccessors.unspecify_type_parameters — Function
unspecify_type_parameters(type::Type, [positions::Tuple])
unspecify_type_parameters(type::Type, position)Return a new type where the type parameters at the given positions are unset.
TypeParameterAccessors.set_type_parameters — Function
set_type_parameters(type::Type, positions::Tuple, parameters::Tuple)
set_type_parameters(type::Type, position, parameter)Return a new type where the type parameters at the given positions are set to the provided values.
TypeParameterAccessors.set_default_type_parameters — Function
setdefaulttypeparameters(type::Type, [positions::Tuple]) setdefaulttypeparameters(type::Type, position)
Set the type parameters at the given positions to their default values.
TypeParameterAccessors.specify_type_parameters — Function
specify_type_parameters(type::Type, positions::Tuple, parameters::Tuple)
specify_type_parameters(type::Type, position, parameter)Return a new type where the type parameters at the given positions are set to the provided values, only if they were previously unspecified.
TypeParameterAccessors.specify_default_type_parameters — Function
specify_default_type_parameters(type::Type, [positions::Tuple])
specify_default_type_parameters(type::Type, position)Set the type parameters at the given positions to their default values, if they had not been specified.