Sum#
- class hugr.val.Sum(tag: int, typ: Sum, vals: list[Value])[source]#
Bases:
Value
Sum-of-product value.
Example
>>> Sum(0, tys.Sum([[tys.Bool], [tys.Unit]]), [TRUE]) Sum(tag=0, typ=Sum([[Bool], [Unit]]), vals=[TRUE])
Methods
Report the type of the value.
Attributes
n_variants
Tag identifying the variant.
defines all possible variants.
The values of this variant row.