FSharpx.Extras


Writer

Namespace: FSharpx

Nested types and modules

TypeDescription
Writer<'W, 'T>
WriterBuilder<'W>

The writer monad. This monad comes from Matthew Podwysocki's http://codebetter.com/blogs/matthew.podwysocki/archive/2010/02/01/a-kick-in-the-monads-writer-edition.aspx.

Functions and values

Function or valueDescription
( *> ) x y
Signature: x:Writer<string list,'?7625> -> y:Writer<string list,'?7626> -> Writer<string list,'?7626>
Type parameters: '?7625, '?7626

Sequence actions, discarding the value of the first argument.

CompiledName: op_MultiplyGreater

( <!> ) f m
Signature: f:('?7618 -> '?7619) -> m:Writer<string list,'?7618> -> Writer<string list,'?7619>
Type parameters: '?7618, '?7619

Infix map

CompiledName: op_LessBangGreater

( <* ) x y
Signature: x:Writer<string list,'?7628> -> y:Writer<string list,'?7629> -> Writer<string list,'?7628>
Type parameters: '?7628, '?7629

Sequence actions, discarding the value of the second argument.

CompiledName: op_LessMultiply

( <*> ) f m
Signature: f:Writer<string list,('?7609 -> '?7610)> -> m:Writer<string list,'?7609> -> Writer<string list,'?7610>
Type parameters: '?7609, '?7610

Sequential application

CompiledName: op_LessMultiplyGreater

( <=< ) x
Signature: x:('?7638 -> Writer<string list,'?7639>) -> ('?7640 -> Writer<string list,'?7638>) -> '?7640 -> Writer<string list,'?7639>
Type parameters: '?7638, '?7639, '?7640

Right-to-left Kleisli composition

CompiledName: op_LessEqualsLess

( =<< ) f m
Signature: f:('?7606 -> Writer<string list,'?7607>) -> m:Writer<string list,'?7606> -> Writer<string list,'?7607>
Type parameters: '?7606, '?7607

Flipped >>=

CompiledName: op_EqualsLessLess

( >=> ) f g x
Signature: f:('?7634 -> Writer<string list,'?7635>) -> g:('?7635 -> Writer<string list,'?7636>) -> x:'?7634 -> Writer<string list,'?7636>
Type parameters: '?7634, '?7635, '?7636

Left-to-right Kleisli composition

CompiledName: op_GreaterEqualsGreater

( >>. ) m f
Signature: m:Writer<string list,'?7631> -> f:Writer<string list,'?7632> -> Writer<string list,'?7632>
Type parameters: '?7631, '?7632

Sequentially compose two state actions, discarding any value produced by the first

CompiledName: op_GreaterGreaterDot

( >>= ) m f
Signature: m:Writer<string list,'?7603> -> f:('?7603 -> Writer<string list,'?7604>) -> Writer<string list,'?7604>
Type parameters: '?7603, '?7604

Sequentially compose two actions, passing any value produced by the first as an argument to the second.

CompiledName: op_GreaterGreaterEquals

ap m f
Signature: m:Writer<string list,'?7612> -> f:Writer<string list,('?7612 -> '?7613)> -> Writer<string list,'?7613>
Type parameters: '?7612, '?7613

Sequential application

bind m k writer ()
Signature: m:Monoid<'W> -> k:('T -> Writer<'W,'U>) -> writer:Writer<'W,'T> -> unit -> 'U * 'W
Type parameters: 'W, 'T, 'U
censor monoid f m
Signature: monoid:Monoid<'w1> -> f:('w1 -> 'w2) -> m:Writer<'w1,'T> -> Writer<'w2,'T>
Type parameters: 'w1, 'w2, 'T
foldM f s
Signature: f:('?7642 -> '?7643 -> Writer<string list,'?7642>) -> s:'?7642 -> seq<'?7643> -> Writer<string list,'?7642>
Type parameters: '?7642, '?7643
lift2 f a b
Signature: f:('?7621 -> '?7622 -> '?7623) -> a:Writer<string list,'?7621> -> b:Writer<string list,'?7622> -> Writer<string list,'?7623>
Type parameters: '?7621, '?7622, '?7623

Promote a function to a monad/applicative, scanning the monadic/applicative arguments from left to right.

listen m ()
Signature: m:(unit -> '?7585 * '?7586) -> unit -> ('?7585 * '?7586) * '?7586
Type parameters: '?7585, '?7586
listens monoid f m
Signature: monoid:Monoid<'?7592> -> f:('?7593 -> '?7594) -> m:Writer<'?7592,('?7595 * '?7593)> -> unit -> ('?7595 * '?7594) * '?7592
Type parameters: '?7592, '?7593, '?7594, '?7595
map f m
Signature: f:('?7615 -> '?7616) -> m:Writer<string list,'?7615> -> Writer<string list,'?7616>
Type parameters: '?7615, '?7616

Transforms a Writer value by using a specified mapping function.

mapM f x
Signature: f:('?7647 -> Writer<string list,'?7648>) -> x:'?7647 list -> Writer<string list,'?7648 list>
Type parameters: '?7647, '?7648
pass m ()
Signature: m:(unit -> ('?7588 * ('?7589 -> '?7590)) * '?7589) -> unit -> '?7588 * '?7590
Type parameters: '?7588, '?7589, '?7590
returnM monoid a ()
Signature: monoid:Monoid<'?7543> -> a:'?7544 -> unit -> '?7544 * '?7543
Type parameters: '?7543, '?7544

Inject a value into the Writer type

sequence s
Signature: s:Writer<string list,'?7645> list -> Writer<string list,'?7645 list>
Type parameters: '?7645
tell w ()
Signature: w:'?7583 -> unit -> unit * '?7583
Type parameters: '?7583
writer
Signature: WriterBuilder<string list>
Fork me on GitHub