h"/      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                                                                                                      (c) Russell O'Connor 2009 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe.343 transformersThe same functor, but with an 6 instance that performs actions in the reverse order. transformersDerived instance. transformersDerived instance. transformersDerived instance. transformers&Try alternatives in the same order as f. transformersApply f-actions in the reverse order. transformersDerived instance.(c) Ross Paterson 2012 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe.C transformersSignature of the pass operation, introduced in Control.Monad.Trans.Writer. Any lifting function liftPass should satisfy lift . liftPass = liftPass . lift transformersSignature of the listen operation, introduced in Control.Monad.Trans.Writer. Any lifting function  liftListen should satisfy lift . liftListen = liftListen . lift transformersSignature of the catchE operation, introduced in Control.Monad.Trans.Except. Any lifting function  liftCatch should satisfy lift (cf m f) = liftCatch (lift . cf) (lift f) transformersSignature of the callCC operation, introduced in Control.Monad.Trans.Cont. Any lifting function  liftCallCC should satisfy lift (f k) = f' (lift . k) => lift (cf f) = liftCallCC cf f'(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe34O transformersThe class of monad transformers. Instances should satisfy the following laws, which state that  is a monad transformation:  .  =   (m >>= f) =  m >>= ( . f) transformersLift a computation from the argument monad to the constructed monad."(c) The University of Glasgow 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe.34" transformersThe continuation monad transformer. Can be used to add continuation handling to any type constructor: the 4 instance and most of the operations do not require m to be a monad. is not a functor on the category of monads, and many operations cannot be lifted through it. transformersContinuation monad. Cont r a is a CPS ("continuation-passing style") computation that produces an intermediate result of type a5 within a CPS computation whose final result type is r.The return function simply creates a continuation which passes the value on.The >>=> operator adds the bound function into the continuation chain. transformersConstruct a continuation-passing computation from a function. (The inverse of ) transformersThe result of running a CPS computation with a given final continuation. (The inverse of ) transformersThe result of running a CPS computation with the identity as the final continuation.  ( x) = x transformersApply a function to transform the result of a continuation-passing computation.  ( f m) = f .  m transformersApply a function to transform the continuation passed to a CPS computation.  ( f m) =  m . f  transformers  m" delimits the continuation of any ! inside m.   ( m) =  m! transformers! f8 captures the continuation up to the nearest enclosing   and passes it to f:   (! f >>= k) =   (f ( . k))" transformers-The result of running a CPS computation with  as the final continuation. " ( m) = m# transformersApply a function to transform the result of a continuation-passing computation. This has a more restricted type than the map3 operations for other monad transformers, because 6 does not define a functor in the category of monads.  (# f m) = f .  m$ transformersApply a function to transform the continuation passed to a CPS computation.  ($ f m) =  m . f% transformerscallCC (call-with-current-continuation) calls its argument function, passing it the current continuation. It provides an escape continuation mechanism for use with continuation monads. Escape continuations one allow to abort the current computation and return a value immediately. They achieve a similar effect to  and  within an 6 monad. The advantage of this function over calling  is that it makes the continuation explicit, allowing more flexibility and better control.The standard idiom used with callCC is to provide a lambda-expression to name the continuation. Then calling the named continuation anywhere within its scope will escape from the computation, even if it is many layers deep within nested computations.& transformers& m" delimits the continuation of any ' inside m. & ( m) =  m' transformers' f8 captures the continuation up to the nearest enclosing & and passes it to f: & (' f >>= k) = & (f (" . k))( transformers( ask local yields a local function for  r m. transformerscontinuation computation (Cont). transformersthe final continuation, which produces the final result (often ). !"#$%&'( !"#$%&'((c) Michael Weber 2001, (c) Jeff Newbern 2003-2006, (c) Andriy Palamarchuk 2006 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe34)V / transformersThe error monad transformer. It can be used to add error handling to other monads.The ErrorT2 Monad structure is parameterized over two things:e - The error type.m - The inner monad.The 1 function yields a successful computation, while >>=< sequences two subcomputations, failing on the first error.2 transformers5Workaround so that we can have a Haskell 98 instance 4 .4 transformersAn exception to be thrown.Minimal complete definition: 5 or 6.5 transformersCreates an exception without a message. The default implementation is 6 "".6 transformersCreates an exception with a message. The default implementation of 6 s is 5.7 transformers7Map the unwrapped computation using the given function. 1 (7 f m) = f (1 m)8 transformersSignal an error value e. 1 (8 e) =  ( e) 8 e >>= m = 8 e9 transformersHandle an error. 9 h ( m) =  m 9 h (8 e) = h e: transformersLift a callCC operation to the new monad.; transformersLift a listen operation to the new monad.< transformersLift a pass operation to the new monad.A transformers#A string can be thrown as an error.9 transformersthe inner computation transformers.a handler for errors in the inner computation/0123456789:;<45623/01789:;<(C) 2013 Ross Paterson BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe3418V transformers9A monad transformer that adds exceptions to other monads.ExceptT2 constructs a monad parameterized over two things:e - The exception type.m - The inner monad.The  function yields a computation that produces the given value, while >>= sequences two subcomputations, exiting on the first exception.X transformers$The parameterizable exception monad.4Computations are either exceptions or normal values.The ( function returns a normal value, while >>= exits on the first exception. For a variant that continues after an error and collects all the errors, see .Y transformersConstructor for computations in the exception monad. (The inverse of Z).Z transformersExtractor for computations in the exception monad. (The inverse of Y).[ transformers7Map the unwrapped computation using the given function. Z ([ f m) = f (Z m)\ transformersTransform any exceptions thrown by the computation using the given function (a specialization of _).] transformersThe inverse of V.^ transformers7Map the unwrapped computation using the given function. ] (^ f m) = f (] m)_ transformersTransform any exceptions thrown by the computation using the given function.` transformersSignal an exception value e. ] (` e) =  ( e) ` e >>= m = ` ea transformersHandle an exception. a ( m) h =  m a (` e) h = h eb transformersLift a callCC operation to the new monad.c transformersLift a listen operation to the new monad.d transformersLift a pass operation to the new monad.a transformersthe inner computation transformers2a handler for exceptions in the inner computationVWXYZ[\]^_`abcdXYZ[\VW]^_`abcd(c) 2007 Magnus Therning BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe.343:z transformersThe trivial monad transformer, which maps a monad to an equivalent monad.} transformers(Lift a unary operation to the new monad. transformers)Lift a binary operation to the new monad.~ transformersLift a callCC operation to the new monad. transformersLift a catchE operation to the new monad.z{|}~z{|}~(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe345 transformers0Parameterizable list monad, with an inner monad.Note: this does not yield a monad unless the argument monad is commutative. transformers Map between  computations.  ( f m) = f ( m) transformersLift a callCC operation to the new monad. transformersLift a catchE operation to the new monad. (c) 2007 Yitzak Gale, Eric Kidd BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe349 transformersThe parameterizable maybe monad, obtained by composing an arbitrary monad with the  monad.:Computations are actions that may produce a value or exit.The  function yields a computation that produces that value, while >>= sequences two subcomputations, exiting if either computation does. transformers#Transform the computation inside a MaybeT.  ( f m) = f ( m) transformers Convert a  computation to V", with a default exception value. transformers Convert a V computation to ), discarding the value of any exception. transformersLift a callCC operation to the new monad. transformersLift a catchE operation to the new monad. transformersLift a listen operation to the new monad. transformersLift a pass operation to the new monad.   (c) Daniel Mendler 2016, (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe34O5  transformers:A monad transformer adding reading an environment of type r , collecting an output of type w and updating a state of type s to an inner monad m. transformers*A monad containing an environment of type r, output of type w! and an updatable state of type s. transformers?Construct an RWS computation from a function. (The inverse of .) transformers:Unwrap an RWS computation as a function. (The inverse of .) transformersEvaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state. transformersEvaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value. transformersMap the return value, final state and output of a computation using the given function.  ( f m) r s = f ( m r s) transformers f m executes action m= with an initial environment and state modified by applying f.  ( f m) r s =  ( m) (f r s) transformersConstruct an RWST computation from a function. (The inverse of .) transformers;Unwrap an RWST computation as a function. (The inverse of .) transformersEvaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state. transformersEvaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value. transformers3Map the inner computation using the given function. ( f m) r s = f ( m r s) mapRWST :: (m (a, s, w) -> n (b, s, w')) -> RWST r w s m a -> RWST r w' s n b transformers f m executes action m= with an initial environment and state modified by applying f.  ( f m) r s =  ( m) (f r s) transformersConstructor for computations in the reader monad (equivalent to ). transformers#Fetch the value of the environment. transformers/Execute a computation in a modified environment  ( f m) r s =  m (f r) s transformers/Retrieve a function of the current environment.  f =  f  transformers ((a, w), w)) ( m r s) transformers f m' is an action that executes the action m" and adds the result of applying f/ to the output to the value of the computation.  f m =  (id *** f) ( m)  ( f m) r s =  (\ (a, w) -> ((a, f w), w)) ( m r s) transformers m' is an action that executes the action m, which returns a value and a function, and returns the value, applying the function to the output.  ( m) r s =  (\ ((a, f), w) -> (a, f w)) ( m r s) transformers f m' is an action that executes the action m and applies the function f4 to its output, leaving the return value unchanged.  f m =  ( (\ x -> (x,f)) m)  ( f m) r s =  (\ (a, w) -> (a, f w)) ( m r s) transformersConstruct a state monad computation from a state transformer function. transformers6Fetch the current value of the state within the monad. transformers s$ sets the state within the monad to s. transformers f is an action that updates the state to the result of applying f to the current state.  f =  >>= ( . f) transformersGet a specific component of the state, using a projection function supplied.  f =  f  transformersUniform lifting of a callCC operation to the new monad. This version rolls back to the original state on entering the continuation. transformersIn-situ lifting of a callCC operation to the new monad. This version uses the current state on entering the continuation. transformersLift a catchE operation to the new monad. transformersRWS computation to execute transformersinitial environment transformers initial value transformersfinal value and output transformersRWS computation to execute transformersinitial environment transformers initial value transformersfinal state and output transformerscomputation to execute transformersinitial environment transformers initial value transformers+computation yielding final value and output transformerscomputation to execute transformersinitial environment transformers initial value transformers+computation yielding final state and output   (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe34c transformers:A monad transformer adding reading an environment of type r , collecting an output of type w and updating a state of type s to an inner monad m. transformers*A monad containing an environment of type r, output of type w! and an updatable state of type s. transformers?Construct an RWS computation from a function. (The inverse of .) transformers:Unwrap an RWS computation as a function. (The inverse of .) transformersEvaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state. transformersEvaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value. transformersMap the return value, final state and output of a computation using the given function.  ( f m) r s = f ( m r s) transformers f m executes action m= with an initial environment and state modified by applying f.  ( f m) r s =  ( m) (f r s) transformersEvaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state. transformersEvaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value. transformers3Map the inner computation using the given function.  ( f m) r s = f ( m r s) transformers f m executes action m= with an initial environment and state modified by applying f.  ( f m) r s =  ( m) (f r s) transformersConstructor for computations in the reader monad (equivalent to ). transformers#Fetch the value of the environment. transformers/Execute a computation in a modified environment  ( f m) r s =  m (f r) s transformers/Retrieve a function of the current environment.  f =  f  transformers ((a, w), w)) ( m r s) transformers f m' is an action that executes the action m" and adds the result of applying f/ to the output to the value of the computation.  f m =  (id *** f) ( m)  ( f m) r s =  (\ (a, w) -> ((a, f w), w)) ( m r s) transformers m' is an action that executes the action m, which returns a value and a function, and returns the value, applying the function to the output.  ( m) r s =  (\ ((a, f), w) -> (a, f w)) ( m r s) transformers f m' is an action that executes the action m and applies the function f4 to its output, leaving the return value unchanged.  f m =  ( (\ x -> (x,f)) m)  ( f m) r s =  (\ (a, w) -> (a, f w)) ( m r s) transformersConstruct a state monad computation from a state transformer function. transformers6Fetch the current value of the state within the monad. transformers s$ sets the state within the monad to s. transformers f is an action that updates the state to the result of applying f to the current state.  f =  >>= ( . f) transformersGet a specific component of the state, using a projection function supplied.  f =  f  transformersUniform lifting of a callCC operation to the new monad. This version rolls back to the original state on entering the continuation. transformersIn-situ lifting of a callCC operation to the new monad. This version uses the current state on entering the continuation. transformersLift a catchE operation to the new monad. transformersRWS computation to execute transformersinitial environment transformers initial value transformersfinal value and output transformersRWS computation to execute transformersinitial environment transformers initial value transformersfinal state and output transformerscomputation to execute transformersinitial environment transformers initial value transformers+computation yielding final value and output transformerscomputation to execute transformersinitial environment transformers initial value transformers+computation yielding final state and output  (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafee  (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe34yi transformers:A monad transformer adding reading an environment of type r , collecting an output of type w and updating a state of type s to an inner monad m. transformers*A monad containing an environment of type r, output of type w! and an updatable state of type s. transformers?Construct an RWS computation from a function. (The inverse of .) transformers:Unwrap an RWS computation as a function. (The inverse of .) transformersEvaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state. transformersEvaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value. transformersMap the return value, final state and output of a computation using the given function.  ( f m) r s = f ( m r s) transformers f m executes action m= with an initial environment and state modified by applying f.  ( f m) r s =  ( m) (f r s) transformersEvaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state. transformersEvaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value. transformers3Map the inner computation using the given function.  ( f m) r s = f ( m r s) transformers f m executes action m= with an initial environment and state modified by applying f.  ( f m) r s =  ( m) (f r s) transformersConstructor for computations in the reader monad (equivalent to ). transformers#Fetch the value of the environment. transformers/Execute a computation in a modified environment  ( f m) r s =  m (f r) s transformers/Retrieve a function of the current environment.  f =  f  transformers ((a, w), w)) ( m r s) transformers f m' is an action that executes the action m" and adds the result of applying f/ to the output to the value of the computation.  f m =  (id *** f) ( m)  ( f m) r s =  (\ (a, w) -> ((a, f w), w)) ( m r s) transformers m' is an action that executes the action m, which returns a value and a function, and returns the value, applying the function to the output.  ( m) r s =  (\ ((a, f), w) -> (a, f w)) ( m r s) transformers f m' is an action that executes the action m and applies the function f4 to its output, leaving the return value unchanged.  f m =  ( (\ x -> (x,f)) m)  ( f m) r s =  (\ (a, w) -> (a, f w)) ( m r s) transformersConstruct a state monad computation from a state transformer function. transformers6Fetch the current value of the state within the monad. transformers s$ sets the state within the monad to s. transformers f is an action that updates the state to the result of applying f to the current state.  f =  >>= ( . f) transformersGet a specific component of the state, using a projection function supplied.  f =  f  transformersUniform lifting of a callCC operation to the new monad. This version rolls back to the original state on entering the continuation. transformersIn-situ lifting of a callCC operation to the new monad. This version uses the current state on entering the continuation. transformersLift a catchE operation to the new monad. transformersRWS computation to execute transformersinitial environment transformers initial value transformersfinal value and output transformersRWS computation to execute transformersinitial environment transformers initial value transformersfinal state and output transformerscomputation to execute transformersinitial environment transformers initial value transformers+computation yielding final value and output transformerscomputation to execute transformersinitial environment transformers initial value transformers+computation yielding final state and output   (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe34  transformersThe reader monad transformer, which adds a read-only environment to the given monad.The ) function ignores the environment, while >>=; passes the inherited environment to both subcomputations. transformers!The parameterizable reader monad.3Computations are functions of a shared environment.The ) function ignores the environment, while >>=; passes the inherited environment to both subcomputations. transformersConstructor for computations in the reader monad (equivalent to ). transformersRuns a Reader8 and extracts the final value from it. (The inverse of .) transformers"Transform the value returned by a Reader.  ( f m) = f .  m transformersExecute a computation in a modified environment (a specialization of ).  ( f m) =  m . f transformers#Transform the computation inside a ReaderT.  ( f m) = f .  m transformersExecute a computation in a modified environment (a more general version of ).  ( f m) =  m . f transformers#Fetch the value of the environment. transformersExecute a computation in a modified environment (a specialization of ).  ( f m) =  m . f transformers/Retrieve a function of the current environment.  f =  f  transformersLift a callCC operation to the new monad. transformersLift a catchE operation to the new monad. transformersA Reader to run. transformersAn initial environment. transformers'The function to modify the environment. transformers/Computation to run in the modified environment. transformers'The function to modify the environment. transformers/Computation to run in the modified environment. transformers'The function to modify the environment. transformers/Computation to run in the modified environment. transformers2The selector function to apply to the environment.(c) Ross Paterson 2017 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe.346  transformersSelection monad transformer. is not a functor on the category of monads, and many operations cannot be lifted through it. transformersSelection monad. transformers4Constructor for computations in the selection monad. transformersRuns a Select computation with a function for evaluating answers to select a particular answer. (The inverse of .) transformersApply a function to transform the result of a selection computation.  ( f m) = f .  m transformersRuns a SelectT computation with a function for evaluating answers to select a particular answer. (The inverse of .) transformersApply a function to transform the result of a selection computation. This has a more restricted type than the map3 operations for other monad transformers, because 6 does not define a functor in the category of monads.  ( f m) = f .  m transformersConvert a selection computation to a continuation-passing computation. transformersDeprecated name for .  (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe34s transformers+A state transformer monad parameterized by:s - The state.m - The inner monad.The , function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second. transformers(A state monad parameterized by the type s of the state to carry.The , function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second. transformersConstruct a state monad computation from a function. (The inverse of .) transformersUnwrap a state monad computation as a function. (The inverse of .) transformersEvaluate a state computation with the given initial state and return the final value, discarding the final state.  m s =  ( m s) transformersEvaluate a state computation with the given initial state and return the final state, discarding the final value.  m s =  ( m s) transformersMap both the return value and final state of a computation using the given function.  ( f m) = f .  m transformers f m executes action m" on a state modified by applying f.  f m =  f >> m transformersEvaluate a state computation with the given initial state and return the final value, discarding the final state.  m s =   ( m s) transformersEvaluate a state computation with the given initial state and return the final state, discarding the final value.  m s =   ( m s) transformersMap both the return value and final state of a computation using the given function.  ( f m) = f .  m transformers f m executes action m" on a state modified by applying f.  f m =  f >> m transformers6Fetch the current value of the state within the monad. transformers s$ sets the state within the monad to s. transformers f is an action that updates the state to the result of applying f to the current state.  f =  >>= ( . f) transformers A variant of 6 in which the computation is strict in the new state.  f =  >>= (()  . f) transformersGet a specific component of the state, using a projection function supplied.  f =  f  transformersUniform lifting of a callCC operation to the new monad. This version rolls back to the original state on entering the continuation. transformersIn-situ lifting of a callCC operation to the new monad. This version uses the current state on entering the continuation. It does not satisfy the uniformity property (see Control.Monad.Signatures). transformersLift a catchE operation to the new monad. transformersLift a listen operation to the new monad. transformersLift a pass operation to the new monad. transformerspure state transformer transformers$equivalent state-passing computation transformers$state-passing computation to execute transformers initial state transformersreturn value and final state transformers$state-passing computation to execute transformers initial value transformers%return value of the state computation transformers$state-passing computation to execute transformers initial value transformers final state(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe34 transformers+A state transformer monad parameterized by:s - The state.m - The inner monad.The , function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second. transformers(A state monad parameterized by the type s of the state to carry.The , function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second. transformersConstruct a state monad computation from a function. (The inverse of .) transformersUnwrap a state monad computation as a function. (The inverse of .) transformersEvaluate a state computation with the given initial state and return the final value, discarding the final state.  m s =  ( m s) transformersEvaluate a state computation with the given initial state and return the final state, discarding the final value.  m s =  ( m s) transformersMap both the return value and final state of a computation using the given function.  ( f m) = f .  m transformers f m executes action m" on a state modified by applying f.  f m =  f >> m transformersEvaluate a state computation with the given initial state and return the final value, discarding the final state.  m s =   ( m s) transformersEvaluate a state computation with the given initial state and return the final state, discarding the final value.  m s =   ( m s) transformersMap both the return value and final state of a computation using the given function.  ( f m) = f .  m transformers f m executes action m" on a state modified by applying f.  f m =  f >> m transformers6Fetch the current value of the state within the monad. transformers s$ sets the state within the monad to s. transformers f is an action that updates the state to the result of applying f to the current state.  f =  >>= ( . f) transformers A variant of 6 in which the computation is strict in the new state.  f =  >>= (()  . f) transformersGet a specific component of the state, using a projection function supplied.  f =  f  transformersUniform lifting of a callCC operation to the new monad. This version rolls back to the original state on entering the continuation. transformersIn-situ lifting of a callCC operation to the new monad. This version uses the current state on entering the continuation. It does not satisfy the uniformity property (see Control.Monad.Signatures). transformersLift a catchE operation to the new monad. transformersLift a listen operation to the new monad. transformersLift a pass operation to the new monad. transformerspure state transformer transformers$equivalent state-passing computation transformers$state-passing computation to execute transformers initial state transformersreturn value and final state transformers$state-passing computation to execute transformers initial value transformers%return value of the state computation transformers$state-passing computation to execute transformers initial value transformers final state(c) Daniel Mendler 2016, (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe34 transformers A writer monad parameterized by:w - the output to accumulate.m - The inner monad.The  function produces the output , while 4 combines the outputs of the subcomputations using . transformers)A writer monad parameterized by the type w of output to accumulate.The  function produces the output , while 4 combines the outputs of the subcomputations using . transformersConstruct a writer computation from a (result, output) pair. (The inverse of .) transformersUnwrap a writer computation as a (result, output) pair. (The inverse of .) transformers-Extract the output from a writer computation.  m =  ( m) transformersMap both the return value and output of a computation using the given function.  ( f m) = f ( m) transformersConstruct a writer computation from a (result, output) computation. (The inverse of .) transformers.Unwrap a writer computation. (The inverse of .) transformers-Extract the output from a writer computation.  m =   ( m) transformersMap both the return value and output of a computation using the given function.  ( f m) = f ( m) transformers w' is an action that produces the output w. transformers m' is an action that executes the action m6 and adds its output to the value of the computation.  ( m) =  (\ (a, w) -> ((a, w), w)) ( m) transformers f m' is an action that executes the action m" and adds the result of applying f/ to the output to the value of the computation.  f m =  (id *** f) ( m)  ( f m) =  (\ (a, w) -> ((a, f w), w)) ( m) transformers m' is an action that executes the action m, which returns a value and a function, and returns the value, applying the function to the output.  ( m) =  (\ ((a, f), w) -> (a, f w)) ( m) transformers f m' is an action that executes the action m and applies the function f4 to its output, leaving the return value unchanged.  f m =  ( (\ x -> (x,f)) m)  ( f m) =  (\ (a, w) -> (a, f w)) ( m) transformersUniform lifting of a callCC operation to the new monad. This version rolls back to the original state on entering the continuation. transformersLift a catchE operation to the new monad.(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe344 transformers A writer monad parameterized by:w - the output to accumulate.m - The inner monad.The  function produces the output , while >>=4 combines the outputs of the subcomputations using . transformers)A writer monad parameterized by the type w of output to accumulate.The  function produces the output , while >>=4 combines the outputs of the subcomputations using . transformersConstruct a writer computation from a (result, output) pair. (The inverse of .) transformersUnwrap a writer computation as a (result, output) pair. (The inverse of .) transformers-Extract the output from a writer computation.  m =  ( m) transformersMap both the return value and output of a computation using the given function.  ( f m) = f ( m) transformers-Extract the output from a writer computation.  m =   ( m) transformersMap both the return value and output of a computation using the given function.  ( f m) = f ( m) transformers w' is an action that produces the output w. transformers m' is an action that executes the action m6 and adds its output to the value of the computation.  ( m) =  (\ (a, w) -> ((a, w), w)) ( m) transformers f m' is an action that executes the action m" and adds the result of applying f/ to the output to the value of the computation.  f m =  (id *** f) ( m)  ( f m) =  (\ (a, w) -> ((a, f w), w)) ( m) transformers m' is an action that executes the action m, which returns a value and a function, and returns the value, applying the function to the output.  ( m) =  (\ ((a, f), w) -> (a, f w)) ( m) transformers f m' is an action that executes the action m and applies the function f4 to its output, leaving the return value unchanged.  f m =  ( (\ x -> (x,f)) m)  ( f m) =  (\ (a, w) -> (a, f w)) ( m) transformersLift a callCC operation to the new monad. transformersLift a catchE operation to the new monad.(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafeF(c) Nickolay Kudasov 2016 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe34 transformers'An accumulation monad parameterized by:w - the output to accumulate.m - The inner monad.The  function produces the output , while >>=4 combines the outputs of the subcomputations using .This monad transformer is similar to both state and writer monad transformers. Thus it can be seen asa restricted append-only version of a state monad transformer ora writer monad transformer with the extra ability to read all previous output. transformers0An accumulation monad parameterized by the type w of output to accumulate.The  function produces the output , while >>=4 combines the outputs of the subcomputations using . transformersConstruct an accumulation computation from a (result, output) pair. (The inverse of .) transformersUnwrap an accumulation computation as a (result, output) pair. (The inverse of .) transformers4Extract the output from an accumulation computation.  m w =  ( m w) transformersEvaluate an accumulation computation with the given initial output history and return the final value, discarding the final output.  m w =  ( m w) transformersMap both the return value and output of a computation using the given function.  ( f m) = f .  m transformers#Unwrap an accumulation computation. transformers4Extract the output from an accumulation computation.  m w =   ( m w) transformersEvaluate an accumulation computation with the given initial output history and return the final value, discarding the final output.  m w =   ( m w) transformersMap both the return value and output of a computation using the given function.  ( f m) = f .  m transformers is an action that fetches all the previously accumulated output. transformers is an action that retrieves a function of the previously accumulated output. transformers w' is an action that produces the output w. transformersUniform lifting of a callCC operation to the new monad. This version rolls back to the original output history on entering the continuation. transformersIn-situ lifting of a callCC operation to the new monad. This version uses the current output history on entering the continuation. It does not satisfy the uniformity property (see Control.Monad.Signatures). transformersLift a catchE operation to the new monad. transformersLift a listen operation to the new monad. transformersLift a pass operation to the new monad. transformersConvert a read-only computation into an accumulation computation. transformers>Convert a writer computation into an accumulation computation. transformersConvert an accumulation (append-only) computation into a fully stateful computation.(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe34֏ transformers A writer monad parameterized by:w - the output to accumulate.m - The inner monad.The  function produces the output , while >>=4 combines the outputs of the subcomputations using . transformers)A writer monad parameterized by the type w of output to accumulate.The  function produces the output , while >>=4 combines the outputs of the subcomputations using . transformersConstruct a writer computation from a (result, output) pair. (The inverse of .) transformersUnwrap a writer computation as a (result, output) pair. (The inverse of .) transformers-Extract the output from a writer computation.  m =  ( m) transformersMap both the return value and output of a computation using the given function.  ( f m) = f ( m) transformers-Extract the output from a writer computation.  m =   ( m) transformersMap both the return value and output of a computation using the given function.  ( f m) = f ( m) transformers w' is an action that produces the output w. transformers m' is an action that executes the action m6 and adds its output to the value of the computation.  ( m) =  (\ (a, w) -> ((a, w), w)) ( m) transformers f m' is an action that executes the action m" and adds the result of applying f/ to the output to the value of the computation.  f m =  (id *** f) ( m)  ( f m) =  (\ (a, w) -> ((a, f w), w)) ( m) transformers m' is an action that executes the action m, which returns a value and a function, and returns the value, applying the function to the output.  ( m) =  (\ ((a, f), w) -> (a, f w)) ( m) transformers f m' is an action that executes the action m and applies the function f4 to its output, leaving the return value unchanged.  f m =  ( (\ x -> (x,f)) m)  ( f m) =  (\ (a, w) -> (a, f w)) ( m) transformersLift a callCC operation to the new monad. transformersLift a catchE operation to the new monad.(c) Ross Paterson 2010 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe.34 transformersConstant functor.(c) Ross Paterson 2010 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe34ܶ  transformersAn applicative functor that collects a monoid (e.g. lists) of errors. A sequence of computations fails if any of its components do, but unlike monads made with ExceptT from Control.Monad.Trans.Except, these computations continue after an error, collecting all the errors.  f   x =  (f x)  f   e =  e  e   x =  e  e1   e2 =  (e1  e2) transformersApplicative functor formed by adding pure computations to a given applicative functor. transformers Projection to the other functor. transformers0Apply a transformation to the other computation. transformersEliminator for .  f g .  = f  f g .  = g transformers4Extractor for computations with accumulating errors.  ( x) =  x  ( e) =  e transformersReport an error. transformers Convert from  to  (inverse of ). transformersA combination is  only either part is. transformersA combination is  only if both parts are.  (c) Russell O'Connor 2009 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe.34  transformersThe same functor, but with  and ; instances that process the elements in the reverse order. transformersDerived instance. transformersTraverse from right to left. transformersFold from right to left. transformersDerived instance. transformersDerived instance. transformersDerived instance. transformersDerived instance. transformersDerived instance. !"#$%&'()*+,-./01234556789:;<=>?@ABCDEFGHIJKLLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyVWXz{|}~VV       V  W X                                                   V                                         V                                          V                          V            VWXVWXVVVWXVtransformers-0.5.6.2Control.Applicative.BackwardsControl.Monad.SignaturesControl.Monad.Trans.ClassControl.Monad.Trans.ContControl.Monad.Trans.ErrorControl.Monad.Trans.ExceptControl.Monad.Trans.IdentityControl.Monad.Trans.ListControl.Monad.Trans.MaybeControl.Monad.Trans.RWS.CPSControl.Monad.Trans.RWS.LazyControl.Monad.Trans.RWS.StrictControl.Monad.Trans.ReaderControl.Monad.Trans.SelectControl.Monad.Trans.State.Lazy Control.Monad.Trans.State.StrictControl.Monad.Trans.Writer.CPSControl.Monad.Trans.Writer.LazyControl.Monad.Trans.Accum!Control.Monad.Trans.Writer.StrictData.Functor.ConstantControl.Applicative.LiftData.Functor.ReversethrowEcatchEExceptTErrorsControl.Monad.Trans.RWSControl.Monad.Trans.StateControl.Monad.Trans.Writer Backwardsforwards$fContravariantBackwards$fTraversableBackwards$fFoldableBackwards$fAlternativeBackwards$fApplicativeBackwards$fFunctorBackwards$fShowBackwards$fReadBackwards$fOrdBackwards $fEqBackwards$fShow1Backwards$fRead1Backwards$fOrd1Backwards$fEq1BackwardsPassListenCatchCallCC MonadTransliftContTrunContTContcontrunContevalContmapContwithContresetshift evalContTmapContT withContTcallCCresetTshiftT liftLocal$fMonadIOContT$fMonadTransContT$fMonadFailContT $fMonadContT$fApplicativeContT$fFunctorContTErrorT runErrorT ErrorListlistMsgErrornoMsgstrMsg mapErrorT throwError catchError liftCallCC liftListenliftPass$fErrorIOException$fMonadPlusEither$fAlternativeEither$fErrorListChar $fError[]$fContravariantErrorT$fMonadIOErrorT$fMonadTransErrorT$fMonadFixErrorT$fMonadPlusErrorT$fMonadFailErrorT $fMonadErrorT$fAlternativeErrorT$fApplicativeErrorT$fTraversableErrorT$fFoldableErrorT$fFunctorErrorT $fShowErrorT $fReadErrorT $fOrdErrorT $fEqErrorT $fShow1ErrorT $fRead1ErrorT $fOrd1ErrorT $fEq1ErrorTExceptexcept runExcept mapExcept withExcept runExceptT mapExceptT withExceptT$fContravariantExceptT$fMonadZipExceptT$fMonadIOExceptT$fMonadTransExceptT$fMonadFixExceptT$fMonadPlusExceptT$fMonadFailExceptT$fMonadExceptT$fAlternativeExceptT$fApplicativeExceptT$fTraversableExceptT$fFoldableExceptT$fFunctorExceptT $fShowExceptT $fReadExceptT $fOrdExceptT $fEqExceptT$fShow1ExceptT$fRead1ExceptT $fOrd1ExceptT $fEq1ExceptT IdentityT runIdentityT mapIdentityT liftCatch$fContravariantIdentityT$fMonadTransIdentityT$fMonadZipIdentityT$fMonadIOIdentityT$fMonadFixIdentityT$fMonadPlusIdentityT$fMonadFailIdentityT$fMonadIdentityT$fAlternativeIdentityT$fApplicativeIdentityT$fTraversableIdentityT$fFoldableIdentityT$fFunctorIdentityT$fShowIdentityT$fReadIdentityT$fOrdIdentityT $fEqIdentityT$fShow1IdentityT$fRead1IdentityT$fOrd1IdentityT$fEq1IdentityTListTrunListTmapListT$fContravariantListT$fMonadZipListT$fMonadIOListT$fMonadTransListT$fMonadFixListT$fMonadPlusListT$fMonadFailListT $fMonadListT$fAlternativeListT$fApplicativeListT$fTraversableListT$fFoldableListT$fFunctorListT $fShowListT $fReadListT $fOrdListT $fEqListT $fShow1ListT $fRead1ListT $fOrd1ListT $fEq1ListTMaybeT runMaybeT mapMaybeTmaybeToExceptTexceptToMaybeT$fContravariantMaybeT$fMonadZipMaybeT$fMonadIOMaybeT$fMonadTransMaybeT$fMonadFixMaybeT$fMonadPlusMaybeT$fMonadFailMaybeT $fMonadMaybeT$fAlternativeMaybeT$fApplicativeMaybeT$fTraversableMaybeT$fFoldableMaybeT$fFunctorMaybeT $fShowMaybeT $fReadMaybeT $fOrdMaybeT $fEqMaybeT $fShow1MaybeT $fRead1MaybeT $fOrd1MaybeT $fEq1MaybeTRWSTRWSrwsrunRWSevalRWSexecRWSmapRWSwithRWSrwsTrunRWSTevalRWSTexecRWSTmapRWSTwithRWSTreaderasklocalaskswritertelllistenlistenspasscensorstategetputmodifygets liftCallCC' $fMonadIORWST$fMonadTransRWST$fMonadFixRWST$fMonadPlusRWST$fMonadFailRWST $fMonadRWST$fAlternativeRWST$fApplicativeRWST $fFunctorRWST$fContravariantRWSTReaderT runReaderTReader runReader mapReader withReader mapReaderT withReaderT$fContravariantReaderT$fMonadZipReaderT$fMonadIOReaderT$fMonadTransReaderT$fMonadFixReaderT$fMonadPlusReaderT$fMonadFailReaderT$fMonadReaderT$fAlternativeReaderT$fApplicativeReaderT$fFunctorReaderTSelectTSelectselect runSelect mapSelect runSelectT mapSelectT selectToContT selectToCont$fMonadIOSelectT$fMonadTransSelectT$fMonadPlusSelectT$fMonadFailSelectT$fMonadSelectT$fAlternativeSelectT$fApplicativeSelectT$fFunctorSelectTStateT runStateTStaterunState evalState execStatemapState withState evalStateT execStateT mapStateT withStateTmodify'$fContravariantStateT$fMonadIOStateT$fMonadTransStateT$fMonadFixStateT$fMonadPlusStateT$fMonadFailStateT $fMonadStateT$fAlternativeStateT$fApplicativeStateT$fFunctorStateTWriterTWriter runWriter execWriter mapWriterwriterT runWriterT execWriterT mapWriterT$fMonadIOWriterT$fMonadTransWriterT$fMonadFixWriterT$fMonadPlusWriterT$fMonadFailWriterT$fMonadWriterT$fAlternativeWriterT$fApplicativeWriterT$fFunctorWriterT$fContravariantWriterT$fMonadZipWriterT$fTraversableWriterT$fFoldableWriterT $fShowWriterT $fReadWriterT $fOrdWriterT $fEqWriterT$fShow1WriterT$fRead1WriterT $fOrd1WriterT $fEq1WriterTAccumTAccumaccumrunAccum execAccum evalAccummapAccum runAccumT execAccumT evalAccumT mapAccumTlooklooksaddreaderToAccumTwriterToAccumT accumToStateT$fMonadIOAccumT$fMonadTransAccumT$fMonadFixAccumT$fMonadPlusAccumT$fMonadFailAccumT $fMonadAccumT$fAlternativeAccumT$fApplicativeAccumT$fFunctorAccumTConstant getConstant$fContravariantConstant$fBitraversableConstant$fBifoldableConstant$fBifunctorConstant$fMonoidConstant$fApplicativeConstant$fSemigroupConstant$fTraversableConstant$fFoldableConstant$fFunctorConstant$fShow1Constant$fRead1Constant$fOrd1Constant $fEq1Constant$fShow2Constant$fRead2Constant$fOrd2Constant $fEq2Constant$fShowConstant$fReadConstant $fEqConstant $fOrdConstantLiftPureOtherunLiftmapLiftelimLift runErrorsfailureeitherToErrors$fAlternativeLift$fApplicativeLift$fTraversableLift$fFoldableLift $fFunctorLift $fShowLift $fReadLift $fOrdLift$fEqLift $fShow1Lift $fRead1Lift $fOrd1Lift $fEq1LiftReverse getReverse$fContravariantReverse$fTraversableReverse$fFoldableReverse$fMonadPlusReverse$fMonadFailReverse$fMonadReverse$fAlternativeReverse$fApplicativeReverse$fFunctorReverse $fShowReverse $fReadReverse $fOrdReverse $fEqReverse$fShow1Reverse$fRead1Reverse $fOrd1Reverse $fEq1ReversebaseGHC.Base ApplicativereturnMonadidString Data.EitherLeftlift2IdentityT GHC.MaybeMaybe Data.TupleuncurryliftMfstsnd$!mempty>>=mappendpure<*><>RightEither Data.FoldableFoldableData.Traversable Traversable