pub enum Validated<T, E> {
    Valid(T),
    Invalid(E),
}
Expand description

Validated is a type that represents either a Valid value or an error(Invalid).

See the module-level documentation for more details.

Variants§

§

Valid(T)

Contains a valid value.

§

Invalid(E)

Contains the error.

Implementations§

source§

impl<T, E> Validated<T, E>

source

pub const fn is_valid(&self) -> bool

Returns true if the Validated is Valid.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(1);
assert_eq!(x.is_valid(), true);

let x: Validated<i32, &str> = Invalid("error");
assert_eq!(x.is_valid(), false);
source

pub const fn is_invalid(&self) -> bool

Returns true if the Validated is Invalid.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(1);
assert_eq!(x.is_invalid(), false);

let x: Validated<i32, &str> = Invalid("error");
assert_eq!(x.is_invalid(), true);
source

pub fn valid(self) -> Option<T>

Converts from Validated<T, E> to Option<T>.

Converts self into an Option<T>, consuming self, and discarding the error, if any.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(1);
assert_eq!(x.valid(), Some(1));

let x: Validated<i32, &str> = Invalid("error");
assert_eq!(x.valid(), None);
source

pub fn invalid(self) -> Option<E>

Converts from Validated<T, E> to Option<E>.

Converts self into an Option<E>, consuming self, and discarding the value, if any.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(1);
assert_eq!(x.invalid(), None);

let x: Validated<i32, &str> = Invalid("error");
assert_eq!(x.invalid(), Some("error"));
source

pub fn into_result(self) -> Result<T, E>

Converts from Validated<T, E> to Result<T, E>.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(1);
assert_eq!(x.into_result(), Ok(1));

let x: Validated<i32, &str> = Invalid("error");
assert_eq!(x.into_result(), Err("error"));
source

pub const fn as_ref(&self) -> Validated<&T, &E>

Converts from &Validated<T, E> to Validated<&T, &E>.

Produces a new Validated, containing a reference into the original, leaving the original in place.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(1);
assert_eq!(x.as_ref(), Valid(&1));

let x: Validated<i32, &str> = Invalid("error");
assert_eq!(x.as_ref(), Invalid(&"error"));
source

pub fn as_mut(&mut self) -> Validated<&mut T, &mut E>

Converts from &mut Validated<T, E> to Validated<&mut T, &mut E>.

Examples
use rust2fun::prelude::*;

fn mutate(x: &mut Validated<i32, i32>) {
   match x.as_mut() {
      Valid(x) => *x = 1,
      Invalid(x) => *x = 2,
  }
}

let mut x = Valid(-1);
mutate(&mut x);
assert_eq!(x, Valid(1));

let mut x = Invalid(-2);
mutate(&mut x);
assert_eq!(x, Invalid(2));
source

pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Validated<U, E>

Maps a Validated<T, E> to Validated<U, E> by applying a function to a contained Valid value, leaving an Invalid value untouched.

This function can be used to compose the results of two functions.

Examples
use rust2fun::prelude::*;

fn square(x: i32) -> i32 { x * x }

let x: Validated<i32, &str> = Valid(2);
assert_eq!(x.map(square), Valid(4));

let x: Validated<i32, &str> = Invalid("error");
assert_eq!(x.map(square), Invalid("error"));
source

pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U

Returns the provided default (if Invalid), or applies a function to the contained value (if Valid).

Arguments passed to map_or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use map_or_else, which is lazily evaluated.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(2);
assert_eq!(x.map_or(0, |v| v * 2), 4);

let x: Validated<i32, &str> = Invalid("error");
assert_eq!(x.map_or(0, |v| v * 2), 0);
source

pub fn map_or_else<U, D: FnOnce(E) -> U, F: FnOnce(T) -> U>( self, default: D, f: F ) -> U

Maps a Validated<T, E> to U by applying fallback function default to a contained Invalid value, or a function f to a contained Valid value.

This function can be used to unpack a successful result while handling an error.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(2);
assert_eq!(x.map_or_else(|e| e.len() as i32, |v| v * 2), 4);

let x: Validated<i32, &str> = Invalid("error");
assert_eq!(x.map_or_else(|e| e.len() as i32, |v| v * 2), 5);
source

pub fn map_err<U, F: FnOnce(E) -> U>(self, f: F) -> Validated<T, U>

Maps a Validated<T, E> to Validated<T, U> by applying a function to a contained Invalid value, leaving a Valid value untouched.

This function can be used to pass through a successful result while handling an error.

Examples
use rust2fun::prelude::*;

fn stringify(x: i32) -> String { format!("error code: {x}") }

let x: Validated<i32, i32> = Valid(2);
assert_eq!(x.map_err(stringify), Valid(2));

let x: Validated<i32, i32> = Invalid(13);
assert_eq!(x.map_err(stringify), Invalid("error code: 13".to_string()));
source

pub fn as_deref(&self) -> Validated<&T::Target, &E>where T: Deref,

Converts from Validated<T, E> (or &Validated<T, E>) to Validated<&<T as Deref>::Target, &E>.

Coerces the Valid variant of a Validated via Deref and returns the new Validated.

Examples
use rust2fun::prelude::*;

let x: Validated<String, u32> = Valid("hello".to_string());
let y: Validated<&str, &u32> = Valid("hello");
assert_eq!(x.as_deref(), y);

let x: Validated<String, u32> = Invalid(42);
let y: Validated<&str, &u32> = Invalid(&42);
assert_eq!(x.as_deref(), y);
source

pub fn as_deref_mut(&mut self) -> Validated<&mut T::Target, &mut E>where T: DerefMut,

Converts from Validated<T, E> (or &mut Validated<T, E>) to Validated<&mut <T as Deref>::Target, &mut E>.

Coerces the Valid variant of a Validated via DerefMut and returns the new Validated.

Examples
use rust2fun::prelude::*;

let mut s = "HELLO".to_string();
let mut x: Validated<String, u32> = Valid("hello".to_string());
let y: Validated<&mut str, &mut u32> = Valid(&mut s);
assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);

let mut i = 42;
let mut x: Validated<String, u32> = Invalid(42);
let y: Validated<&mut str, &mut u32> = Invalid(&mut i);
assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
source

pub fn expect(self, msg: &str) -> Twhere E: Debug,

Returns the contained Valid value, consuming the self value.

Because this function may panic, its use is generally discouraged. Instead, prefer to use pattern matching and handle the Invalid case explicitly, or call unwrap_or, unwrap_or_else, or unwrap_or_default.

Panics

