rsdiff-core 0.0.2

This is the core library for the Acme project. It contains the core primitives that are used throughout the project.
Documentation
/*
    Appellation: evaluate <traits>
    Contrib: FL03 <jo3mccain@icloud.com>
*/
use crate::ops::{Operator, Params};

pub trait Evaluate<Args>
where
    Self: Operator,
    Args: Params,
{
    type Output;

    fn eval(&self, args: Args) -> Self::Output;
}

pub trait Differentiable<Args>
where
    Self: Evaluate<Args>,
    Args: Params,
{
    type Grad;

    fn grad(&self, args: Args) -> Self::Grad;
}

pub trait FnArgs {
    type Kind;
}

pub struct Partial<T, F> {
    pub args: T,
    pub func: F,
}

impl<T, F> Partial<T, F>
where
    F: for<'a> Fn(&'a T) -> T,
{
    pub fn new(args: T, func: F) -> Self {
        Self { args, func }
    }
}