SemifiniteFunction

Struct SemifiniteFunction 

Source
pub struct SemifiniteFunction<K: ArrayKind, T>(pub K::Type<T>);
Expand description

A function whose source is finite, but whose target may be non-finite. This is really just an array!

Tuple Fields§

§0: K::Type<T>

Implementations§

Source§

impl<K: ArrayKind, T> SemifiniteFunction<K, T>
where K::Type<T>: Array<K, T>,

Source

pub fn new(x: K::Type<T>) -> Self

Source

pub fn len(&self) -> K::I

Source

pub fn singleton(x: T) -> SemifiniteFunction<K, T>

Source

pub fn coproduct(&self, other: &Self) -> Self

Trait Implementations§

Source§

impl<K: ArrayKind, T> Add<&SemifiniteFunction<K, T>> for &SemifiniteFunction<K, T>
where K::Type<T>: Array<K, T>,

Source§

type Output = Option<SemifiniteFunction<K, T>>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &SemifiniteFunction<K, T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<K: ArrayKind, T> Add for SemifiniteFunction<K, T>
where K::Type<T>: Array<K, T>,

Source§

type Output = SemifiniteFunction<K, T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<K: ArrayKind, T> Clone for SemifiniteFunction<K, T>
where K::Type<T>: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<K: ArrayKind, T> Debug for SemifiniteFunction<K, T>
where K::Type<T>: Debug,

Source§

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

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

impl<K: ArrayKind, T> From<SemifiniteFunction<K, T>> for SemifiniteArrow<K, T>

Source§

fn from(val: SemifiniteFunction<K, T>) -> Self

Converts to this type from the input type.
Source§

impl<K: ArrayKind, T> HasLen<K> for SemifiniteFunction<K, T>
where K::Type<T>: Array<K, T>,

Source§

fn len(&self) -> K::I

Source§

fn is_empty(&self) -> bool

Source§

impl<K: ArrayKind, T> PartialEq for SemifiniteFunction<K, T>
where K::Type<T>: PartialEq,

Source§

fn eq(&self, other: &SemifiniteFunction<K, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<K: ArrayKind, T> Shr<&SemifiniteFunction<K, T>> for &FiniteFunction<K>
where K::Type<T>: Array<K, T>,

A FiniteFunction can be precomposed with a SemifiniteFunction to re-index it.

Source§

type Output = Option<SemifiniteFunction<K, T>>

The resulting type after applying the >> operator.
Source§

fn shr( self, other: &SemifiniteFunction<K, T>, ) -> Option<SemifiniteFunction<K, T>>

Performs the >> operation. Read more
Source§

impl<K: ArrayKind, T> TryFrom<SemifiniteArrow<K, T>> for SemifiniteFunction<K, T>

Source§

type Error = ()

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

fn try_from(value: SemifiniteArrow<K, T>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<K: ArrayKind, T> Zero for SemifiniteFunction<K, T>
where K::Type<T>: Array<K, T>,

Source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.

Auto Trait Implementations§

§

impl<K, T> Freeze for SemifiniteFunction<K, T>
where <K as ArrayKind>::Type<T>: Freeze,

§

impl<K, T> RefUnwindSafe for SemifiniteFunction<K, T>
where <K as ArrayKind>::Type<T>: RefUnwindSafe,

§

impl<K, T> Send for SemifiniteFunction<K, T>
where <K as ArrayKind>::Type<T>: Send,

§

impl<K, T> Sync for SemifiniteFunction<K, T>
where <K as ArrayKind>::Type<T>: Sync,

§

impl<K, T> Unpin for SemifiniteFunction<K, T>
where <K as ArrayKind>::Type<T>: Unpin,

§

impl<K, T> UnwindSafe for SemifiniteFunction<K, T>
where <K as ArrayKind>::Type<T>: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.