FSharpx.Extras


StateBuilder Type

The state monad. The algorithm is adjusted from my original work off of Brian Beckman's http://channel9.msdn.com/shows/Going+Deep/Brian-Beckman-The-Zen-of-Expressing-State-The-State-Monad/. The approach was adjusted from Matthew Podwysocki's http://codebetter.com/blogs/matthew.podwysocki/archive/2009/12/30/much-ado-about-monads-state-edition.aspx and mirrors his final result.

Constructors

Constructor Description

StateBuilder()

Full Usage: StateBuilder()

Returns: StateBuilder
Returns: StateBuilder

Instance members

Instance member Description

this.Bind

Full Usage: this.Bind

Parameters:
    m : State<'T, 'State>
    k : 'T -> State<'U, 'State>

Returns: State<'U, 'State>
m : State<'T, 'State>
k : 'T -> State<'U, 'State>
Returns: State<'U, 'State>

this.Combine

Full Usage: this.Combine

Parameters:
Returns: State<'b, 'a>
r1 : State<unit, 'a>
r2 : State<'b, 'a>
Returns: State<'b, 'a>

this.Delay

Full Usage: this.Delay

Parameters:
    f : unit -> State<'b, 'c>

Returns: State<'b, 'c>
f : unit -> State<'b, 'c>
Returns: State<'b, 'c>

this.For

Full Usage: this.For

Parameters:
    sequence : 'a seq
    body : 'a -> State<unit, 'b>

Returns: State<unit, 'b>
sequence : 'a seq
body : 'a -> State<unit, 'b>
Returns: State<unit, 'b>

this.Return

Full Usage: this.Return

Parameters:
    a : 'T

Returns: State<'T, 'State>
a : 'T
Returns: State<'T, 'State>

this.ReturnFrom

Full Usage: this.ReturnFrom

Parameters:
Returns: State<'T, 'State>
m : State<'T, 'State>
Returns: State<'T, 'State>

this.TryFinally

Full Usage: this.TryFinally

Parameters:
    m : State<'T, 'State>
    compensation : unit -> unit

Returns: State<'T, 'State>
m : State<'T, 'State>
compensation : unit -> unit
Returns: State<'T, 'State>

this.TryWith

Full Usage: this.TryWith

Parameters:
    m : State<'T, 'State>
    h : exn -> State<'T, 'State>

Returns: State<'T, 'State>
m : State<'T, 'State>
h : exn -> State<'T, 'State>
Returns: State<'T, 'State>

this.Using

Full Usage: this.Using

Parameters:
    res : 'a
    body : 'a -> State<'b, 'c>

Returns: State<'b, 'c>
res : 'a
body : 'a -> State<'b, 'c>
Returns: State<'b, 'c>

this.While

Full Usage: this.While

Parameters:
    guard : unit -> bool
    m : State<unit, 'a>

Returns: State<unit, 'a>
guard : unit -> bool
m : State<unit, 'a>
Returns: State<unit, 'a>

this.Zero

Full Usage: this.Zero

Returns: State<unit, 'a>
Returns: State<unit, 'a>