LanguageExt.Core

LanguageExt.Core Traits Stateful

Contents

class StatefulExtensions Source #

Methods

method K<M, A> Bracket <M, S, A> (this K<M, Unit> stateSetter, K<M, A> operation) Source #

where M : Stateful<M, S>, Monad<M>

Runs the stateSetter to update the state-monad's inner state. Then runs the operation. And finally, resets the state to how it was before running stateSetter.

Parameters

returns

The result of operation

class Stateful Source #

Methods

method K<M, Unit> put <M, S> (S value) Source #

where M : Stateful<M, S>

method K<M, Unit> modify <M, S> (Func<S, S> modify) Source #

where M : Stateful<M, S>

method K<M, Unit> modifyM <M, S> (Func<S, K<M, S>> modify) Source #

where M : Stateful<M, S>, Monad<M>

method K<M, S> get <M, S> () Source #

where M : Stateful<M, S>

method K<M, A> gets <M, S, A> (Func<S, A> f) Source #

where M : Stateful<M, S>

method K<M, A> getsM <M, S, A> (Func<S, K<M, A>> f) Source #

where M : Stateful<M, S>, Monad<M>

method K<M, A> state <M, S, A> (Func<S, (A Value, S State)> f) Source #

where M : Stateful<M, S>, Monad<M>

method K<M, A> bracket <M, S, A> (K<M, Unit> stateSetter, K<M, A> operation) Source #

where M : Stateful<M, S>, Monad<M>

Runs the stateSetter to update the state-monad's inner state. Then runs the operation. And finally, resets the state to how it was before running stateSetter.

Parameters

returns

The result of operation

interface Stateful <in M, S> Source #

where M : Stateful<M, S>

Properties

property K<M, S> Get Source #

Methods

method K<M, Unit> Put (S value) Source #

method K<M, Unit> Modify (Func<S, S> modify) Source #

method K<M, A> Gets <A> (Func<S, A> f) Source #