FSharpx.Extras


MaybeBuilder Type

The maybe monad. This monad is my own and uses an 'T option. Others generally make their own Maybe<'T> type from Option<'T>. The builder approach is from Matthew Podwysocki's excellent Creating Extended Builders series http://codebetter.com/blogs/matthew.podwysocki/archive/2010/01/18/much-ado-about-monads-creating-extended-builders.aspx.

Constructors

Constructor Description

MaybeBuilder()

Full Usage: MaybeBuilder()

Returns: MaybeBuilder
Returns: MaybeBuilder

Instance members

Instance member Description

this.Bind

Full Usage: this.Bind

Parameters:
    m : 'a option
    f : 'a -> 'b option

Returns: 'b option
m : 'a option
f : 'a -> 'b option
Returns: 'b option

this.Combine

Full Usage: this.Combine

Parameters:
    m : 'a option
    f : 'a -> 'b option

Returns: 'b option
m : 'a option
f : 'a -> 'b option
Returns: 'b option

this.Delay

Full Usage: this.Delay

Parameters:
    f : unit -> 'a

Returns: unit -> 'a
f : unit -> 'a
Returns: unit -> 'a

this.For

Full Usage: this.For

Parameters:
    sequence : 'a seq
    body : 'a -> 'b

Returns: unit option
sequence : 'a seq
body : 'a -> 'b
Returns: unit option

this.Return

Full Usage: this.Return

Parameters:
    x : 'a

Returns: 'a option
x : 'a
Returns: 'a option

this.ReturnFrom

Full Usage: this.ReturnFrom

Parameters:
    m : 'T option

Returns: 'T option
m : 'T option
Returns: 'T option

this.Run

Full Usage: this.Run

Parameters:
    f : unit -> 'a

Returns: 'a
f : unit -> 'a
Returns: 'a

this.TryFinally

Full Usage: this.TryFinally

Parameters:
    m : 'a option
    compensation : unit -> unit

Returns: 'a option
m : 'a option
compensation : unit -> unit
Returns: 'a option

this.TryWith

Full Usage: this.TryWith

Parameters:
    m : 'a option
    h : exn -> 'a option

Returns: 'a option
m : 'a option
h : exn -> 'a option
Returns: 'a option

this.Using

Full Usage: this.Using

Parameters:
    res : 'a
    body : 'a -> 'b option

Returns: 'b option
res : 'a
body : 'a -> 'b option
Returns: 'b option

this.While

Full Usage: this.While

Parameters:
    guard : unit -> bool
    f : unit -> 'a

Returns: unit option
guard : unit -> bool
f : unit -> 'a
Returns: unit option

this.Zero

Full Usage: this.Zero

Returns: 'a option
Returns: 'a option