pub struct Disjunctive<A>(pub A);Expand description
A newtype wrapper whose Semigroup instance uses
HeytingAlgebra::disjoin.
This provides a Monoid based on logical disjunction (OR),
with HeytingAlgebra::false_value as the identity element.
§Examples
use fp_library::{
functions::*,
types::Disjunctive,
};
assert_eq!(append(Disjunctive(false), Disjunctive(false)), Disjunctive(false));
assert_eq!(append(Disjunctive(false), Disjunctive(true)), Disjunctive(true));
assert_eq!(empty::<Disjunctive<bool>>(), Disjunctive(false));Tuple Fields§
§0: AThe wrapped value.
Trait Implementations§
Source§impl<A: Clone> Clone for Disjunctive<A>
impl<A: Clone> Clone for Disjunctive<A>
Source§fn clone(&self) -> Disjunctive<A>
fn clone(&self) -> Disjunctive<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 Disjunctive<A>
impl<A: Debug> Debug for Disjunctive<A>
Source§impl<A: Default> Default for Disjunctive<A>
impl<A: Default> Default for Disjunctive<A>
Source§fn default() -> Disjunctive<A>
fn default() -> Disjunctive<A>
Returns the “default value” for a type. Read more
Source§impl<A: Hash> Hash for Disjunctive<A>
impl<A: Hash> Hash for Disjunctive<A>
Source§impl<A: HeytingAlgebra> Monoid for Disjunctive<A>
§Type Parameters
A: The Heyting algebra type.
impl<A: HeytingAlgebra> Monoid for Disjunctive<A>
§Type Parameters
A: The Heyting algebra type.
Source§impl<A: Ord> Ord for Disjunctive<A>
impl<A: Ord> Ord for Disjunctive<A>
Source§fn cmp(&self, other: &Disjunctive<A>) -> Ordering
fn cmp(&self, other: &Disjunctive<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 Disjunctive<A>
impl<A: PartialEq> PartialEq for Disjunctive<A>
Source§impl<A: PartialOrd> PartialOrd for Disjunctive<A>
impl<A: PartialOrd> PartialOrd for Disjunctive<A>
Source§impl<A: HeytingAlgebra> Semigroup for Disjunctive<A>
§Type Parameters
A: The Heyting algebra type.
impl<A: HeytingAlgebra> Semigroup for Disjunctive<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::disjoin.
§Type Signature
forall A. HeytingAlgebra A => (Disjunctive A, Disjunctive A) -> Disjunctive A
§Parameters
a: The first disjunctive value.b: The second disjunctive value.
§Returns
The disjunction wrapped in Disjunctive.
§Examples
use fp_library::{
functions::*,
types::Disjunctive,
};
assert_eq!(append(Disjunctive(false), Disjunctive(true)), Disjunctive(true));impl<A: Copy> Copy for Disjunctive<A>
impl<A: Eq> Eq for Disjunctive<A>
impl<A> StructuralPartialEq for Disjunctive<A>
Auto Trait Implementations§
impl<A> Freeze for Disjunctive<A>where
A: Freeze,
impl<A> RefUnwindSafe for Disjunctive<A>where
A: RefUnwindSafe,
impl<A> Send for Disjunctive<A>where
A: Send,
impl<A> Sync for Disjunctive<A>where
A: Sync,
impl<A> Unpin for Disjunctive<A>where
A: Unpin,
impl<A> UnsafeUnpin for Disjunctive<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for Disjunctive<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