Panics if the value is an Invalid with a panic message provided by the passed message, and the content of the Invalid.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Invalid("emergency failure");
x.expect("Testing expect"); // panics with `Testing expect: emergency failure`
source

pub fn unwrap(self) -> Twhere E: Debug,

Returns the contained Valid value, consuming the self value.

Because this function may panic, its use is generally discouraged. Instead, prefer to use pattern matching and handle the Invalid case explicitly, or call unwrap_or, unwrap_or_else, or unwrap_or_default.

Panics

Panics if the value is an Invalid with a panic message provided by the content of the Invalid.

Examples

Basic usage:

use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(2);
assert_eq!(x.unwrap(), 2);
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Invalid("emergency failure");
x.unwrap(); // panics with `emergency failure`
source

pub fn unwrap_or_default(self) -> Twhere T: Default,

Returns the contained Valid value, consuming the self value.

Consumes the self argument then, if Valid, returns the contained value, otherwise if Invalid, returns default value for T.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(2);
assert_eq!(x.unwrap_or_default(), 2);

let x: Validated<i32, &str> = Invalid("error");
assert_eq!(x.unwrap_or_default(), 0);
source

pub fn expect_err(self, msg: &str) -> Ewhere T: Debug,

Returns the contained Invalid value, consuming the self value.

Panics

Panics if the value is an Valid with a panic message provided by the passed message, and the content of the Valid.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(2);
x.expect_err("Testing expect_err"); // panics with `Testing expect_err: 2`
source

pub fn unwrap_err(self) -> Ewhere T: Debug,

Returns the contained Invalid value, consuming the self value.

Panics

Panics if the value is an Valid with a panic message provided by the content of the Valid.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(2);
x.unwrap_err(); // panics with `2`
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Invalid("error");
assert_eq!(x.unwrap_err(), "error");
source

pub fn and<U>(self, other: Validated<U, E>) -> Validated<U, E>

Returns other if the result is Valid, otherwise returns the Invalid value of self.

Arguments passed to and are eagerly evaluated; if you are passing the result of a function call, it is recommended to use and_then, which is lazily evaluated.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(2);
let y: Validated<&str, &str> = Invalid("late error");
assert_eq!(x.and(y), Invalid("late error"));

let x: Validated<i32, &str> = Invalid("early error");
let y: Validated<&str, &str> = Valid("foo");
assert_eq!(x.and(y), Invalid("early error"));

let x: Validated<i32, &str> = Invalid("not a 2");
let y: Validated<&str, &str> = Invalid("late error");
assert_eq!(x.and(y), Invalid("not a 2"));

let x: Validated<i32, &str> = Valid(2);
let y: Validated<&str, &str> = Valid("different result type");
assert_eq!(x.and(y), Valid("different result type"));
source

pub fn and_then<U, F: FnOnce(T) -> Validated<U, E>>( self, f: F ) -> Validated<U, E>

Calls f if the result is Valid, otherwise returns the Invalid value of self.

This allows “chained” validation: the output of one validation can be fed into another validation function.

This function has a “fail-fast” behaviour, meaning that it will stop execution on the first Invalid value. This makes it inconsistent with Apply::ap or other similar Apply-based functions.

Examples
use rust2fun::prelude::*;

fn sq_then_to_string(x: u32) -> Validated<String, &'static str> {
    x.checked_mul(x).map(|sq| sq.to_string()).ok_or("overflowed").into()
}

assert_eq!(Valid(2).and_then(sq_then_to_string), Valid(4.to_string()));
assert_eq!(Valid(1_000_000).and_then(sq_then_to_string), Invalid("overflowed"));
assert_eq!(Invalid("invalid").and_then(sq_then_to_string), Invalid("invalid"));
source

pub fn or<U>(self, other: Validated<T, U>) -> Validated<T, U>

Returns other if the result is Invalid, otherwise returns the Valid value of self.

Arguments passed to or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use or_else, which is lazily evaluated.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(2);
let y: Validated<i32, &str> = Invalid("late error");
assert_eq!(x.or(y), Valid(2));

let x: Validated<i32, &str> = Invalid("early error");
let y: Validated<i32, &str> = Valid(2);
assert_eq!(x.or(y), Valid(2));

let x: Validated<i32, &str> = Invalid("not a 2");
let y: Validated<i32, &str> = Invalid("late error");
assert_eq!(x.or(y), Invalid("late error"));

let x: Validated<i32, &str> = Valid(2);
let y: Validated<i32, &str> = Valid(100);
assert_eq!(x.or(y), Valid(2));
source

pub fn or_else<U, F: FnOnce(E) -> Validated<T, U>>( self, f: F ) -> Validated<T, U>

Calls f if the result is Invalid, otherwise returns the Valid value of self.

This function can be used for control flow based on Validated values.

Examples
use rust2fun::prelude::*;

fn sq(x: u32) -> Validated<u32, u32> { Valid(x * x) }
fn err(x: u32) -> Validated<u32, u32> { Invalid(x) }

assert_eq!(Valid(2).or_else(sq).or_else(sq), Valid(2));
assert_eq!(Valid(2).or_else(err).or_else(sq), Valid(2));
assert_eq!(Invalid(3).or_else(sq).or_else(err), Valid(9));
assert_eq!(Invalid(3).or_else(err).or_else(err), Invalid(3));
source

pub fn unwrap_or(self, default: T) -> T

Returns the contained Valid value or a provided default.

Arguments passed to unwrap_or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use unwrap_or_else, which is lazily evaluated.

Examples
use rust2fun::prelude::*;

let x: Validated<i32, &str> = Valid(2);
assert_eq!(x.unwrap_or(0), 2);

let x: Validated<i32, &str> = Invalid("error");
assert_eq!(x.unwrap_or(0), 0);
source

pub fn unwrap_or_else<F: FnOnce(E) -> T>(self, f: F) -> T

Returns the contained Valid value or computes it from a closure.

Examples
use rust2fun::prelude::*;

fn count(x: &str) -> usize { x.len() }
assert_eq!(Valid(2).unwrap_or_else(count), 2);
assert_eq!(Invalid("foo").unwrap_or_else(count), 3);

Trait Implementations§

source§

impl<A, B, E> AndThen<B> for Validated<A, E>

source§

fn and_then<F>(self, f: F) -> Validated<B, E>where F: FnMut(A) -> Validated<B, E>,

Maps a function over a value in the context and flattens the resulting nested context.
source§

impl<F, A, B, E: Semigroup> Apply<A, B> for Validated<F, E>

source§

fn ap(self, fa: Validated<A, E>) -> Validated<B, E>where F: FnOnce(A) -> B,

