Function canrun::goals::ops::add

source ·
pub fn add<T, A, B, C>(a: A, b: B, c: C) -> impl Goalwhere
    T: Add<Output = T> + Sub<Output = T> + Unify + Copy,
    A: Into<Value<T>>,
    B: Into<Value<T>>,
    C: Into<Value<T>>,
Expand description

Add two values together.

Example:

use canrun::{unify, LVar, Query};
use canrun::ops::add;

let x = LVar::new();
let goal = add(1, 2, x);
let results: Vec<_> = goal.query(x).collect();
assert_eq!(results, vec![3]);