hydra.reflect module

Reflection functions for working with term, type, and literal type variants, as well as numeric precision.

hydra.reflect.float_type_precision(v1: FloatType) → Precision

Find the precision of a given floating-point type.

hydra.reflect.float_value_type(v1: FloatValue) → FloatType

Find the float type for a given floating-point value.

hydra.reflect.integer_type_is_signed(v1: IntegerType) → bool

Find whether a given integer type is signed (true) or unsigned (false).

hydra.reflect.integer_type_precision(v1: IntegerType) → Precision

Find the precision of a given integer type.

hydra.reflect.integer_value_type(v1: IntegerValue) → IntegerType

Find the integer type for a given integer value.

hydra.reflect.literal_type(v1: Literal) → LiteralType

Find the literal type for a given literal value.

hydra.reflect.literal_type_variant(v1: LiteralType) → LiteralVariant

Find the literal type inject (constructor) for a given literal value.

hydra.reflect.literal_types() → Sequence[LiteralType]

All literal types, in a canonical order.

hydra.reflect.literal_variant(arg_: Literal) → LiteralVariant

Find the literal inject (constructor) for a given literal value.

hydra.reflect.term_variant(v1: Term) → TermVariant

Find the term inject (constructor) for a given term.

hydra.reflect.type_variant(v1: Type) → TypeVariant

Find the type inject (constructor) for a given type.