Apply a function in a context to a value in a context. Read more
source§

impl<A, B, C, D> Bifunctor<C, D> for Validated<A, B>

source§

fn bimap(self, f: impl FnMut(A) -> C, g: impl FnMut(B) -> D) -> Validated<C, D>

Transform a Self<A, B> into a Self<C, D> by providing a transformation from A to C and from ‘B’ to ‘D’
source§

impl<T, E> Clone for Validated<T, E>where T: Clone, E: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug, E: Debug> Debug for Validated<T, E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T, E> From<Result<T, E>> for Validated<T, E>

source§

fn from(result: Result<T, E>) -> Self

Converts to this type from the input type.
source§

impl<T, E> From<Validated<T, E>> for Result<T, E>

source§

fn from(validated: Validated<T, E>) -> Self

Converts to this type from the input type.
source§

impl<T, E> From<Validated<T, E>> for ValidatedNev<T, E>

source§

fn from(validated: Validated<T, E>) -> Self

Converts to this type from the input type.
source§

impl<A, B, E> Functor<B> for Validated<A, E>

source§

fn map(self, f: impl FnMut(A) -> B) -> Validated<B, E>

Transform a Self<A> into a Self<B> by providing a transformation from A to B. Read more
source§

fn fmap<F>(self, f: F) -> Self::Target<B>where F: FnMut(Self::Param) -> B, Self: Sized,

Alias for Functor::map if the implementing type already had a built-in .map method.
source§

fn fproduct<F>(self, f: F) -> Self::Target<(Self::Param, B)>where F: FnMut(&Self::Param) -> B, Self: Functor<(<Self as Higher>::Param, B)> + Sized,

Tuple the values in Self<A> with the result of applying a function with the value. Read more
source§

fn fproduct_left<F>(self, f: F) -> Self::Target<(B, Self::Param)>where F: FnMut(&Self::Param) -> B, Self: Functor<(B, <Self as Higher>::Param)> + Sized,

Pair the result of function application with the values in Self<A>. Read more
source§

impl<T: Hash, E: Hash> Hash for Validated<T, E>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<P, E> Higher for Validated<P, E>

§

type Param = P

Type parameter abstracted by Higher, e.g. Option<Param>.
§

type Target<T> = Validated<T, E>

Swapped higher type, e.g. Target = Option<T>.
source§

fn unsafe_cast<T, R>(self) -> Rwhere Self: Higher<Param = T> + Sized, R: Higher<Param = T>,

Unsafe cast from one Higher type to another. This is a safe operation as long as the resulting type is the same as the original type. Might be useful for building abstractions.
source§

impl<T, E> Higher2 for Validated<T, E>

§

type Param1 = T

First type parameter abstracted by Higher2, e.g. Result<Param1, _>.
§

type Param2 = E

Second type parameter abstracted by Higher2, e.g. Result<_, Param2>.
§

type Target<TV, TE> = Validated<TV, TE>

Swapped higher type for 2 types, e.g. Target = Result<T1, T2>.
source§

impl<B, T, E> Invariant<B> for Validated<T, E>

source§

fn imap<F, G>(self, f: F, _g: G) -> Self::Target<B>where F: FnMut(Self::Param) -> B, G: FnMut(B) -> Self::Param,

Transform a Self<A> into a Self<B> by providing a transformation from A to B and one from B to A. Read more
source§

impl<T: Ord, E: Ord> Ord for Validated<T, E>

source§

