FSharpx.Extras


Reader

Namespace: FSharpx

Nested types and modules

TypeDescription
Reader<'R, 'T>
ReaderBuilder

The reader monad. This monad comes from Matthew Podwysocki's http://codebetter.com/blogs/matthew.podwysocki/archive/2010/01/07/much-ado-about-monads-reader-edition.aspx.

Functions and values

Function or valueDescription
( *> ) x y
Signature: x:Reader<'?8687,'?8688> -> y:Reader<'?8687,'?8689> -> Reader<'?8687,'?8689>
Type parameters: '?8687, '?8688, '?8689

Sequence actions, discarding the value of the first argument.

CompiledName: op_MultiplyGreater

( <!> ) f m
Signature: f:('?8678 -> '?8679) -> m:Reader<'?8680,'?8678> -> Reader<'?8680,'?8679>
Type parameters: '?8678, '?8679, '?8680

Infix map

CompiledName: op_LessBangGreater

( <* ) x y
Signature: x:Reader<'?8691,'?8692> -> y:Reader<'?8691,'?8693> -> Reader<'?8691,'?8692>
Type parameters: '?8691, '?8692, '?8693

Sequence actions, discarding the value of the second argument.

CompiledName: op_LessMultiply

( <*> ) f m
Signature: f:Reader<'?8666,('?8667 -> '?8668)> -> m:Reader<'?8666,'?8667> -> Reader<'?8666,'?8668>
Type parameters: '?8666, '?8667, '?8668

Sequential application

CompiledName: op_LessMultiplyGreater

( <=< ) x
Signature: x:('?8704 -> Reader<'?8705,'?8706>) -> ('?8707 -> Reader<'?8705,'?8704>) -> '?8707 -> Reader<'?8705,'?8706>
Type parameters: '?8704, '?8705, '?8706, '?8707

Right-to-left Kleisli composition

CompiledName: op_LessEqualsLess

( =<< ) f m
Signature: f:('?8662 -> Reader<'?8663,'?8664>) -> m:Reader<'?8663,'?8662> -> Reader<'?8663,'?8664>
Type parameters: '?8662, '?8663, '?8664

Flipped >>=

CompiledName: op_EqualsLessLess

( >=> ) f g x
Signature: f:('?8699 -> Reader<'?8700,'?8701>) -> g:('?8701 -> Reader<'?8700,'?8702>) -> x:'?8699 -> Reader<'?8700,'?8702>
Type parameters: '?8699, '?8700, '?8701, '?8702

Left-to-right Kleisli composition

CompiledName: op_GreaterEqualsGreater

( >>. ) m f
Signature: m:Reader<'?8695,'?8696> -> f:Reader<'?8695,'?8697> -> Reader<'?8695,'?8697>
Type parameters: '?8695, '?8696, '?8697

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

CompiledName: op_GreaterGreaterDot

( >>= ) m f
Signature: m:Reader<'?8658,'?8659> -> f:('?8659 -> Reader<'?8658,'?8660>) -> Reader<'?8658,'?8660>
Type parameters: '?8658, '?8659, '?8660

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:Reader<'?8670,'?8671> -> f:Reader<'?8670,('?8671 -> '?8672)> -> Reader<'?8670,'?8672>
Type parameters: '?8670, '?8671, '?8672

Sequential application

ask
Signature: Reader<'R,'R>
Type parameters: 'R
asks f
Signature: f:('?8648 -> '?8649) -> Reader<'?8648,'?8649>
Type parameters: '?8648, '?8649
bind k m r
Signature: k:('?8607 -> '?8608 -> '?8609) -> m:('?8608 -> '?8607) -> r:'?8608 -> '?8609
Type parameters: '?8607, '?8608, '?8609
foldM f s
Signature: f:('?8709 -> '?8710 -> Reader<'?8711,'?8709>) -> s:'?8709 -> seq<'?8710> -> Reader<'?8711,'?8709>
Type parameters: '?8709, '?8710, '?8711
lift2 f a b
Signature: f:('?8682 -> '?8683 -> '?8684) -> a:Reader<'?8685,'?8682> -> b:Reader<'?8685,'?8683> -> Reader<'?8685,'?8684>
Type parameters: '?8682, '?8683, '?8684, '?8685

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

local f m
Signature: f:('r1 -> 'r2) -> m:Reader<'r2,'T> -> Reader<'r1,'T>
Type parameters: 'r1, 'r2, 'T
map f m
Signature: f:('?8674 -> '?8675) -> m:Reader<'?8676,'?8674> -> Reader<'?8676,'?8675>
Type parameters: '?8674, '?8675, '?8676

Transforms a Reader value by using a specified mapping function.

mapM f x
Signature: f:('?8716 -> Reader<'?8717,'?8718>) -> x:'?8716 list -> Reader<'?8717,'?8718 list>
Type parameters: '?8716, '?8717, '?8718
reader
Signature: ReaderBuilder
returnM x
Signature: x:'?8655 -> Reader<'?8656,'?8655>
Type parameters: '?8655, '?8656

Inject a value into the Reader type

sequence s
Signature: s:Reader<'?8713,'?8714> list -> Reader<'?8713,'?8714 list>
Type parameters: '?8713, '?8714
Fork me on GitHub