Module arithmetic_typing::arith[][src]

Expand description

Types allowing to customize various aspects of the type system, such as type constraints and behavior of unary / binary ops.

Structs

BinaryOpContext

Code spans related to a binary operation.

BoolArithmetic

Simplest TypeArithmetic implementation that defines unary / binary ops only on the Boolean type. Useful as a building block for more complex arithmetics.

ConstraintSet

Set of Constraints.

Linearity

Constraint for numeric types that can be subject to unary - and can participate in T op Num / Num op T operations.

NumArithmetic

Arithmetic on Numbers.

OpConstraintSettings

Settings for constraints placed on arguments of binary arithmetic operations.

Ops

Constraint for numeric types that can participate in binary arithmetic ops (T op T).

StructConstraint

Helper to define structural Constraints, i.e., constraints recursively checking the provided type.

Substitutions

Set of equations and constraints on type variables.

UnaryOpContext

Code spans related to a unary operation.

Enums

Num

Primitive types for the numeric arithmetic: Numeric type and Boolean.

Traits

Constraint

Constraint that can be placed on Types.

LinearType

Primitive type which supports a notion of linearity. Linear types are types that can be used in arithmetic ops.

MapPrimitiveType

Maps a literal value from a certain Grammar to its type. This assumes that all literals are primitive.

ObjectSafeConstraint

Marker trait for object-safe constraints, i.e., constraints that can be included into a DynConstraints.

TypeArithmetic

Arithmetic allowing to customize primitive types and how unary and binary operations are handled during type inference.

WithBoolean

PrimitiveType that has Boolean type as one of its variants.