Module arithmetic_typing::arith
source · Expand description
Types allowing to customize various aspects of the type system, such as type constraints and behavior of unary / binary ops.
Structs§
- Code spans related to a binary operation.
- Simplest
TypeArithmetic
implementation that defines unary / binary ops only on the Boolean type. Useful as a building block for more complex arithmetics. - Set of
Constraint
s. Constraint
for numeric types that can be subject to unary-
and can participate inT op Num
/Num op T
operations.- Arithmetic on
Num
bers. - Settings for constraints placed on arguments of binary arithmetic operations.
Constraint
for numeric types that can participate in binary arithmetic ops (T op T
).- Helper to define structural
Constraint
s, i.e., constraints recursively checking the provided type. - Set of equations and constraints on type variables.
- Code spans related to a unary operation.
Enums§
- Primitive types for the numeric arithmetic:
Num
eric type andBool
ean.
Traits§
- Constraint that can be placed on
Type
s. - Primitive type which supports a notion of linearity. Linear types are types that can be used in arithmetic ops.
- Maps a literal value from a certain
Grammar
to its type. This assumes that all literals are primitive. - Marker trait for object-safe constraints, i.e., constraints that can be included into a
DynConstraints
. - Arithmetic allowing to customize primitive types and how unary and binary operations are handled during type inference.
PrimitiveType
that has Boolean type as one of its variants.