FSharpPlus


Free Module

Basic operations on Free Monads

Functions and values

Function or value Description

Free.apply f x

Full Usage: Free.apply f x

Parameters:
    f : Free<^Functor<'T->'U>, ('T -> 'U)>
    x : Free<^Functor<'T>, 'T>

Returns: Free<^Functor<'U>, 'U>
Modifiers: inline
Type parameters: ^Functor<'T->'U>, ^Functor<Free<'Functor<'T->'U>,'T->'U>>, 'T, 'U, ^Functor<Free<'Functor<'U>,'U>>, ^Functor<Free<'Functor<'T>,'T>>, ^Functor<'T>, ^Functor<'U>
f : Free<^Functor<'T->'U>, ('T -> 'U)>
x : Free<^Functor<'T>, 'T>
Returns: Free<^Functor<'U>, 'U>

Free.bind f x

Full Usage: Free.bind f x

Parameters:
    f : 'T -> Free<^Functor<'U>, 'U>
    x : Free<^Functor<'T>, 'T>

Returns: Free<^Functor<'U>, 'U>
Modifiers: inline
Type parameters: 'T, ^Functor<'U>, ^Functor<Free<'Functor<'U>,'U>>, 'U, ^Functor<Free<'Functor<'T>,'T>>, ^Functor<'T>
f : 'T -> Free<^Functor<'U>, 'U>
x : Free<^Functor<'T>, 'T>
Returns: Free<^Functor<'U>, 'U>

Free.fold f x

Full Usage: Free.fold f x

Parameters:
    f : ^Functor<'T> -> ^Monad<'T>
    x : Free<^Functor<'U>, 'U>

Returns: ^Monad<'U>
Modifiers: inline
Type parameters: ^Functor<'T>, ^Functor<'U>, 'U, ^Monad<'T>, ^Monad<'U>

Folds the Free structure into a Monad

f : ^Functor<'T> -> ^Monad<'T>
x : Free<^Functor<'U>, 'U>
Returns: ^Monad<'U>

Free.hoist f x

Full Usage: Free.hoist f x

Parameters:
    f : ^F,'T>> -> ^G,'T>>
    x : Free<^F<'T>, 'T>

Returns: Free<^G<'T>, 'T>
Modifiers: inline
Type parameters: ^F<Free<'F<'T>, 'T>>, ^F<'T>, 'T, ^G<Free<'F<'T>, 'T>>, ^G<Free<'G<'T>, 'T>>, ^G<'T>, ^G<Free<'G<'T>, 'T>>

Lift a natural transformation from functor F to functor G into a natural transformation from Free of F to Free of G.

f : ^F,'T>> -> ^G,'T>>
x : Free<^F<'T>, 'T>
Returns: Free<^G<'T>, 'T>

Free.iterM f x

Full Usage: Free.iterM f x

Parameters:
    f : ^Functor<'Monad<'T>> -> ^Monad<'T>
    x : Free<^Functor<'T>, 'T>

Returns: ^Monad<'T>
Modifiers: inline
Type parameters: ^Functor<'Monad<'T>>, ^Functor<Free<'Functor<'T>,'T>>, ^Functor<'T>, 'T, ^Monad<'T>

Tear down a Free monad using iteration.

f : ^Functor<'Monad<'T>> -> ^Monad<'T>
x : Free<^Functor<'T>, 'T>
Returns: ^Monad<'T>

Free.liftF x

Full Usage: Free.liftF x

Parameters:
    x : ^Functor<'T>

Returns: Free<^Functor<'T>, 'T>
Modifiers: inline
Type parameters: ^Functor<'T>, ^Functor<Free<'Functor<'T>,'T>>, 'T

Lift any Functor into a Free structure.

x : ^Functor<'T>
Returns: Free<^Functor<'T>, 'T>

Free.map f x

Full Usage: Free.map f x

Parameters:
    f : 'T -> 'U
    x : Free<^Functor<'T>, 'T>

Returns: Free<^Functor<'U>, 'U>
Modifiers: inline
Type parameters: 'T, 'U, ^Functor<'T>, ^Functor<Free<'Functor<'T>,'T>>, ^Functor<Free<'Functor<'U>,'U>>, ^Functor<'U>
f : 'T -> 'U
x : Free<^Functor<'T>, 'T>
Returns: Free<^Functor<'U>, 'U>

Free.map2 f x y

Full Usage: Free.map2 f x y

Parameters:
    f : 'T -> 'U -> 'V
    x : Free<^Functor<'T>, 'T>
    y : Free<^Functor<'U>, 'U>

Returns: Free<^Functor<'V>, 'V>
Modifiers: inline
Type parameters: 'T, 'U, 'V, ^Functor<'T>, ^Functor<Free<'Functor<'T>,'T>>, ^Functor<Free<'Functor<'V>,'V>>, ^Functor<Free<'Functor<'U>,'U>>, ^Functor<'U>, ^Functor<'V>
f : 'T -> 'U -> 'V
x : Free<^Functor<'T>, 'T>
y : Free<^Functor<'U>, 'U>
Returns: Free<^Functor<'V>, 'V>

Free.map3 f x y z

Full Usage: Free.map3 f x y z

Parameters:
    f : 'T -> 'U -> 'V -> 'W
    x : Free<^Functor<'T>, 'T>
    y : Free<^Functor<'U>, 'U>
    z : Free<^Functor<'V>, 'V>

Returns: Free<^Functor<'W>, 'W>
Modifiers: inline
Type parameters: 'T, 'U, 'V, 'W, ^Functor<'T>, ^Functor<Free<'Functor<'T>,'T>>, ^Functor<Free<'Functor<'W>,'W>>, ^Functor<Free<'Functor<'U>,'U>>, ^Functor<'U>, ^Functor<'W>, ^Functor<Free<'Functor<'V>,'V>>, ^Functor<'V>
f : 'T -> 'U -> 'V -> 'W
x : Free<^Functor<'T>, 'T>
y : Free<^Functor<'U>, 'U>
z : Free<^Functor<'V>, 'V>
Returns: Free<^Functor<'W>, 'W>

Free.run f

Full Usage: Free.run f

Parameters:
    f : Free<^Functor<'T>, 'T>

Returns: Choice<'T, ^Functor,'T>>>
Modifiers: inline
Type parameters: ^Functor<'T>, ^Functor<Free<'Functor<'T>,'T>>, 'T
f : Free<^Functor<'T>, 'T>
Returns: Choice<'T, ^Functor,'T>>>