Header menu logo bristlecone

Result Module

Types

Type Description

ResultBuilder

A result computation expression. Source: http://www.fssnip.net/7UJ/title/ResultBuilder-Computational-Expression

Functions and values

Function or value Description

()

Full Usage: ()

Returns: ('a -> 'b) -> Result<'a, 'c> -> Result<'b, 'c>
Returns: ('a -> 'b) -> Result<'a, 'c> -> Result<'b, 'c>

(<*>)

Full Usage: (<*>)

Returns: Result<('a -> 'b), 'c> -> Result<'a, 'c> -> Result<'b, 'c>
Returns: Result<('a -> 'b), 'c> -> Result<'a, 'c> -> Result<'b, 'c>

x >>= f

Full Usage: x >>= f

Parameters:
Returns: Result<'c, 'b>
x : Result<'a, 'b>
f : 'a -> Result<'c, 'b>
Returns: Result<'c, 'b>

apply f result

Full Usage: apply f result

Parameters:
Returns: Result<'b, 'c>
f : Result<('a -> 'b), 'c>
result : Result<'a, 'c>
Returns: Result<'b, 'c>

bind f

Full Usage: bind f

Parameters:
Returns: Result<'b, 'd> -> Result<'c, 'd>
f : 'b -> Result<'c, 'd>
Returns: Result<'b, 'd> -> Result<'c, 'd>

doubleMap successFunc failureFunc

Full Usage: doubleMap successFunc failureFunc

Parameters:
    successFunc : 'a -> 'b
    failureFunc : 'c -> 'd

Returns: Result<'a, 'c> -> Result<'b, 'd>
successFunc : 'a -> 'b
failureFunc : 'c -> 'd
Returns: Result<'a, 'c> -> Result<'b, 'd>

either successFunc failureFunc twoTrackInput

Full Usage: either successFunc failureFunc twoTrackInput

Parameters:
    successFunc : 'a -> 'b
    failureFunc : 'c -> 'b
    twoTrackInput : Result<'a, 'c>

Returns: 'b
successFunc : 'a -> 'b
failureFunc : 'c -> 'b
twoTrackInput : Result<'a, 'c>
Returns: 'b

fail x

Full Usage: fail x

Parameters:
    x : 'a

Returns: Result<'b, 'a>
x : 'a
Returns: Result<'b, 'a>

forceOk r

Full Usage: forceOk r

Parameters:
Returns: 'a
r : Result<'a, string>
Returns: 'a

lift f result

Full Usage: lift f result

Parameters:
    f : 'a -> 'b
    result : Result<'a, 'c>

Returns: Result<'b, 'c>
f : 'a -> 'b
result : Result<'a, 'c>
Returns: Result<'b, 'c>

map f

Full Usage: map f

Parameters:
    f : 'a -> 'b

Returns: Result<'a, 'c> -> Result<'b, 'c>
f : 'a -> 'b
Returns: Result<'a, 'c> -> Result<'b, 'c>

mapResult f list

Full Usage: mapResult f list

Parameters:
    f : 'a -> Result<'b, 'c>
    list : 'a list

Returns: Result<'b list, 'c>
f : 'a -> Result<'b, 'c>
list : 'a list
Returns: Result<'b list, 'c>

ofOption errorMessage o

Full Usage: ofOption errorMessage o

Parameters:
    errorMessage : 'a
    o : 'b option

Returns: Result<'b, 'a>
errorMessage : 'a
o : 'b option
Returns: Result<'b, 'a>

plus addSuccess addFailure switch1 switch2 x

Full Usage: plus addSuccess addFailure switch1 switch2 x

Parameters:
    addSuccess : 'a -> 'b -> 'c
    addFailure : 'd -> 'd -> 'd
    switch1 : 'e -> Result<'a, 'd>
    switch2 : 'e -> Result<'b, 'd>
    x : 'e

Returns: Result<'c, 'd>
addSuccess : 'a -> 'b -> 'c
addFailure : 'd -> 'd -> 'd
switch1 : 'e -> Result<'a, 'd>
switch2 : 'e -> Result<'b, 'd>
x : 'e
Returns: Result<'c, 'd>

result

Full Usage: result

Returns: ResultBuilder
Returns: ResultBuilder

retn arg0

Full Usage: retn arg0

Parameters:
    arg0 : 'a

Returns: Result<'a, 'b>
arg0 : 'a
Returns: Result<'a, 'b>

succeed x

Full Usage: succeed x

Parameters:
    x : 'a

Returns: Result<'a, 'b>
x : 'a
Returns: Result<'a, 'b>

switch f

Full Usage: switch f

Parameters:
    f : 'a -> 'b

Returns: 'a -> Result<'b, 'c>
f : 'a -> 'b
Returns: 'a -> Result<'b, 'c>

tee f x

Full Usage: tee f x

Parameters:
    f : 'a -> unit
    x : 'a

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

toErrorList result

Full Usage: toErrorList result

Parameters:
Returns: Result<'a, 'b list>
result : Result<'a, 'b>
Returns: Result<'a, 'b list>

toOption r

Full Usage: toOption r

Parameters:
Returns: 'a option

If OK, return Some, otherwise None.

r : Result<'a, 'b>
Returns: 'a option

tryCatch f exnHandler x

Full Usage: tryCatch f exnHandler x

Parameters:
    f : 'a -> 'b
    exnHandler : exn -> 'c
    x : 'a

Returns: Result<'b, 'c>
f : 'a -> 'b
exnHandler : exn -> 'c
x : 'a
Returns: Result<'b, 'c>

Type something to start searching.