use core::marker::Tuple;
use crate::Curried;
pub trait Curriable<C, X: Tuple> = Curry<C, Output: FnOnce<X>>;
pub const trait Curry<C>: Sized
{
type Output;
fn curry_once(self, arg: C) -> Self::Output;
fn curry_mut(&mut self, arg: C) -> <&mut Self as Curry<C>>::Output
{
self.curry_once(arg)
}
fn curry(&self, arg: C) -> <&Self as Curry<C>>::Output
{
self.curry_once(arg)
}
}
impl<C, F> const Curry<C> for F
{
type Output = Curried<(C,), (), F>;
fn curry_once(self, arg: C) -> Self::Output
{
Curried::curry(self, arg)
}
}