Skip to main content

arith

Function arith 

Source
pub fn arith<V: TowerValue>(
    op: Op,
    left: &V,
    right: &V,
    recurse: &dyn Fn(Op, V, V) -> Result<V, String>,
) -> Option<Result<V, String>>
Expand description

Apply op when either operand is an exact type; None when neither is (the tower handles it), and for + with a Text operand, which joins the other value as it prints by the value model’s own rule for every value. recurse is the value model’s full arithmetic, used to lift an operation over residue branches and through provisional values.