#[fp_macros::document_module]
mod inner {
use {
crate::{
classes::*,
kinds::*,
},
fp_macros::*,
};
#[document_examples]
#[kind(type Of<'a, A: 'a, B: 'a>: 'a;)]
pub trait RefBitraversable: RefBifunctor + RefBifoldable {
#[document_signature]
#[document_type_parameters(
"The lifetime of the values.",
"The brand of the cloneable function wrapper.",
"The type of the first-position elements.",
"The type of the second-position elements.",
"The output type for first-position elements.",
"The output type for second-position elements.",
"The applicative context."
)]
#[document_parameters(
"The function for first-position element references.",
"The function for second-position element references.",
"The bitraversable structure to traverse by reference."
)]
#[document_returns("The transformed structure wrapped in the applicative context.")]
#[document_examples]
fn ref_bi_traverse<
'a,
FnBrand,
A: 'a + Clone,
B: 'a + Clone,
C: 'a + Clone,
D: 'a + Clone,
F: Applicative,
>(
f: impl Fn(&A) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, C>) + 'a,
g: impl Fn(&B) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, D>) + 'a,
p: &Apply!(<Self as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, B>),
) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, Apply!(<Self as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, C, D>)>)
where
FnBrand: LiftFn + 'a,
Apply!(<Self as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, C, D>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, C>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, D>): Clone;
#[document_signature]
#[document_type_parameters(
"The lifetime of the values.",
"The brand of the cloneable function wrapper.",
"The type of the first-position elements.",
"The type of the second-position elements.",
"The applicative context."
)]
#[document_parameters("The bitraversable structure containing applicative values.")]
#[document_returns("The applicative context wrapping the bitraversable structure.")]
#[document_examples]
fn ref_bi_sequence<'a, FnBrand, A: 'a + Clone, B: 'a + Clone, F: Applicative>(
ta: &Apply!(<Self as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, A>), Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, B>)>)
) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, Apply!(<Self as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, B>)>)
where
FnBrand: LiftFn + 'a,
Apply!(<Self as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, B>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, A>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, B>): Clone, {
Self::ref_bi_traverse::<
FnBrand,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, A>),
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, B>),
A,
B,
F,
>(Clone::clone, Clone::clone, ta)
}
}
#[document_signature]
#[document_type_parameters(
"The lifetime of the values.",
"The brand of the bitraversable structure.",
"The brand of the cloneable function wrapper.",
"The type of the first-position elements.",
"The type of the second-position elements.",
"The output type for first-position elements.",
"The output type for second-position elements.",
"The applicative context."
)]
#[document_parameters(
"The function for first-position element references.",
"The function for second-position element references.",
"The bitraversable structure to traverse by reference."
)]
#[document_returns("The transformed structure wrapped in the applicative context.")]
#[document_examples]
pub fn ref_bi_traverse<
'a,
Brand: RefBitraversable,
FnBrand,
A: 'a + Clone,
B: 'a + Clone,
C: 'a + Clone,
D: 'a + Clone,
F: Applicative,
>(
f: impl Fn(&A) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, C>) + 'a,
g: impl Fn(&B) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, D>) + 'a,
p: &Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, B>),
) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, C, D>)>)
where
FnBrand: LiftFn + 'a,
Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, C, D>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, C>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, D>): Clone, {
Brand::ref_bi_traverse::<FnBrand, A, B, C, D, F>(f, g, p)
}
#[document_signature]
#[document_type_parameters(
"The lifetime of the values.",
"The brand of the bitraversable structure.",
"The brand of the cloneable function wrapper.",
"The type of the first-position elements.",
"The type of the second-position elements.",
"The applicative context."
)]
#[document_parameters("The bitraversable structure containing applicative values.")]
#[document_returns("The applicative context wrapping the bitraversable structure.")]
#[document_examples]
pub fn ref_bi_sequence<
'a,
Brand: RefBitraversable,
FnBrand,
A: 'a + Clone,
B: 'a + Clone,
F: Applicative,
>(
ta: &Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, A>), Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, B>)>)
) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, B>)>)
where
FnBrand: LiftFn + 'a,
Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, B>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, A>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, B>): Clone, {
Brand::ref_bi_sequence::<FnBrand, A, B, F>(ta)
}
#[document_signature]
#[document_type_parameters(
"The lifetime of the values.",
"The brand of the bitraversable structure.",
"The brand of the cloneable function wrapper.",
"The type of the first-position elements.",
"The type of the second-position elements (unchanged).",
"The output type for first-position elements.",
"The applicative context."
)]
#[document_parameters(
"The function for first-position element references.",
"The bitraversable structure to traverse by reference."
)]
#[document_returns("The transformed structure wrapped in the applicative context.")]
#[document_examples]
pub fn ref_bi_traverse_left<
'a,
Brand: RefBitraversable,
FnBrand,
A: 'a + Clone,
B: 'a + Clone,
C: 'a + Clone,
F: Applicative,
>(
f: impl Fn(&A) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, C>) + 'a,
p: &Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, B>),
) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, C, B>)>)
where
FnBrand: LiftFn + 'a,
Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, C, B>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, C>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, B>): Clone, {
Brand::ref_bi_traverse::<FnBrand, A, B, C, B, F>(f, |b: &B| F::pure(b.clone()), p)
}
#[document_signature]
#[document_type_parameters(
"The lifetime of the values.",
"The brand of the bitraversable structure.",
"The brand of the cloneable function wrapper.",
"The type of the first-position elements (unchanged).",
"The type of the second-position elements.",
"The output type for second-position elements.",
"The applicative context."
)]
#[document_parameters(
"The function for second-position element references.",
"The bitraversable structure to traverse by reference."
)]
#[document_returns("The transformed structure wrapped in the applicative context.")]
#[document_examples]
pub fn ref_bi_traverse_right<
'a,
Brand: RefBitraversable,
FnBrand,
A: 'a + Clone,
B: 'a + Clone,
D: 'a + Clone,
F: Applicative,
>(
g: impl Fn(&B) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, D>) + 'a,
p: &Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, B>),
) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, D>)>)
where
FnBrand: LiftFn + 'a,
Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, D>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, A>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, D>): Clone, {
Brand::ref_bi_traverse::<FnBrand, A, B, A, D, F>(|a: &A| F::pure(a.clone()), g, p)
}
#[document_signature]
#[document_type_parameters(
"The lifetime of the values.",
"The brand of the bitraversable structure.",
"The brand of the cloneable function wrapper.",
"The type of the first-position elements.",
"The type of the second-position elements.",
"The output type for first-position elements.",
"The output type for second-position elements.",
"The applicative context."
)]
#[document_parameters(
"The bitraversable structure to traverse by reference.",
"The function for first-position element references.",
"The function for second-position element references."
)]
#[document_returns("The transformed structure wrapped in the applicative context.")]
#[document_examples]
pub fn ref_bi_for<
'a,
Brand: RefBitraversable,
FnBrand,
A: 'a + Clone,
B: 'a + Clone,
C: 'a + Clone,
D: 'a + Clone,
F: Applicative,
>(
p: &Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, B>),
f: impl Fn(&A) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, C>) + 'a,
g: impl Fn(&B) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, D>) + 'a,
) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, C, D>)>)
where
FnBrand: LiftFn + 'a,
Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, C, D>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, C>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, D>): Clone, {
Brand::ref_bi_traverse::<FnBrand, A, B, C, D, F>(f, g, p)
}
#[document_signature]
#[document_type_parameters(
"The lifetime of the values.",
"The brand of the bitraversable structure.",
"The brand of the cloneable function wrapper.",
"The type of the first-position elements.",
"The type of the second-position elements (unchanged).",
"The output type for first-position elements.",
"The applicative context."
)]
#[document_parameters(
"The bitraversable structure to traverse by reference.",
"The function for first-position element references."
)]
#[document_returns("The transformed structure wrapped in the applicative context.")]
#[document_examples]
pub fn ref_bi_for_left<
'a,
Brand: RefBitraversable,
FnBrand,
A: 'a + Clone,
B: 'a + Clone,
C: 'a + Clone,
F: Applicative,
>(
p: &Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, B>),
f: impl Fn(&A) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, C>) + 'a,
) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, C, B>)>)
where
FnBrand: LiftFn + 'a,
Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, C, B>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, C>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, B>): Clone, {
Brand::ref_bi_traverse::<FnBrand, A, B, C, B, F>(f, |b: &B| F::pure(b.clone()), p)
}
#[document_signature]
#[document_type_parameters(
"The lifetime of the values.",
"The brand of the bitraversable structure.",
"The brand of the cloneable function wrapper.",
"The type of the first-position elements (unchanged).",
"The type of the second-position elements.",
"The output type for second-position elements.",
"The applicative context."
)]
#[document_parameters(
"The bitraversable structure to traverse by reference.",
"The function for second-position element references."
)]
#[document_returns("The transformed structure wrapped in the applicative context.")]
#[document_examples]
pub fn ref_bi_for_right<
'a,
Brand: RefBitraversable,
FnBrand,
A: 'a + Clone,
B: 'a + Clone,
D: 'a + Clone,
F: Applicative,
>(
p: &Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, B>),
g: impl Fn(&B) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, D>) + 'a,
) -> Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, D>)>)
where
FnBrand: LiftFn + 'a,
Apply!(<Brand as Kind!( type Of<'a, A: 'a, B: 'a>: 'a; )>::Of<'a, A, D>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, A>): Clone,
Apply!(<F as Kind!( type Of<'a, T: 'a>: 'a; )>::Of<'a, D>): Clone, {
Brand::ref_bi_traverse::<FnBrand, A, B, A, D, F>(|a: &A| F::pure(a.clone()), g, p)
}
}
pub use inner::*;