PolyFuncType#
- class hugr.tys.PolyFuncType(params: list[TypeParam], body: FunctionType)[source]#
Bases:
Type
Polymorphic function type or type scheme. Defined by a list of type parameters that may appear in the
FunctionType
body.Methods
Generate an empty polymorphic function type.
Resolve types in the polymorphic function type using the given registry.
The
TypeTypeArg
for this type.The bound of this type.
Attributes
params
body
- classmethod empty() PolyFuncType [source]#
Generate an empty polymorphic function type.
Example
>>> PolyFuncType.empty() PolyFuncType(params=[], body=FunctionType([], []))
- resolve(registry: ext.ExtensionRegistry) PolyFuncType [source]#
Resolve types in the polymorphic function type using the given registry.
- type_arg() TypeTypeArg #
The
TypeTypeArg
for this type.Example
>>> Qubit.type_arg() TypeTypeArg(ty=Qubit)