cNE-      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F GHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,(c) Ross Paterson 2010 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe+01DConstant functor.  a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe01aThe class of monad transformers. Instances should satisfy the following laws, which state that  is a monad transformation:  . - = -  (m >>= f) =  m >>= ( . f)DLift 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+01DlThe 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.Continuation monad. Cont r aC is a CPS computation that produces an intermediate result of type a5 within a CPS computation whose final result type is r.The returnB function simply creates a continuation which passes the value on.The >>=> operator adds the bound function into the continuation chain.OConstruct a continuation-passing computation from a function. (The inverse of )ZThe result of running a CPS computation with a given final continuation. (The inverse of )UThe result of running a CPS computation with the identity as the final continuation.  (- x) = xPApply a function to transform the result of a continuation-passing computation.  ( f m) = f .  mLApply a function to transform the continuation passed to a CPS computation.  ( f m) =  m . f   m" delimits the continuation of any ! inside m.   (- m) = - m!! f8 captures the continuation up to the nearest enclosing   and passes it to f:   (! f >>= k) =   (f ( . k))"-The result of running a CPS computation with - as the final continuation. " ( m) = m#{Apply 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$LApply a function to transform the continuation passed to a CPS computation.  ($ f m) =  m . f%callCC< (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.&& m" delimits the continuation of any ' inside m. & ( m) =  m'' f8 captures the continuation up to the nearest enclosing & and passes it to f: & (' f >>= k) = & (f (" . k))(( ask local yields a local function for  r m.continuation computation (Cont).@the final continuation, which produces the final result (often /). !"#$%&'()*+,-. !"#$%&'( !"#$%&'( !"#$%&'()*+,-.(c) Ross Paterson 2017 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe+01D/Selection monad transformer./^ is not a functor on the category of monads, and many operations cannot be lifted through it.1Selection monad.24Constructor for computations in the selection monad.3Runs a Selecte computation with a function for evaluating answers to select a particular answer. (The inverse of 2.)4Runs a SelectTe computation with a function for evaluating answers to select a particular answer. (The inverse of 2.)5FConvert a selection computation to a continuation-passing computation./0123456789:;<=/012345123/045/0123456789:;<=(c) Ross Paterson 2012 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe+D>Signature of the pass operation, introduced in Control.Monad.Trans.Writer. Any lifting function liftPass should satisfy lift . liftPass = liftPass . lift?Signature of the listen operation, introduced in Control.Monad.Trans.Writer. Any lifting function  liftListen should satisfy lift . liftListen = liftListen . lift@Signature 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)ASignature 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'>?@A>?@AA@?>>?@A(c) Michael Weber <michael.weber@post.rwth-aachen.de> 2001, (c) Jeff Newbern 2003-2006, (c) Andriy Palamarchuk 2006 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe01 BSThe 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.E5Workaround so that we can have a Haskell 98 instance G 0.GAn exception to be thrown.Minimal complete definition: H or I.HGCreates an exception without a message. The default implementation is I "".IDCreates an exception with a message. The default implementation of I s is H.J7Map the unwrapped computation using the given function. D (J f m) = f (D m)KSignal an error value e. D (K e) = - (1 e) K e >>= m = K eLHandle an error. L h ( m) =  m L h (K e) = h eMLift a callCC operation to the new monad.NLift a listen operation to the new monad.OLift a pass operation to the new monad.d#A string can be thrown as an error.&BCDEFGHIJKLthe inner computation.a handler for errors in the inner computationMNOPQRSTUVWXYZ[\]^_`abcdefgBCDEFGHIJKLMNOGHIEFBCDJKLMNO!BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg(C) 2013 Ross Paterson BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe01h9A 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 -E function yields a computation that produces the given value, while >>=@ sequences two subcomputations, exiting on the first exception.j$The parameterizable exception monad.4Computations are either exceptions or normal values.The -( function returns a normal value, while >>=o exits on the first exception. For a variant that continues after an error and collects all the errors, see .kFConstructor for computations in the exception monad. (The inverse of l).lDExtractor for computations in the exception monad. (The inverse of k).m7Map the unwrapped computation using the given function. l (m f m) = f (l m)nbTransform any exceptions thrown by the computation using the given function (a specialization of q).oThe inverse of h.p7Map the unwrapped computation using the given function. o (p f m) = f (o m)qMTransform any exceptions thrown by the computation using the given function.rSignal an exception value e. o (r e) = - (1 e) r e >>= m = r esHandle an exception. s h ( m) =  m s h (r e) = h etLift a callCC operation to the new monad.uLift a listen operation to the new monad.vLift a pass operation to the new monad.#hijklmnopqrsthe inner computation2a handler for exceptions in the inner computationtuvwxyz{|}~hijklmnopqrstuvjklmnhiopqrstuv"hijklmnopqrstuvwxyz{|}~(c) 2007 Magnus Therning BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe+01DIThe trivial monad transformer, which maps a monad to an equivalent monad.(Lift a unary operation to the new monad.2)Lift a binary operation to the new monad.Lift a callCC operation to the new monad.Lift a catchE operation to the new monad.22 a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe010Parameterizable list monad, with an inner monad.Note:F this does not yield a monad unless the argument monad is commutative. Map between  computations.  ( f m) = f ( m)Lift a callCC operation to the new monad.Lift a catchE operation to the new monad. (c) 2007 Yitzak Gale, Eric Kidd BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe01TThe parameterizable maybe monad, obtained by composing an arbitrary monad with the 3 monad.:Computations are actions that may produce a value or exit.The -@ function yields a computation that produces that value, while >>=D sequences two subcomputations, exiting if either computation does.#Transform the computation inside a MaybeT.  ( f m) = f ( m) Convert a  computation to h", with a default exception value. Convert a h computation to ), discarding the value of any exception.Lift a callCC operation to the new monad.Lift a catchE operation to the new monad.Lift a listen operation to the new monad.Lift a pass operation to the new monad.  a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe01: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.*A monad containing an environment of type r, output of type w! and an updatable state of type s.?Construct an RWS computation from a function. (The inverse of .):Unwrap an RWS computation as a function. (The inverse of .)Evaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state.Evaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value.XMap the return value, final state and output of a computation using the given function.  ( f m) r s = f ( m r s) f m executes action m= with an initial environment and state modified by applying f.  ( f m) r s = 4 ( m) (f r s)Evaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state.Evaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value.3Map the inner computation using the given function.  ( f m) r s = f ( m r s) f m executes action m= with an initial environment and state modified by applying f.  ( f m) r s = 4 ( m) (f r s)@Constructor for computations in the reader monad (equivalent to ).#Fetch the value of the environment./Execute a computation in a modified environment  ( f m) r s =  m (f r) s/Retrieve a function of the current environment.  f = 5 f <Construct a writer computation from a (result, output) pair. w' is an action that produces the output w. m' is an action that executes the action m6 and adds its output to the value of the computation.  ( m) r s = 5 (\ (a, w) -> ((a, w), w)) ( m r s) 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 = 5 (id *** f) ( m)  ( f m) r s = 5 (\ (a, w) -> ((a, f w), w)) ( m r s) m' is an action that executes the action me, which returns a value and a function, and returns the value, applying the function to the output.  ( m) r s = 5 (\ ((a, f), w) -> (a, f w)) ( m r s) 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 =  (5 (\ x -> (x,f)) m)  ( f m) r s = 5 (\ (a, w) -> (a, f w)) ( m r s)FConstruct a state monad computation from a state transformer function.6Fetch the current value of the state within the monad. s$ sets the state within the monad to s. f@ is an action that updates the state to the result of applying f to the current state.  f =  >>= ( . f)MGet a specific component of the state, using a projection function supplied.  f = 5 f Uniform lifting of a callCCj operation to the new monad. This version rolls back to the original state on entering the continuation.In-situ lifting of a callCC_ operation to the new monad. This version uses the current state on entering the continuation.Lift a catchE operation to the new monad.)RWS computation to executeinitial environment initial valuefinal value and outputRWS computation to executeinitial environment initial valuefinal state and outputcomputation to executeinitial environment initial value+computation yielding final value and outputcomputation to executeinitial environment initial value+computation yielding final state and output 'a(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 a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe01: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.*A monad containing an environment of type r, output of type w! and an updatable state of type s. ?Construct an RWS computation from a function. (The inverse of  .) :Unwrap an RWS computation as a function. (The inverse of  .) Evaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state. Evaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value. XMap the return value, final state and output of a computation using the given function.   (  f m) r s = f (  m r s) f m executes action m= with an initial environment and state modified by applying f.   ( f m) r s = 4 (  m) (f r s)Evaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state.Evaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value.3Map the inner computation using the given function.  ( f m) r s = f ( m r s) f m executes action m= with an initial environment and state modified by applying f.  ( f m) r s = 4 ( m) (f r s)@Constructor for computations in the reader monad (equivalent to ).#Fetch the value of the environment./Execute a computation in a modified environment  ( f m) r s =  m (f r) s/Retrieve a function of the current environment.  f = 5 f <Construct a writer computation from a (result, output) pair. w' is an action that produces the output w. m' is an action that executes the action m6 and adds its output to the value of the computation.  ( m) r s = 5 (\ (a, w) -> ((a, w), w)) ( m r s) 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 = 5 (id *** f) ( m)  ( f m) r s = 5 (\ (a, w) -> ((a, f w), w)) ( m r s) m' is an action that executes the action me, which returns a value and a function, and returns the value, applying the function to the output.  ( m) r s = 5 (\ ((a, f), w) -> (a, f w)) ( m r s) 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 =  (5 (\ x -> (x,f)) m)  ( f m) r s = 5 (\ (a, w) -> (a, f w)) ( m r s)FConstruct a state monad computation from a state transformer function.6Fetch the current value of the state within the monad. s$ sets the state within the monad to s.   f@ is an action that updates the state to the result of applying f to the current state.   f =  >>= ( . f)!MGet a specific component of the state, using a projection function supplied. ! f = 5 f "Uniform lifting of a callCCj operation to the new monad. This version rolls back to the original state on entering the continuation.#In-situ lifting of a callCC_ operation to the new monad. This version uses the current state on entering the continuation.$Lift a catchE operation to the new monad.)   RWS computation to executeinitial environment initial valuefinal value and output RWS computation to executeinitial environment initial valuefinal state and output computation to executeinitial environment initial value+computation yielding final value and outputcomputation to executeinitial environment initial value+computation yielding final state and output !"#$%&'()*+,-       !"#$       !"#$'      !"#$%&'()*+,- a(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+01D .UThe 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.1!The parameterizable reader monad.3Computations are functions of a shared environment.The -) function ignores the environment, while >>=; passes the inherited environment to both subcomputations.2@Constructor for computations in the reader monad (equivalent to :).3Runs a Reader8 and extracts the final value from it. (The inverse of 2.)4"Transform the value returned by a Reader. 3 (4 f m) = f . 3 m5FExecute a computation in a modified environment (a specialization of 7). 3 (5 f m) = 3 m . f6#Transform the computation inside a ReaderT. 0 (6 f m) = f . 0 m7LExecute a computation in a modified environment (a more general version of 9). 0 (7 f m) = 0 m . f8#Fetch the value of the environment.9FExecute a computation in a modified environment (a specialization of 7). 0 (9 f m) = 0 m . f:/Retrieve a function of the current environment. : f = 5 f 8;Lift a callCC operation to the new monad.<Lift a catchE operation to the new monad../0123A Reader to run.An initial environment.45'The function to modify the environment./Computation to run in the modified environment.67'The function to modify the environment./Computation to run in the modified environment.689'The function to modify the environment./Computation to run in the modified environment.:2The selector function to apply to the environment.;<=>?@ABCDEF./0123456789:;<12345./06789:;<./01234567689:;<=>?@ABCDEFa(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe01G+A state transformer monad parameterized by:s - The state.m - The inner monad.The -, function leaves the state unchanged, while >>=T uses the final state of the first computation as the initial state of the second.J(A state monad parameterized by the type s of the state to carry.The -, function leaves the state unchanged, while >>=T uses the final state of the first computation as the initial state of the second.KFConstruct a state monad computation from a function. (The inverse of L.)LAUnwrap a state monad computation as a function. (The inverse of K.)MrEvaluate a state computation with the given initial state and return the final value, discarding the final state. M m s = 7 (L m s)NrEvaluate a state computation with the given initial state and return the final state, discarding the final value. N m s = 8 (L m s)OUMap both the return value and final state of a computation using the given function. L (O f m) = f . L mPP f m executes action m" on a state modified by applying f. P f m = W f >> mQrEvaluate a state computation with the given initial state and return the final value, discarding the final state. Q m s = 5 7 (I m s)RrEvaluate a state computation with the given initial state and return the final state, discarding the final value. R m s = 5 8 (I m s)SUMap both the return value and final state of a computation using the given function. I (S f m) = f . I mTT f m executes action m" on a state modified by applying f. T f m = W f >> mU6Fetch the current value of the state within the monad.VV s$ sets the state within the monad to s.WW f@ is an action that updates the state to the result of applying f to the current state. W f = U >>= (V . f)X A variant of W6 in which the computation is strict in the new state. X f = U >>= ((9) V . f)YMGet a specific component of the state, using a projection function supplied. Y f = 5 f UZUniform lifting of a callCCj operation to the new monad. This version rolls back to the original state on entering the continuation.[In-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).\Lift a catchE operation to the new monad.]Lift a listen operation to the new monad.^Lift a pass operation to the new monad.!GHIJKpure state transformer$equivalent state-passing computationL$state-passing computation to execute initial statereturn value and final stateM$state-passing computation to execute initial value%return value of the state computationN$state-passing computation to execute initial value final stateOPQRSTUVWXYZ[\]^_`abcdefgGHIJKLMNOPQRSTUVWXYZ[\]^JKLMNOPGHIQRSTUVWXYZ[\]^GHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefga(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafeGHIJKLMNOPQRSTUVWXYZ[\]^a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe01h+A state transformer monad parameterized by:s - The state.m - The inner monad.The -, function leaves the state unchanged, while >>=T uses the final state of the first computation as the initial state of the second.k(A state monad parameterized by the type s of the state to carry.The -, function leaves the state unchanged, while >>=T uses the final state of the first computation as the initial state of the second.lFConstruct a state monad computation from a function. (The inverse of m.)mAUnwrap a state monad computation as a function. (The inverse of l.)nrEvaluate a state computation with the given initial state and return the final value, discarding the final state. n m s = 7 (m m s)orEvaluate a state computation with the given initial state and return the final state, discarding the final value. o m s = 8 (m m s)pUMap both the return value and final state of a computation using the given function. m (p f m) = f . m mqq f m executes action m" on a state modified by applying f. q f m = x f >> mrrEvaluate a state computation with the given initial state and return the final value, discarding the final state. r m s = 5 7 (j m s)srEvaluate a state computation with the given initial state and return the final state, discarding the final value. s m s = 5 8 (j m s)tUMap both the return value and final state of a computation using the given function. j (t f m) = f . j muu f m executes action m" on a state modified by applying f. u f m = x f >> mv6Fetch the current value of the state within the monad.ww s$ sets the state within the monad to s.xx f@ is an action that updates the state to the result of applying f to the current state. x f = v >>= (w . f)y A variant of x6 in which the computation is strict in the new state. y f = v >>= ((9) w . f)zMGet a specific component of the state, using a projection function supplied. z f = 5 f v{Uniform lifting of a callCCj operation to the new monad. This version rolls back to the original state on entering the continuation.|In-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).}Lift a catchE operation to the new monad.~Lift a listen operation to the new monad.Lift a pass operation to the new monad.!hijklpure state transformer$equivalent state-passing computationm$state-passing computation to execute initial statereturn value and final staten$state-passing computation to execute initial value%return value of the state computationo$state-passing computation to execute initial value final statepqrstuvwxyz{|}~hijklmnopqrstuvwxyz{|}~klmnopqhijrstuvwxyz{|}~hijklmnopqrstuvwxyz{|}~a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe01 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 ;.)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 ;.NConstruct a writer computation from a (result, output) pair. (The inverse of .)IUnwrap a writer computation as a (result, output) pair. (The inverse of .)-Extract the output from a writer computation.  m = 8 ( m)PMap both the return value and output of a computation using the given function.  ( f m) = f ( m)-Extract the output from a writer computation.  m = 5 8 ( m)PMap both the return value and output of a computation using the given function.  ( f m) = f ( m) w' is an action that produces the output w. m' is an action that executes the action m6 and adds its output to the value of the computation.  ( m) = 5 (\ (a, w) -> ((a, w), w)) ( m) 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 = 5 (id *** f) ( m)  ( f m) = 5 (\ (a, w) -> ((a, f w), w)) ( m) m' is an action that executes the action me, which returns a value and a function, and returns the value, applying the function to the output.  ( m) = 5 (\ ((a, f), w) -> (a, f w)) ( m) 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 =  (5 (\ x -> (x,f)) m)  ( f m) = 5 (\ (a, w) -> (a, f w)) ( m)Lift a callCC operation to the new monad.Lift a catchE operation to the new monad.%#a(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) Nickolay Kudasov 2016 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe01'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 ;.fThis monad transformer is similar to both state and writer monad transformers. Thus it can be seen as@a restricted append-only version of a state monad transformer orNa writer monad transformer with the extra ability to read all previous output.0An 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 ;.UConstruct an accumulation computation from a (result, output) pair. (The inverse of .)PUnwrap an accumulation computation as a (result, output) pair. (The inverse of .)4Extract the output from an accumulation computation.  m w = 8 ( m w)Evaluate an accumulation computation with the given initial output history and return the final value, discarding the final output.  m w = 7 ( m w)PMap both the return value and output of a computation using the given function.  ( f m) = f .  m#Unwrap an accumulation computation.4Extract the output from an accumulation computation.  m w = 5 8 ( m w)Evaluate an accumulation computation with the given initial output history and return the final value, discarding the final output.  m w = 5 7 ( m w)PMap both the return value and output of a computation using the given function.  ( f m) = f .  mA is an action that fetches all the previously accumulated output.M is an action that retrieves a function of the previously accumulated output. w' is an action that produces the output w.Uniform lifting of a callCCs operation to the new monad. This version rolls back to the original output history on entering the continuation.In-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).Lift a catchE operation to the new monad.Lift a listen operation to the new monad.Lift a pass operation to the new monad.AConvert a read-only computation into an accumulation computation.>Convert a writer computation into an accumulation computation.UConvert an accumulation (append-only) computation into a fully stateful computation. a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe01 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 ;.)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 ;.NConstruct a writer computation from a (result, output) pair. (The inverse of .)IUnwrap a writer computation as a (result, output) pair. (The inverse of .)-Extract the output from a writer computation.  m = 8 ( m)PMap both the return value and output of a computation using the given function.  ( f m) = f ( m)-Extract the output from a writer computation.  m = 5 8 ( m)PMap both the return value and output of a computation using the given function.  ( f m) = f ( m) w' is an action that produces the output w. m' is an action that executes the action m6 and adds its output to the value of the computation.  ( m) = 5 (\ (a, w) -> ((a, w), w)) ( m) 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 = 5 (id *** f) ( m)  ( f m) = 5 (\ (a, w) -> ((a, f w), w)) ( m) m' is an action that executes the action me, which returns a value and a function, and returns the value, applying the function to the output.  ( m) = 5 (\ ((a, f), w) -> (a, f w)) ( m) 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 =  (5 (\ x -> (x,f)) m)  ( f m) = 5 (\ (a, w) -> (a, f w)) ( m)Lift a callCC operation to the new monad.Lift a catchE operation to the new monad.%#(c) Ross Paterson 2010 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe01 An 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.ExceptI, these computations continue after an error, collecting all the errors. < f = < x = < (f x) < f =  e =  e  e = < x =  e  e1 =  e2 =  (e1 <> e2)WApplicative functor formed by adding pure computations to a given applicative functor. Projection to the other functor.0Apply a transformation to the other computation.Eliminator for .  f g . < = f  f g .  = g4Extractor for computations with accumulating errors.  (< x) = > x  ( e) = 1 eReport an error. Convert from ? to  (inverse of ).A combination is  only either part is.A combination is  only if both parts are.   (c) Russell O'Connor 2009 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe+01D The same functor, but with an @6 instance that performs actions in the reverse order. Derived instance.Derived instance.&Try alternatives in the same order as f.Apply f-actions in the reverse order.Derived instance.              (c) Russell O'Connor 2009 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe+01DThe same functor, but with A and B; instances that process the elements in the reverse order.Traverse from right to left.Fold from right to left.Derived instance.!Derived instance."Derived instance.#Derived instance.$Derived instance. !"#$%&'()*+, !"#$%&'()*+,C !"#$%&'()*+,-./01233456789:;<=>?@ABCDEFGHIJJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~fghf   f   f g h    f              f                    f           !"#$%&'(fgh)*+,-./01 !"#$%&'(fgh)*+,-./01223456789f:;<=>?@ABCDEFGHIJKLMNNOPQRSTUVWXYZ[fgh\]^_`abcdefg223456789f:;<=>?@ABCDEFGHIJKLMhijklmnopqrstuvwxyz{|}~~ +transformers-0.5.4.0-FXB2VDREkzC4JQXCVNKGOjData.Functor.ConstantControl.Monad.Trans.ClassControl.Monad.Trans.ContControl.Monad.Trans.SelectControl.Monad.SignaturesControl.Monad.Trans.ErrorControl.Monad.Trans.ExceptControl.Monad.Trans.IdentityControl.Monad.Trans.ListControl.Monad.Trans.MaybeControl.Monad.Trans.RWS.LazyControl.Monad.Trans.RWS.StrictControl.Monad.Trans.ReaderControl.Monad.Trans.State.Lazy Control.Monad.Trans.State.StrictControl.Monad.Trans.Writer.LazyControl.Monad.Trans.Accum!Control.Monad.Trans.Writer.StrictControl.Applicative.LiftControl.Applicative.BackwardsData.Functor.ReversethrowEcatchEExceptTErrorsControl.Monad.Trans.RWSControl.Monad.Trans.StateControl.Monad.Trans.WriterConstant getConstant$fBifunctorConstant$fMonoidConstant$fApplicativeConstant$fTraversableConstant$fFoldableConstant$fFunctorConstant$fShow1Constant$fRead1Constant$fOrd1Constant $fEq1Constant$fShow2Constant$fRead2Constant$fOrd2Constant $fEq2Constant$fShowConstant$fReadConstant $fEqConstant $fOrdConstant MonadTransliftContTrunContTContcontrunContevalContmapContwithContresetshift evalContTmapContT withContTcallCCresetTshiftT liftLocal$fMonadIOContT$fMonadTransContT$fMonadFailContT $fMonadContT$fApplicativeContT$fFunctorContTSelectTSelectselect runSelect runSelectT selectToCont$fMonadIOSelectT$fMonadTransSelectT$fMonadPlusSelectT$fMonadFailSelectT$fMonadSelectT$fAlternativeSelectT$fApplicativeSelectT$fFunctorSelectTPassListenCatchCallCCErrorT runErrorT ErrorListlistMsgErrornoMsgstrMsg mapErrorT throwError catchError liftCallCC liftListenliftPass$fMonadIOErrorT$fMonadTransErrorT$fMonadFixErrorT$fMonadPlusErrorT$fMonadFailErrorT $fMonadErrorT$fAlternativeErrorT$fApplicativeErrorT$fTraversableErrorT$fFoldableErrorT$fFunctorErrorT $fShowErrorT $fReadErrorT $fOrdErrorT $fEqErrorT $fShow1ErrorT $fRead1ErrorT $fOrd1ErrorT $fEq1ErrorT$fErrorListChar $fError[]$fErrorIOException$fMonadPlusEither$fAlternativeEitherExceptexcept runExcept mapExcept withExcept runExceptT mapExceptT withExceptT$fMonadZipExceptT$fMonadIOExceptT$fMonadTransExceptT$fMonadFixExceptT$fMonadPlusExceptT$fMonadFailExceptT$fMonadExceptT$fAlternativeExceptT$fApplicativeExceptT$fTraversableExceptT$fFoldableExceptT$fFunctorExceptT $fShowExceptT $fReadExceptT $fOrdExceptT $fEqExceptT$fShow1ExceptT$fRead1ExceptT $fOrd1ExceptT $fEq1ExceptT IdentityT runIdentityT mapIdentityT liftCatch$fMonadTransIdentityT$fMonadZipIdentityT$fMonadIOIdentityT$fMonadFixIdentityT$fMonadPlusIdentityT$fMonadFailIdentityT$fMonadIdentityT$fAlternativeIdentityT$fApplicativeIdentityT$fTraversableIdentityT$fFoldableIdentityT$fFunctorIdentityT$fShowIdentityT$fReadIdentityT$fOrdIdentityT $fEqIdentityT$fShow1IdentityT$fRead1IdentityT$fOrd1IdentityT$fEq1IdentityTListTrunListTmapListT$fMonadZipListT$fMonadIOListT$fMonadTransListT$fMonadPlusListT$fMonadFailListT $fMonadListT$fAlternativeListT$fApplicativeListT$fTraversableListT$fFoldableListT$fFunctorListT $fShowListT $fReadListT $fOrdListT $fEqListT $fShow1ListT $fRead1ListT $fOrd1ListT $fEq1ListTMaybeT runMaybeT mapMaybeTmaybeToExceptTexceptToMaybeT$fMonadZipMaybeT$fMonadIOMaybeT$fMonadTransMaybeT$fMonadFixMaybeT$fMonadPlusMaybeT$fMonadFailMaybeT $fMonadMaybeT$fAlternativeMaybeT$fApplicativeMaybeT$fTraversableMaybeT$fFoldableMaybeT$fFunctorMaybeT $fShowMaybeT $fReadMaybeT $fOrdMaybeT $fEqMaybeT $fShow1MaybeT $fRead1MaybeT $fOrd1MaybeT $fEq1MaybeTRWSTrunRWSTRWSrwsrunRWSevalRWSexecRWSmapRWSwithRWSevalRWSTexecRWSTmapRWSTwithRWSTreaderasklocalaskswritertelllistenlistenspasscensorstategetputmodifygets liftCallCC' $fMonadIORWST$fMonadTransRWST$fMonadFixRWST$fMonadPlusRWST$fMonadFailRWST $fMonadRWST$fAlternativeRWST$fApplicativeRWST $fFunctorRWSTReaderT runReaderTReader runReader mapReader withReader mapReaderT withReaderT$fMonadZipReaderT$fMonadIOReaderT$fMonadTransReaderT$fMonadFixReaderT$fMonadPlusReaderT$fMonadFailReaderT$fMonadReaderT$fAlternativeReaderT$fApplicativeReaderT$fFunctorReaderTStateT runStateTStaterunState evalState execStatemapState withState evalStateT execStateT mapStateT withStateTmodify'$fMonadIOStateT$fMonadTransStateT$fMonadFixStateT$fMonadPlusStateT$fMonadFailStateT $fMonadStateT$fAlternativeStateT$fApplicativeStateT$fFunctorStateTWriterT runWriterTWriter runWriter execWriter mapWriter execWriterT mapWriterT$fMonadZipWriterT$fMonadIOWriterT$fMonadTransWriterT$fMonadFixWriterT$fMonadPlusWriterT$fMonadFailWriterT$fMonadWriterT$fAlternativeWriterT$fApplicativeWriterT$fTraversableWriterT$fFoldableWriterT$fFunctorWriterT $fShowWriterT $fReadWriterT $fOrdWriterT $fEqWriterT$fShow1WriterT$fRead1WriterT $fOrd1WriterT $fEq1WriterTAccumTAccumaccumrunAccum execAccum evalAccummapAccum runAccumT execAccumT evalAccumT mapAccumTlooklooksaddreaderToAccumTwriterToAccumT accumToStateT$fMonadIOAccumT$fMonadTransAccumT$fMonadFixAccumT$fMonadPlusAccumT$fMonadFailAccumT $fMonadAccumT$fAlternativeAccumT$fApplicativeAccumT$fFunctorAccumTLiftPureOtherunLiftmapLiftelimLift runErrorsfailureeitherToErrors$fAlternativeLift$fApplicativeLift$fTraversableLift$fFoldableLift $fFunctorLift $fShowLift $fReadLift $fOrdLift$fEqLift $fShow1Lift $fRead1Lift $fOrd1Lift $fEq1Lift Backwardsforwards$fTraversableBackwards$fFoldableBackwards$fAlternativeBackwards$fApplicativeBackwards$fFunctorBackwards$fShowBackwards$fReadBackwards$fOrdBackwards $fEqBackwards$fShow1Backwards$fRead1Backwards$fOrd1Backwards$fEq1BackwardsReverse getReverse$fTraversableReverse$fFoldableReverse$fMonadPlusReverse$fMonadFailReverse$fMonadReverse$fAlternativeReverse$fApplicativeReverse$fFunctorReverse $fShowReverse $fReadReverse $fOrdReverse $fEqReverse$fShow1Reverse$fRead1Reverse $fOrd1Reverse $fEq1ReversebaseGHC.BasereturnMonadidString Data.EitherLeftlift2IdentityTMaybe Data.TupleuncurryliftM liftReaderTfstsnd$!memptymappendpure<*>RightEither Applicative Data.FoldableFoldableData.Traversable Traversable