pub struct State<S, A> { /* private fields */ }
Expand description
The State
monad represents a stateful computation.
State
モナドは状態付き計算を表します。
Implementations§
Source§impl<S, A> State<S, A>where
S: 'static,
A: Clone + 'static,
impl<S, A> State<S, A>where
S: 'static,
A: Clone + 'static,
Sourcepub fn pure<B>(b: B) -> State<S, B>where
B: Clone + 'static,
pub fn pure<B>(b: B) -> State<S, B>where
B: Clone + 'static,
Alias for Self::value.
Self::valueのエイリアス。
Sourcepub fn and_then<B>(self, sb: State<S, B>) -> State<S, (A, B)>
pub fn and_then<B>(self, sb: State<S, B>) -> State<S, (A, B)>
Compose two States.
2つのStateを合成します。
Trait Implementations§
Auto Trait Implementations§
impl<S, A> Freeze for State<S, A>
impl<S, A> !RefUnwindSafe for State<S, A>
impl<S, A> !Send for State<S, A>
impl<S, A> !Sync for State<S, A>
impl<S, A> Unpin for State<S, A>
impl<S, A> !UnwindSafe for State<S, A>
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