fn cmp(&self, other: &Validated<T, E>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<T: PartialEq, E: PartialEq> PartialEq<Validated<T, E>> for Validated<T, E>

source§

fn eq(&self, other: &Validated<T, E>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: PartialOrd, E: PartialOrd> PartialOrd<Validated<T, E>> for Validated<T, E>

source§

fn partial_cmp(&self, other: &Validated<T, E>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<A, E: Semigroup> Pure for Validated<A, E>

source§

fn pure(x: A) -> Self

Lift a value into a context. Read more
source§

impl<T: Semigroup, E: Semigroup> Semigroup for Validated<T, E>

source§

fn combine(self, other: Self) -> Self

Associative operation which combines two values. Read more
source§

fn combine_all_option<I>(iter: I) -> Option<Self>where I: IntoIterator<Item = Self>, Self: Sized,

Combine all values in the iterator and return the total. If the sequence is empty, returns None. Otherwise, returns Some(total). Read more
source§

impl<A, B, E: Semigroup> Semigroupal<B> for Validated<A, E>

source§

fn product(self, fb: Validated<B, E>) -> Validated<(A, B), E>

Combine two effectful values into a single effectful value maintaining the effects of both. Read more
source§

impl<T: Copy, E: Copy> Copy for Validated<T, E>

source§

impl<T: Eq, E: Eq> Eq for Validated<T, E>

source§

impl<T, E> StructuralEq for Validated<T, E>

source§

impl<T, E> StructuralPartialEq for Validated<T, E>

Auto Trait Implementations§

§

impl<T, E> RefUnwindSafe for Validated<T, E>where E: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, E> Send for Validated<T, E>where E: Send, T: Send,

§

impl<T, E> Sync for Validated<T, E>where E: Sync, T: Sync,

§

impl<T, E> Unpin for Validated<T, E>where E: Unpin, T: Unpin,

§

impl<T, E> UnwindSafe for Validated<T, E>where E: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<Z, T> ApN<Z> for Twhere T: AndThen<Z>,

source§

fn ap2<A, B>(self, fa: Self::Target<A>, fb: Self::Target<B>) -> Self::Target<Z>where Self::Param: FnMut(A, B) -> Z, Self::Target<A>: Semigroupal<B, Target<B> = Self::Target<B>> + Higher<Target<(A, B)> = Self::Target<(A, B)>>, Self::Target<(A, B)>: Functor<Z, Target<Z> = Self::Target<Z>> + Clone, Self: Sized,

Is a binary version of Apply::ap. Read more
source§

fn ap3<A, B, C>( self, fa: Self::Target<A>, fb: Self::Target<B>, fc: Self::Target<C> ) -> Self::Target<Z>where Self::Param: FnMut(A, B, C) -> Z, Self::Target<A>: Semigroupal<B, Target<B> = Self::Target<B>> + Higher<Target<(A, B)> = Self::Target<(A, B)>>, Self::Target<(A, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((A, B), C)> = Self::Target<((A, B), C)>>, Self::Target<((A, B), C)>: Functor<Z, Target<Z> = Self::Target<Z>> + Clone, Self: Sized,

Is a ternary version of Apply::ap. Read more
source§

fn ap4<A, B, C, D>( self, fa: Self::Target<A>, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D> ) -> Self::Target<Z>where Self::Param: FnMut(A, B, C, D) -> Z, Self: Sized, Self::Target<A>: Semigroupal<B, Target<B> = Self::Target<B>> + Higher<Target<(A, B)> = Self::Target<(A, B)>>, Self::Target<(A, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((A, B), C)> = Self::Target<((A, B), C)>>, Self::Target<((A, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((A, B), C), D)> = Self::Target<(((A, B), C), D)>>, Self::Target<(((A, B), C), D)>: Functor<Z, Target<Z> = Self::Target<Z>> + Clone,

Is a version of [Apply::ap] for a function of 4 arguments.
source§

fn ap5<A, B, C, D, E>( self, fa: Self::Target<A>, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E> ) -> Self::Target<Z>where Self::Param: FnMut(A, B, C, D, E) -> Z, Self: Sized, Self::Target<A>: Semigroupal<B, Target<B> = Self::Target<B>> + Higher<Target<(A, B)> = Self::Target<(A, B)>>, Self::Target<(A, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((A, B), C)> = Self::Target<((A, B), C)>>, Self::Target<((A, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((A, B), C), D)> = Self::Target<(((A, B), C), D)>>, Self::Target<(((A, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((A, B), C), D), E)> = Self::Target<((((A, B), C), D), E)>>, Self::Target<((((A, B), C), D), E)>: Functor<Z, Target<Z> = Self::Target<Z>> + Clone,

Is a version of [Apply::ap] for a function of 5 arguments.
source§

fn ap6<A, B, C, D, E, F>( self, fa: Self::Target<A>, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F> ) -> Self::Target<Z>where Self::Param: FnMut(A, B, C, D, E, F) -> Z, Self: Sized, Self::Target<A>: Semigroupal<B, Target<B> = Self::Target<B>> + Higher<Target<(A, B)> = Self::Target<(A, B)>>, Self::Target<(A, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((A, B), C)> = Self::Target<((A, B), C)>>, Self::Target<((A, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((A, B), C), D)> = Self::Target<(((A, B), C), D)>>, Self::Target<(((A, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((A, B), C), D), E)> = Self::Target<((((A, B), C), D), E)>>, Self::Target<((((A, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((A, B), C), D), E), F)> = Self::Target<(((((A, B), C), D), E), F)>>, Self::Target<(((((A, B), C), D), E), F)>: Functor<Z, Target<Z> = Self::Target<Z>> + Clone,

Is a version of [Apply::ap] for a function of 6 arguments.
source§

fn ap7<A, B, C, D, E, F, G>( self, fa: Self::Target<A>, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, fg: Self::Target<G> ) -> Self::Target<Z>where Self::Param: FnMut(A, B, C, D, E, F, G) -> Z, Self: Sized, Self::Target<A>: Semigroupal<B, Target<B> = Self::Target<B>> + Higher<Target<(A, B)> = Self::Target<(A, B)>>, Self::Target<(A, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((A, B), C)> = Self::Target<((A, B), C)>>, Self::Target<((A, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((A, B), C), D)> = Self::Target<(((A, B), C), D)>>, Self::Target<(((A, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((A, B), C), D), E)> = Self::Target<((((A, B), C), D), E)>>, Self::Target<((((A, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((A, B), C), D), E), F)> = Self::Target<(((((A, B), C), D), E), F)>>, Self::Target<(((((A, B), C), D), E), F)>: Semigroupal<G, Target<G> = Self::Target<G>> + Higher<Target<((((((A, B), C), D), E), F), G)> = Self::Target<((((((A, B), C), D), E), F), G)>>, Self::Target<((((((A, B), C), D), E), F), G)>: Functor<Z, Target<Z> = Self::Target<Z>> + Clone,

Is a version of [Apply::ap] for a function of 7 arguments.
source§

fn ap8<A, B, C, D, E, F, G, H>( self, fa: Self::Target<A>, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, fg: Self::Target<G>, fh: Self::Target<H> ) -> Self::Target<Z>where Self::Param: FnMut(A, B, C, D, E, F, G, H) -> Z, Self: Sized, Self::Target<A>: Semigroupal<B, Target<B> = Self::Target<B>> + Higher<Target<(A, B)> = Self::Target<(A, B)>>, Self::Target<(A, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((A, B), C)> = Self::Target<((A, B), C)>>, Self::Target<((A, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((A, B), C), D)> = Self::Target<(((A, B), C), D)>>, Self::Target<(((A, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((A, B), C), D), E)> = Self::Target<((((A, B), C), D), E)>>, Self::Target<((((A, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((A, B), C), D), E), F)> = Self::Target<(((((A, B), C), D), E), F)>>, Self::Target<(((((A, B), C), D), E), F)>: Semigroupal<G, Target<G> = Self::Target<G>> + Higher<Target<((((((A, B), C), D), E), F), G)> = Self::Target<((((((A, B), C), D), E), F), G)>>, Self::Target<((((((A, B), C), D), E), F), G)>: Semigroupal<H, Target<H> = Self::Target<H>> + Higher<Target<(((((((A, B), C), D), E), F), G), H)> = Self::Target<(((((((A, B), C), D), E), F), G), H)>>, Self::Target<(((((((A, B), C), D), E), F), G), H)>: Functor<Z, Target<Z> = Self::Target<Z>> + Clone,

Is a version of [Apply::ap] for a function of 8 arguments.
source§

fn ap9<A, B, C, D, E, F, G, H, I>( self, fa: Self::Target<A>, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, fg: Self::Target<G>, fh: Self::Target<H>, fi: Self::Target<I> ) -> Self::Target<Z>where Self::Param: FnMut(A, B, C, D, E, F, G, H, I) -> Z, Self: Sized, Self::Target<A>: Semigroupal<B, Target<B> = Self::Target<B>> + Higher<Target<(A, B)> = Self::Target<(A, B)>>, Self::Target<(A, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((A, B), C)> = Self::Target<((A, B), C)>>, Self::Target<((A, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((A, B), C), D)> = Self::Target<(((A, B), C), D)>>, Self::Target<(((A, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((A, B), C), D), E)> = Self::Target<((((A, B), C), D), E)>>, Self::Target<((((A, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((A, B), C), D), E), F)> = Self::Target<(((((A, B), C), D), E), F)>>, Self::Target<(((((A, B), C), D), E), F)>: Semigroupal<G, Target<G> = Self::Target<G>> + Higher<Target<((((((A, B), C), D), E), F), G)> = Self::Target<((((((A, B), C), D), E), F), G)>>, Self::Target<((((((A, B), C), D), E), F), G)>: Semigroupal<H, Target<H> = Self::Target<H>> + Higher<Target<(((((((A, B), C), D), E), F), G), H)> = Self::Target<(((((((A, B), C), D), E), F), G), H)>>, Self::Target<(((((((A, B), C), D), E), F), G), H)>: Semigroupal<I, Target<I> = Self::Target<I>> + Higher<Target<((((((((A, B), C), D), E), F), G), H), I)> = Self::Target<((((((((A, B), C), D), E), F), G), H), I)>>, Self::Target<((((((((A, B), C), D), E), F), G), H), I)>: Functor<Z, Target<Z> = Self::Target<Z>> + Clone,

Is a version of [Apply::ap] for a function of 9 arguments.
source§

fn ap10<A, B, C, D, E, F, G, H, I, J>( self, fa: Self::Target<A>, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, fg: Self::Target<G>, fh: Self::Target<H>, fi: Self::Target<I>, fj: Self::Target<J> ) -> Self::Target<Z>where Self::Param: FnMut(A, B, C, D, E, F, G, H, I, J) -> Z, Self: Sized, Self::Target<A>: Semigroupal<B, Target<B> = Self::Target<B>> + Higher<Target<(A, B)> = Self::Target<(A, B)>>, Self::Target<(A, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((A, B), C)> = Self::Target<((A, B), C)>>, Self::Target<((A, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((A, B), C), D)> = Self::Target<(((A, B), C), D)>>, Self::Target<(((A, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((A, B), C), D), E)> = Self::Target<((((A, B), C), D), E)>>, Self::Target<((((A, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((A, B), C), D), E), F)> = Self::Target<(((((A, B), C), D), E), F)>>, Self::Target<(((((A, B), C), D), E), F)>: Semigroupal<G, Target<G> = Self::Target<G>> + Higher<Target<((((((A, B), C), D), E), F), G)> = Self::Target<((((((A, B), C), D), E), F), G)>>, Self::Target<((((((A, B), C), D), E), F), G)>: Semigroupal<H, Target<H> = Self::Target<H>> + Higher<Target<(((((((A, B), C), D), E), F), G), H)> = Self::Target<(((((((A, B), C), D), E), F), G), H)>>, Self::Target<(((((((A, B), C), D), E), F), G), H)>: Semigroupal<I, Target<I> = Self::Target<I>> + Higher<Target<((((((((A, B), C), D), E), F), G), H), I)> = Self::Target<((((((((A, B), C), D), E), F), G), H), I)>>, Self::Target<((((((((A, B), C), D), E), F), G), H), I)>: Semigroupal<J, Target<J> = Self::Target<J>> + Higher<Target<(((((((((A, B), C), D), E), F), G), H), I), J)> = Self::Target<(((((((((A, B), C), D), E), F), G), H), I), J)>>, Self::Target<(((((((((A, B), C), D), E), F), G), H), I), J)>: Functor<Z, Target<Z> = Self::Target<Z>> + Clone,

Is a version of [Apply::ap] for a function of 10 arguments.
source§

fn ap11<A, B, C, D, E, F, G, H, I, J, K>( self, fa: Self::Target<A>, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, fg: Self::Target<G>, fh: Self::Target<H>, fi: Self::Target<I>, fj: Self::Target<J>, fk: Self::Target<K> ) -> Self::Target<Z>where Self::Param: FnMut(A, B, C, D, E, F, G, H, I, J, K) -> Z, Self: Sized, Self::Target<A>: Semigroupal<B, Target<B> = Self::Target<B>> + Higher<Target<(A, B)> = Self::Target<(A, B)>>, Self::Target<(A, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((A, B), C)> = Self::Target<((A, B), C)>>, Self::Target<((A, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((A, B), C), D)> = Self::Target<(((A, B), C), D)>>, Self::Target<(((A, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((A, B), C), D), E)> = Self::Target<((((A, B), C), D), E)>>, Self::Target<((((A, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((A, B), C), D), E), F)> = Self::Target<(((((A, B), C), D), E), F)>>, Self::Target<(((((A, B), C), D), E), F)>: Semigroupal<G, Target<G> = Self::Target<G>> + Higher<Target<((((((A, B), C), D), E), F), G)> = Self::Target<((((((A, B), C), D), E), F), G)>>, Self::Target<((((((A, B), C), D), E), F), G)>: Semigroupal<H, Target<H> = Self::Target<H>> + Higher<Target<(((((((A, B), C), D), E), F), G), H)> = Self::Target<(((((((A, B), C), D), E), F), G), H)>>, Self::Target<(((((((A, B), C), D), E), F), G), H)>: Semigroupal<I, Target<I> = Self::Target<I>> + Higher<Target<((((((((A, B), C), D), E), F), G), H), I)> = Self::Target<((((((((A, B), C), D), E), F), G), H), I)>>, Self::Target<((((((((A, B), C), D), E), F), G), H), I)>: Semigroupal<J, Target<J> = Self::Target<J>> + Higher<Target<(((((((((A, B), C), D), E), F), G), H), I), J)> = Self::Target<(((((((((A, B), C), D), E), F), G), H), I), J)>>, Self::Target<(((((((((A, B), C), D), E), F), G), H), I), J)>: Semigroupal<K, Target<K> = Self::Target<K>> + Higher<Target<((((((((((A, B), C), D), E), F), G), H), I), J), K)> = Self::Target<((((((((((A, B), C), D), E), F), G), H), I), J), K)>>, Self::Target<((((((((((A, B), C), D), E), F), G), H), I), J), K)>: Functor<Z, Target<Z> = Self::Target<Z>> + Clone,

Is a version of [Apply::ap] for a function of 11 arguments.
source§

fn ap12<A, B, C, D, E, F, G, H, I, J, K, L>( self, fa: Self::Target<A>, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, fg: Self::Target<G>, fh: Self::Target<H>, fi: Self::Target<I>, fj: Self::Target<J>, fk: Self::Target<K>, fl: Self::Target<L> ) -> Self::Target<Z>where Self::Param: FnMut(A, B, C, D, E, F, G, H, I, J, K, L) -> Z, Self: Sized, Self::Target<A>: Semigroupal<B, Target<B> = Self::Target<B>> + Higher<Target<(A, B)> = Self::Target<(A, B)>>, Self::Target<(A, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((A, B), C)> = Self::Target<((A, B), C)>>, Self::Target<((A, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((A, B), C), D)> = Self::Target<(((A, B), C), D)>>, Self::Target<(((A, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((A, B), C), D), E)> = Self::Target<((((A, B), C), D), E)>>, Self::Target<((((A, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((A, B), C), D), E), F)> = Self::Target<(((((A, B), C), D), E), F)>>, Self::Target<(((((A, B), C), D), E), F)>: Semigroupal<G, Target<G> = Self::Target<G>> + Higher<Target<((((((A, B), C), D), E), F), G)> = Self::Target<((((((A, B), C), D), E), F), G)>>, Self::Target<((((((A, B), C), D), E), F), G)>: Semigroupal<H, Target<H> = Self::Target<H>> + Higher<Target<(((((((A, B), C), D), E), F), G), H)> = Self::Target<(((((((A, B), C), D), E), F), G), H)>>, Self::Target<(((((((A, B), C), D), E), F), G), H)>: Semigroupal<I, Target<I> = Self::Target<I>> + Higher<Target<((((((((A, B), C), D), E), F), G), H), I)> = Self::Target<((((((((A, B), C), D), E), F), G), H), I)>>, Self::Target<((((((((A, B), C), D), E), F), G), H), I)>: Semigroupal<J, Target<J> = Self::Target<J>> + Higher<Target<(((((((((A, B), C), D), E), F), G), H), I), J)> = Self::Target<(((((((((A, B), C), D), E), F), G), H), I), J)>>, Self::Target<(((((((((A, B), C), D), E), F), G), H), I), J)>: Semigroupal<K, Target<K> = Self::Target<K>> + Higher<Target<((((((((((A, B), C), D), E), F), G), H), I), J), K)> = Self::Target<((((((((((A, B), C), D), E), F), G), H), I), J), K)>>, Self::Target<((((((((((A, B), C), D), E), F), G), H), I), J), K)>: Semigroupal<L, Target<L> = Self::Target<L>> + Higher<Target<(((((((((((A, B), C), D), E), F), G), H), I), J), K), L)> = Self::Target<(((((((((((A, B), C), D), E), F), G), H), I), J), K), L)>>, Self::Target<(((((((((((A, B), C), D), E), F), G), H), I), J), K), L)>: Functor<Z, Target<Z> = Self::Target<Z>> + Clone,

Is a version of [Apply::ap] for a function of 12 arguments.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, B> MapN<B> for Twhere T: Semigroupal<B>,

source§

fn map2<Z, F>(self, fb: Self::Target<B>, f: F) -> Self::Target<Z>where F: FnMut(Self::Param, B) -> Z, Self::Target<(Self::Param, B)>: Functor<Z, Target<Z> = Self::Target<Z>>, Self: Sized,

Combine two effectful values into a single effectful value using a binary function. Read more
source§

fn map3<C, Z, F>( self, fb: Self::Target<B>, fc: Self::Target<C>, f: F ) -> Self::Target<Z>where F: FnMut(Self::Param, B, C) -> Z, Self::Target<(Self::Param, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((Self::Param, B), C)> = Self::Target<((Self::Param, B), C)>>, Self::Target<((Self::Param, B), C)>: Functor<Z, Target<Z> = Self::Target<Z>>, Self: Sized,

Combine three effectful values into a single effectful value using a ternary function. Read more
source§

fn map4<C, D, Z, FN>( self, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, func: FN ) -> Self::Target<Z>where FN: FnMut(Self::Param, B, C, D) -> Z, Self: Sized, Self::Target<(Self::Param, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((Self::Param, B), C)> = Self::Target<((Self::Param, B), C)>>, Self::Target<((Self::Param, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((Self::Param, B), C), D)> = Self::Target<(((Self::Param, B), C), D)>>, Self::Target<(((Self::Param, B), C), D)>: Functor<Z, Target<Z> = Self::Target<Z>>,

Is a version of [Apply::map2] for a function of 4 arguments.
source§

fn map5<C, D, E, Z, FN>( self, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, func: FN ) -> Self::Target<Z>where FN: FnMut(Self::Param, B, C, D, E) -> Z, Self: Sized, Self::Target<(Self::Param, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((Self::Param, B), C)> = Self::Target<((Self::Param, B), C)>>, Self::Target<((Self::Param, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((Self::Param, B), C), D)> = Self::Target<(((Self::Param, B), C), D)>>, Self::Target<(((Self::Param, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((Self::Param, B), C), D), E)> = Self::Target<((((Self::Param, B), C), D), E)>>, Self::Target<((((Self::Param, B), C), D), E)>: Functor<Z, Target<Z> = Self::Target<Z>>,

Is a version of [Apply::map2] for a function of 5 arguments.
source§

fn map6<C, D, E, F, Z, FN>( self, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, func: FN ) -> Self::Target<Z>where FN: FnMut(Self::Param, B, C, D, E, F) -> Z, Self: Sized, Self::Target<(Self::Param, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((Self::Param, B), C)> = Self::Target<((Self::Param, B), C)>>, Self::Target<((Self::Param, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((Self::Param, B), C), D)> = Self::Target<(((Self::Param, B), C), D)>>, Self::Target<(((Self::Param, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((Self::Param, B), C), D), E)> = Self::Target<((((Self::Param, B), C), D), E)>>, Self::Target<((((Self::Param, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((Self::Param, B), C), D), E), F)> = Self::Target<(((((Self::Param, B), C), D), E), F)>>, Self::Target<(((((Self::Param, B), C), D), E), F)>: Functor<Z, Target<Z> = Self::Target<Z>>,

Is a version of [Apply::map2] for a function of 6 arguments.
source§

fn map7<C, D, E, F, G, Z, FN>( self, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, fg: Self::Target<G>, func: FN ) -> Self::Target<Z>where FN: FnMut(Self::Param, B, C, D, E, F, G) -> Z, Self: Sized, Self::Target<(Self::Param, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((Self::Param, B), C)> = Self::Target<((Self::Param, B), C)>>, Self::Target<((Self::Param, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((Self::Param, B), C), D)> = Self::Target<(((Self::Param, B), C), D)>>, Self::Target<(((Self::Param, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((Self::Param, B), C), D), E)> = Self::Target<((((Self::Param, B), C), D), E)>>, Self::Target<((((Self::Param, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((Self::Param, B), C), D), E), F)> = Self::Target<(((((Self::Param, B), C), D), E), F)>>, Self::Target<(((((Self::Param, B), C), D), E), F)>: Semigroupal<G, Target<G> = Self::Target<G>> + Higher<Target<((((((Self::Param, B), C), D), E), F), G)> = Self::Target<((((((Self::Param, B), C), D), E), F), G)>>, Self::Target<((((((Self::Param, B), C), D), E), F), G)>: Functor<Z, Target<Z> = Self::Target<Z>>,

Is a version of [Apply::map2] for a function of 7 arguments.
source§

fn map8<C, D, E, F, G, H, Z, FN>( self, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, fg: Self::Target<G>, fh: Self::Target<H>, func: FN ) -> Self::Target<Z>where FN: FnMut(Self::Param, B, C, D, E, F, G, H) -> Z, Self: Sized, Self::Target<(Self::Param, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((Self::Param, B), C)> = Self::Target<((Self::Param, B), C)>>, Self::Target<((Self::Param, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((Self::Param, B), C), D)> = Self::Target<(((Self::Param, B), C), D)>>, Self::Target<(((Self::Param, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((Self::Param, B), C), D), E)> = Self::Target<((((Self::Param, B), C), D), E)>>, Self::Target<((((Self::Param, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((Self::Param, B), C), D), E), F)> = Self::Target<(((((Self::Param, B), C), D), E), F)>>, Self::Target<(((((Self::Param, B), C), D), E), F)>: Semigroupal<G, Target<G> = Self::Target<G>> + Higher<Target<((((((Self::Param, B), C), D), E), F), G)> = Self::Target<((((((Self::Param, B), C), D), E), F), G)>>, Self::Target<((((((Self::Param, B), C), D), E), F), G)>: Semigroupal<H, Target<H> = Self::Target<H>> + Higher<Target<(((((((Self::Param, B), C), D), E), F), G), H)> = Self::Target<(((((((Self::Param, B), C), D), E), F), G), H)>>, Self::Target<(((((((Self::Param, B), C), D), E), F), G), H)>: Functor<Z, Target<Z> = Self::Target<Z>>,

Is a version of [Apply::map2] for a function of 8 arguments.
source§

fn map9<C, D, E, F, G, H, I, Z, FN>( self, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, fg: Self::Target<G>, fh: Self::Target<H>, fi: Self::Target<I>, func: FN ) -> Self::Target<Z>where FN: FnMut(Self::Param, B, C, D, E, F, G, H, I) -> Z, Self: Sized, Self::Target<(Self::Param, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((Self::Param, B), C)> = Self::Target<((Self::Param, B), C)>>, Self::Target<((Self::Param, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((Self::Param, B), C), D)> = Self::Target<(((Self::Param, B), C), D)>>, Self::Target<(((Self::Param, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((Self::Param, B), C), D), E)> = Self::Target<((((Self::Param, B), C), D), E)>>, Self::Target<((((Self::Param, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((Self::Param, B), C), D), E), F)> = Self::Target<(((((Self::Param, B), C), D), E), F)>>, Self::Target<(((((Self::Param, B), C), D), E), F)>: Semigroupal<G, Target<G> = Self::Target<G>> + Higher<Target<((((((Self::Param, B), C), D), E), F), G)> = Self::Target<((((((Self::Param, B), C), D), E), F), G)>>, Self::Target<((((((Self::Param, B), C), D), E), F), G)>: Semigroupal<H, Target<H> = Self::Target<H>> + Higher<Target<(((((((Self::Param, B), C), D), E), F), G), H)> = Self::Target<(((((((Self::Param, B), C), D), E), F), G), H)>>, Self::Target<(((((((Self::Param, B), C), D), E), F), G), H)>: Semigroupal<I, Target<I> = Self::Target<I>> + Higher<Target<((((((((Self::Param, B), C), D), E), F), G), H), I)> = Self::Target<((((((((Self::Param, B), C), D), E), F), G), H), I)>>, Self::Target<((((((((Self::Param, B), C), D), E), F), G), H), I)>: Functor<Z, Target<Z> = Self::Target<Z>>,

Is a version of [Apply::map2] for a function of 9 arguments.
source§

fn map10<C, D, E, F, G, H, I, J, Z, FN>( self, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, fg: Self::Target<G>, fh: Self::Target<H>, fi: Self::Target<I>, fj: Self::Target<J>, func: FN ) -> Self::Target<Z>where FN: FnMut(Self::Param, B, C, D, E, F, G, H, I, J) -> Z, Self: Sized, Self::Target<(Self::Param, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((Self::Param, B), C)> = Self::Target<((Self::Param, B), C)>>, Self::Target<((Self::Param, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((Self::Param, B), C), D)> = Self::Target<(((Self::Param, B), C), D)>>, Self::Target<(((Self::Param, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((Self::Param, B), C), D), E)> = Self::Target<((((Self::Param, B), C), D), E)>>, Self::Target<((((Self::Param, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((Self::Param, B), C), D), E), F)> = Self::Target<(((((Self::Param, B), C), D), E), F)>>, Self::Target<(((((Self::Param, B), C), D), E), F)>: Semigroupal<G, Target<G> = Self::Target<G>> + Higher<Target<((((((Self::Param, B), C), D), E), F), G)> = Self::Target<((((((Self::Param, B), C), D), E), F), G)>>, Self::Target<((((((Self::Param, B), C), D), E), F), G)>: Semigroupal<H, Target<H> = Self::Target<H>> + Higher<Target<(((((((Self::Param, B), C), D), E), F), G), H)> = Self::Target<(((((((Self::Param, B), C), D), E), F), G), H)>>, Self::Target<(((((((Self::Param, B), C), D), E), F), G), H)>: Semigroupal<I, Target<I> = Self::Target<I>> + Higher<Target<((((((((Self::Param, B), C), D), E), F), G), H), I)> = Self::Target<((((((((Self::Param, B), C), D), E), F), G), H), I)>>, Self::Target<((((((((Self::Param, B), C), D), E), F), G), H), I)>: Semigroupal<J, Target<J> = Self::Target<J>> + Higher<Target<(((((((((Self::Param, B), C), D), E), F), G), H), I), J)> = Self::Target<(((((((((Self::Param, B), C), D), E), F), G), H), I), J)>>, Self::Target<(((((((((Self::Param, B), C), D), E), F), G), H), I), J)>: Functor<Z, Target<Z> = Self::Target<Z>>,

Is a version of [Apply::map2] for a function of 10 arguments.
source§

fn map11<C, D, E, F, G, H, I, J, K, Z, FN>( self, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, fg: Self::Target<G>, fh: Self::Target<H>, fi: Self::Target<I>, fj: Self::Target<J>, fk: Self::Target<K>, func: FN ) -> Self::Target<Z>where FN: FnMut(Self::Param, B, C, D, E, F, G, H, I, J, K) -> Z, Self: Sized, Self::Target<(Self::Param, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((Self::Param, B), C)> = Self::Target<((Self::Param, B), C)>>, Self::Target<((Self::Param, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((Self::Param, B), C), D)> = Self::Target<(((Self::Param, B), C), D)>>, Self::Target<(((Self::Param, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((Self::Param, B), C), D), E)> = Self::Target<((((Self::Param, B), C), D), E)>>, Self::Target<((((Self::Param, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((Self::Param, B), C), D), E), F)> = Self::Target<(((((Self::Param, B), C), D), E), F)>>, Self::Target<(((((Self::Param, B), C), D), E), F)>: Semigroupal<G, Target<G> = Self::Target<G>> + Higher<Target<((((((Self::Param, B), C), D), E), F), G)> = Self::Target<((((((Self::Param, B), C), D), E), F), G)>>, Self::Target<((((((Self::Param, B), C), D), E), F), G)>: Semigroupal<H, Target<H> = Self::Target<H>> + Higher<Target<(((((((Self::Param, B), C), D), E), F), G), H)> = Self::Target<(((((((Self::Param, B), C), D), E), F), G), H)>>, Self::Target<(((((((Self::Param, B), C), D), E), F), G), H)>: Semigroupal<I, Target<I> = Self::Target<I>> + Higher<Target<((((((((Self::Param, B), C), D), E), F), G), H), I)> = Self::Target<((((((((Self::Param, B), C), D), E), F), G), H), I)>>, Self::Target<((((((((Self::Param, B), C), D), E), F), G), H), I)>: Semigroupal<J, Target<J> = Self::Target<J>> + Higher<Target<(((((((((Self::Param, B), C), D), E), F), G), H), I), J)> = Self::Target<(((((((((Self::Param, B), C), D), E), F), G), H), I), J)>>, Self::Target<(((((((((Self::Param, B), C), D), E), F), G), H), I), J)>: Semigroupal<K, Target<K> = Self::Target<K>> + Higher<Target<((((((((((Self::Param, B), C), D), E), F), G), H), I), J), K)> = Self::Target<((((((((((Self::Param, B), C), D), E), F), G), H), I), J), K)>>, Self::Target<((((((((((Self::Param, B), C), D), E), F), G), H), I), J), K)>: Functor<Z, Target<Z> = Self::Target<Z>>,

Is a version of [Apply::map2] for a function of 11 arguments.
source§

fn map12<C, D, E, F, G, H, I, J, K, L, Z, FN>( self, fb: Self::Target<B>, fc: Self::Target<C>, fd: Self::Target<D>, fe: Self::Target<E>, ff: Self::Target<F>, fg: Self::Target<G>, fh: Self::Target<H>, fi: Self::Target<I>, fj: Self::Target<J>, fk: Self::Target<K>, fl: Self::Target<L>, func: FN ) -> Self::Target<Z>where FN: FnMut(Self::Param, B, C, D, E, F, G, H, I, J, K, L) -> Z, Self: Sized, Self::Target<(Self::Param, B)>: Semigroupal<C, Target<C> = Self::Target<C>> + Higher<Target<((Self::Param, B), C)> = Self::Target<((Self::Param, B), C)>>, Self::Target<((Self::Param, B), C)>: Semigroupal<D, Target<D> = Self::Target<D>> + Higher<Target<(((Self::Param, B), C), D)> = Self::Target<(((Self::Param, B), C), D)>>, Self::Target<(((Self::Param, B), C), D)>: Semigroupal<E, Target<E> = Self::Target<E>> + Higher<Target<((((Self::Param, B), C), D), E)> = Self::Target<((((Self::Param, B), C), D), E)>>, Self::Target<((((Self::Param, B), C), D), E)>: Semigroupal<F, Target<F> = Self::Target<F>> + Higher<Target<(((((Self::Param, B), C), D), E), F)> = Self::Target<(((((Self::Param, B), C), D), E), F)>>, Self::Target<(((((Self::Param, B), C), D), E), F)>: Semigroupal<G, Target<G> = Self::Target<G>> + Higher<Target<((((((Self::Param, B), C), D), E), F), G)> = Self::Target<((((((Self::Param, B), C), D), E), F), G)>>, Self::Target<((((((Self::Param, B), C), D), E), F), G)>: Semigroupal<H, Target<H> = Self::Target<H>> + Higher<Target<(((((((Self::Param, B), C), D), E), F), G), H)> = Self::Target<(((((((Self::Param, B), C), D), E), F), G), H)>>, Self::Target<(((((((Self::Param, B), C), D), E), F), G), H)>: Semigroupal<I, Target<I> = Self::Target<I>> + Higher<Target<((((((((Self::Param, B), C), D), E), F), G), H), I)> = Self::Target<((((((((Self::Param, B), C), D), E), F), G), H), I)>>, Self::Target<((((((((Self::Param, B), C), D), E), F), G), H), I)>: Semigroupal<J, Target<J> = Self::Target<J>> + Higher<Target<(((((((((Self::Param, B), C), D), E), F), G), H), I), J)> = Self::Target<(((((((((Self::Param, B), C), D), E), F), G), H), I), J)>>, Self::Target<(((((((((Self::Param, B), C), D), E), F), G), H), I), J)>: Semigroupal<K, Target<K> = Self::Target<K>> + Higher<Target<((((((((((Self::Param, B), C), D), E), F), G), H), I), J), K)> = Self::Target<((((((((((Self::Param, B), C), D), E), F), G), H), I), J), K)>>, Self::Target<((((((((((Self::Param, B), C), D), E), F), G), H), I), J), K)>: Semigroupal<L, Target<L> = Self::Target<L>> + Higher<Target<(((((((((((Self::Param, B), C), D), E), F), G), H), I), J), K), L)> = Self::Target<(((((((((((Self::Param, B), C), D), E), F), G), H), I), J), K), L)>>, Self::Target<(((((((((((Self::Param, B), C), D), E), F), G), H), I), J), K), L)>: Functor<Z, Target<Z> = Self::Target<Z>>,

Is a version of [Apply::map2] for a function of 12 arguments.
source§

fn product_r(self, fb: Self::Target<B>) -> Self::Target<B>where Self::Target<(Self::Param, B)>: Functor<B, Target<B> = Self::Target<B>>, Self: Sized,

Compose two effectful values discarding the result of the first. Read more
source§

fn product_l(self, fb: Self::Target<B>) -> Selfwhere Self::Target<(Self::Param, B)>: Functor<Self::Param, Target<Self::Param> = Self>, Self: Higher<Target<<Self as Higher>::Param> = Self> + Sized,

Compose two effectful values discarding the result of the second. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<A, B, T> Applicative<A, B> for Twhere T: Apply<A, B> + Pure,