Add arithmetic constraints to Indigo Expr
Clarification and motivation
In Lorentz we have an Lorentz.Arith
module that contains both of the arithmetic constraints and their instances.
However to use them in Indigo Expr
essions (or functions that use them) we need to add additional constraints every time.
This can be simplified by collecting all the constraints in one place (Indigo.Internal.Expr.Types
and using them where necessary.
For example, UnaryArithOpHs a b
in Indigo
Expr
s is always accompanying IsExpr ex b
and TypeValue (UnaryArithResHs a b)
, so we can make a type synonym for it:
type IsUnaryArithExpr a b = (IsExpr a b, UnaryArithOpHs a b, TypeValue (UnaryArithResHs a b))
we should also consider if it would be worth to create (for parallelism):
type UnaryArithResExpr a b = Expr (UnaryArithResHs a b)
The names above are the ones I suggest and the same should be done for ArithOpHs
.
Acceptance criteria
Indigo.Internal.Expr.Types
contains and exports constraint types parallel to the ones in Loretz.Arith
that collect all the constraints necessary to use them with Expr
essions.