pub struct Conjunctive<A>(pub A);Expand description
A newtype wrapper whose Semigroup instance uses
HeytingAlgebra::conjoin.
This provides a Monoid based on logical conjunction (AND),
with HeytingAlgebra::true_value as the identity element.
§Examples
use fp_library::{
functions::*,
types::Conjunctive,
};
assert_eq!(append(Conjunctive(true), Conjunctive(true)), Conjunctive(true));
assert_eq!(append(Conjunctive(true), Conjunctive(false)), Conjunctive(false));
assert_eq!(empty::<Conjunctive<bool>>(), Conjunctive(true));Tuple Fields§
§0: AThe wrapped value.
Trait Implementations§
Source§impl<A: Clone> Clone for Conjunctive<A>
impl<A: Clone> Clone for Conjunctive<A>
Source§fn clone(&self) -> Conjunctive<A>
fn clone(&self) -> Conjunctive<A>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<A: Debug> Debug for Conjunctive<A>
impl<A: Debug> Debug for Conjunctive<A>
Source§impl<A: Default> Default for Conjunctive<A>
impl<A: Default> Default for Conjunctive<A>
Source§fn default() -> Conjunctive<A>
fn default() -> Conjunctive<A>
Returns the “default value” for a type. Read more
Source§impl<A: Hash> Hash for Conjunctive<A>
impl<A: Hash> Hash for Conjunctive<A>
Source§impl<A: HeytingAlgebra> Monoid for Conjunctive<A>
§Type Parameters
A: The Heyting algebra type.
impl<A: HeytingAlgebra> Monoid for Conjunctive<A>
§Type Parameters
A: The Heyting algebra type.
Source§impl<A: Ord> Ord for Conjunctive<A>
impl<A: Ord> Ord for Conjunctive<A>
Source§fn cmp(&self, other: &Conjunctive<A>) -> Ordering
fn cmp(&self, other: &Conjunctive<A>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<A: PartialEq> PartialEq for Conjunctive<A>
impl<A: PartialEq> PartialEq for Conjunctive<A>
Source§impl<A: PartialOrd> PartialOrd for Conjunctive<A>
impl<A: PartialOrd> PartialOrd for Conjunctive<A>
Source§impl<A: HeytingAlgebra> Semigroup for Conjunctive<A>
§Type Parameters
A: The Heyting algebra type.
impl<A: HeytingAlgebra> Semigroup for Conjunctive<A>
§Type Parameters
A: The Heyting algebra type.
Source§fn append(a: Self, b: Self) -> Self
fn append(a: Self, b: Self) -> Self
Combines two values using HeytingAlgebra::conjoin.
§Type Signature
forall A. HeytingAlgebra A => (Conjunctive A, Conjunctive A) -> Conjunctive A
§Parameters
a: The first conjunctive value.b: The second conjunctive value.
§Returns
The conjunction wrapped in Conjunctive.
§Examples
use fp_library::{
functions::*,
types::Conjunctive,
};
assert_eq!(append(Conjunctive(true), Conjunctive(true)), Conjunctive(true));impl<A: Copy> Copy for Conjunctive<A>
impl<A: Eq> Eq for Conjunctive<A>
impl<A> StructuralPartialEq for Conjunctive<A>
Auto Trait Implementations§
impl<A> Freeze for Conjunctive<A>where
A: Freeze,
impl<A> RefUnwindSafe for Conjunctive<A>where
A: RefUnwindSafe,
impl<A> Send for Conjunctive<A>where
A: Send,
impl<A> Sync for Conjunctive<A>where
A: Sync,
impl<A> Unpin for Conjunctive<A>where
A: Unpin,
impl<A> UnsafeUnpin for Conjunctive<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for Conjunctive<A>where
A: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more