Yaaf.FSharp.Helper


Writer

Defined in Yaaf.FSharp.Helper.dll.

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,'?20427> -> y:Writer<string list,'?20428> -> Writer<string list,'?20428>
Type parameters: '?20427, '?20428

Sequence actions, discarding the value of the first argument.

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

Infix map

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

Sequence actions, discarding the value of the second argument.

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

Sequential application

( <=< ) x
Signature: x:('?20440 -> Writer<string list,'?20441>) -> ('?20442 -> Writer<string list,'?20440>) -> '?20442 -> Writer<string list,'?20441>
Type parameters: '?20440, '?20441, '?20442

Right-to-left Kleisli composition

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

Flipped >>=

( >=> ) f g x
Signature: f:('?20436 -> Writer<string list,'?20437>) -> g:('?20437 -> Writer<string list,'?20438>) -> x:'?20436 -> Writer<string list,'?20438>
Type parameters: '?20436, '?20437, '?20438

Left-to-right Kleisli composition

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

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

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

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

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

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:('?20444 -> '?20445 -> Writer<string list,'?20444>) -> s:'?20444 -> seq<'?20445> -> Writer<string list,'?20444>
Type parameters: '?20444, '?20445
lift2 f a b
Signature: f:('?20423 -> '?20424 -> '?20425) -> a:Writer<string list,'?20423> -> b:Writer<string list,'?20424> -> Writer<string list,'?20425>
Type parameters: '?20423, '?20424, '?20425

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

listen m ()
Signature: m:(unit -> '?20387 * '?20388) -> unit -> ('?20387 * '?20388) * '?20388
Type parameters: '?20387, '?20388
listens monoid f m
Signature: monoid:Monoid<'?20394> -> f:('?20395 -> '?20396) -> m:Writer<'?20394,('?20397 * '?20395)> -> unit -> ('?20397 * '?20396) * '?20394
Type parameters: '?20394, '?20395, '?20396, '?20397
map f m
Signature: f:('?20417 -> '?20418) -> m:Writer<string list,'?20417> -> Writer<string list,'?20418>
Type parameters: '?20417, '?20418

Transforms a Writer value by using a specified mapping function.

mapM f x
Signature: f:('?20449 -> Writer<string list,'?20450>) -> x:'?20449 list -> Writer<string list,'?20450 list>
Type parameters: '?20449, '?20450
pass m ()
Signature: m:(unit -> ('?20390 * ('?20391 -> '?20392)) * '?20391) -> unit -> '?20390 * '?20392
Type parameters: '?20390, '?20391, '?20392
returnM monoid a ()
Signature: monoid:Monoid<'?20345> -> a:'?20346 -> unit -> '?20346 * '?20345
Type parameters: '?20345, '?20346

Inject a value into the Writer type

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