;9      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+,aThe 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) Ross Paterson 2012 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafeSignature of the pass operation, introduced in Control.Monad.Trans.Writer.Signature of the listen operation, introduced in Control.Monad.Trans.Writer.Signature of the catchE operation, introduced in Control.Monad.Trans.Except.Signature of the callCC operation, introduced in Control.Monad.Trans.Cont.a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+,Monads in which e computations may be embedded. Any monad built by applying a sequence of monad transformers to the ) monad will be an instance of this class.>Instances should satisfy the following laws, which state that  is a transformer of monads:  .  =   (m >>= f) =  m >>= ( . f)Lift a computation from the  monad."(c) The University of Glasgow 2001 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+,^The continuation monad transformer. Can be used to add continuation handling to other monads. 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) = mPApply 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 . fcallCC< (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 ).    a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+, 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.!The parameterizable reader monad.3Computations are functions of a shared environment.The ) function ignores the environment, while >>=; passes the inherited environment to both subcomputations.@Constructor for computations in the reader monad (equivalent to &).Runs a Reader8 and extracts the final value from it. (The inverse of .) "Transform the value returned by a Reader.  (  f m) = f .  m!FExecute a computation in a modified environment (a specialization of #).  (! f m) =  m . f"#Transform the computation inside a ReaderT.  (" f m) = f .  m#LExecute a computation in a modified environment (a more general version of %).  (# f m) =  m . f$#Fetch the value of the environment.%FExecute a computation in a modified environment (a specialization of #).  (% f m) =  m . f&/Retrieve a function of the current environment. & f =  f $'Lift a callCC operation to the new monad.(Lift a catchE operation to the new monad.A Reader to run.An initial environment. !'The function to modify the environment./Computation to run in the modified environment."#'The function to modify the environment./Computation to run in the modified environment. $%'The function to modify the environment./Computation to run in the modified environment.&2The selector function to apply to the environment.'(!"#$%&'( !"#$%&'( !"#$%&'( !"# $%&'(!"#$%&'(a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+,):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.0Evaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value.1XMap the return value, final state and output of a computation using the given function. . (1 f m) r s = f (. m r s)22 f m executes action m= with an initial environment and state modified by applying f. . (2 f m) r s = ) (. m) (f r s)3Evaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state.4Evaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value.53Map the inner computation using the given function. + (5 f m) r s = f (+ m r s)66 f m executes action m= with an initial environment and state modified by applying f. + (6 f m) r s = ) (+ m) (f r s)7@Constructor for computations in the reader monad (equivalent to :).8#Fetch the value of the environment.9/Execute a computation in a modified environment + (9 f m) r s = + m (f r) s:/Retrieve a function of the current environment. : f =  f 8;<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 =  (\ (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 =  (id *** f) (= m) + (> f m) r s =  (\ (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 =  (\ ((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 = ? ( (\ x -> (x,f)) m) + (@ f m) r s =  (\ (a, w) -> (a, f w)) (+ m r s)AFConstruct a state monad computation from a state transformer function.B6Fetch the current value of the state within the monad.CC s$ sets the state within the monad to s.DD f@ is an action that updates the state to the result of applying f to the current state. D f = B >>= (C . f)EMGet a specific component of the state, using a projection function supplied. E f =  f BFUniform lifting of a callCCj operation to the new monad. This version rolls back to the original state on entering the continuation.GIn-situ lifting of a callCC_ operation to the new monad. This version uses the current state on entering the continuation.HLift a catchE operation to the new monad.()*+,-./RWS computation to executeinitial environment initial valuefinal value and output0RWS computation to executeinitial environment initial valuefinal state and output123computation to executeinitial environment initial value+computation yielding final value and output4computation to executeinitial environment initial value+computation yielding final state and output56789:;<=>?@ABCDEFGH*+,-./01 )*+,-./0123456789:;<=>?@ABCDEFGH ,-./012)*+3456789:;<=>?@ABCDEFGH&)*+,-./0123456789:;<=>?@ABCDEFGH*+,-./01a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe )*+,-./0123456789:;<=>?@ABCDEFGHa(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+,I: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.L*A monad containing an environment of type r, output of type w! and an updatable state of type s.M?Construct an RWS computation from a function. (The inverse of N.)N:Unwrap an RWS computation as a function. (The inverse of M.)OEvaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state.PEvaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value.QXMap the return value, final state and output of a computation using the given function. N (Q f m) r s = f (N m r s)RR f m executes action m= with an initial environment and state modified by applying f. N (R f m) r s = ) (N m) (f r s)SEvaluate a computation with the given initial state and environment, returning the final value and output, discarding the final state.TEvaluate a computation with the given initial state and environment, returning the final state and output, discarding the final value.U3Map the inner computation using the given function. K (U f m) r s = f (K m r s)VV f m executes action m= with an initial environment and state modified by applying f. K (V f m) r s = ) (K m) (f r s)W@Constructor for computations in the reader monad (equivalent to Z).X#Fetch the value of the environment.Y/Execute a computation in a modified environment K (Y f m) r s = K m (f r) sZ/Retrieve a function of the current environment. Z f =  f X[<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. K (] m) r s =  (\ (a, w) -> ((a, w), w)) (K 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 =  (id *** f) (] m) K (^ f m) r s =  (\ (a, w) -> ((a, f w), w)) (K 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. K (_ m) r s =  (\ ((a, f), w) -> (a, f w)) (K 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 = _ ( (\ x -> (x,f)) m) K (` f m) r s =  (\ (a, w) -> (a, f w)) (K m r s)aFConstruct a state monad computation from a state transformer function.b6Fetch the current value of the state within the monad.cc s$ sets the state within the monad to s.dd f@ is an action that updates the state to the result of applying f to the current state. d f = b >>= (c . f)eMGet a specific component of the state, using a projection function supplied. e f =  f bfUniform lifting of a callCCj operation to the new monad. This version rolls back to the original state on entering the continuation.gIn-situ lifting of a callCC_ operation to the new monad. This version uses the current state on entering the continuation.hLift a catchE operation to the new monad.(IJKLMNORWS computation to executeinitial environment initial valuefinal value and outputPRWS computation to executeinitial environment initial valuefinal state and outputQRScomputation to executeinitial environment initial value+computation yielding final value and outputTcomputation to executeinitial environment initial value+computation yielding final state and outputUVWXYZ[\]^_`abcdefgh23456789 IJKLMNOPQRSTUVWXYZ[\]^_`abcdefgh LMNOPQRIJKSTUVWXYZ[\]^_`abcdefgh&IJKLMNOPQRSTUVWXYZ[\]^_`abcdefgh23456789a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+,i+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.l(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.mFConstruct a state monad computation from a function. (The inverse of n.)nAUnwrap a state monad computation as a function. (The inverse of m.)orEvaluate a state computation with the given initial state and return the final value, discarding the final state. o m s = : (n m s)prEvaluate a state computation with the given initial state and return the final state, discarding the final value. p m s = ; (n m s)qUMap both the return value and final state of a computation using the given function. n (q f m) = f . n mrr f m executes action m" on a state modified by applying f. r f m = y f >> msrEvaluate a state computation with the given initial state and return the final value, discarding the final state. s m s =  : (k m s)trEvaluate a state computation with the given initial state and return the final state, discarding the final value. t m s =  ; (k m s)uUMap both the return value and final state of a computation using the given function. k (u f m) = f . k mvv f m executes action m" on a state modified by applying f. v f m = y f >> mw6Fetch the current value of the state within the monad.xx s$ sets the state within the monad to s.yy f@ is an action that updates the state to the result of applying f to the current state. y f = w >>= (x . f)z A variant of y6 in which the computation is strict in the new state. z f = w >>= ((<) x . f){MGet a specific component of the state, using a projection function supplied. { f =  f w|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 laws of a monad transformer.~Lift a catchE operation to the new monad.Lift a listen operation to the new monad.Lift a pass operation to the new monad. ijklmpure state transformer$equivalent state-passing computationn$state-passing computation to execute initial statereturn value and final stateo$state-passing computation to execute initial value%return value of the state computationp$state-passing computation to execute initial value final stateqrstuvwxyz{|}~=>?@ABCDijklmnopqrstuvwxyz{|}~lmnopqrijkstuvwxyz{|}~ijklmnopqrstuvwxyz{|}~=>?@ABCDa(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafeijklmnopqrstuvwxyz{|}~ a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+,+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.(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.FConstruct a state monad computation from a function. (The inverse of .)AUnwrap a state monad computation as a function. (The inverse of .)rEvaluate a state computation with the given initial state and return the final value, discarding the final state.  m s = : ( m s)rEvaluate a state computation with the given initial state and return the final state, discarding the final value.  m s = ; ( m s)UMap both the return value and final state of a computation using the given function.  ( f m) = f .  m f m executes action m" on a state modified by applying f.  f m =  f >> mrEvaluate a state computation with the given initial state and return the final value, discarding the final state.  m s =  : ( m s)rEvaluate a state computation with the given initial state and return the final state, discarding the final value.  m s =  ; ( m s)UMap both the return value and final state of a computation using the given function.  ( f m) = f .  m f m executes action m" on a state modified by applying f.  f m =  f >> m6Fetch 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) A variant of 6 in which the computation is strict in the new state.  f =  >>= ((<)  . f)MGet a specific component of the state, using a projection function supplied.  f =  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. It does not satisfy the laws of a monad transformer.Lift a catchE operation to the new monad.Lift a listen operation to the new monad.Lift a pass operation to the new monad. pure state transformer$equivalent state-passing computation$state-passing computation to execute initial statereturn value and final state$state-passing computation to execute initial value%return value of the state computation$state-passing computation to execute initial value final stateEFGHIJKLEFGHIJKL (c) Ross Paterson 2013 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+, Lifting of the M" class to unary type constructors.Lifting of the N" class to unary type constructors.Lifting of the O" class to unary type constructors.Lifting of the P" class to unary type constructors. p d is a parser for datatypes where each alternative begins with a data constructor. It parses the constructor and passes it to p=. Parsers for various constructors can be constructed with ,  and , and combined with mappend from the Monoid class. n c n'R matches the name of a unary data constructor and then parses its argument using Q. n c n'R matches the name of a unary data constructor and then parses its argument using . n c n'T matches the name of a binary data constructor and then parses its arguments using . n d xK produces the string representation of a unary data constructor with name n and argument x, in precedence context d. n d xK produces the string representation of a unary data constructor with name n and argument x, in precedence context d. n d xL produces the string representation of a binary data constructor with name n and arguments x and y, in precedence context d.#RSTUVWXYZ[\]^_`abcdeRSTUVWXYZ[\]^_`abcde (c) Ross Paterson 2010 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+,Constant functor. fghijklmno fghijklmno (c) Ross Paterson 2010 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+,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. p f q p x = p (f x) p f q  e =  e  e q p x =  e  e1 q  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.4Extractor for computations with accumulating errors.  (p x) = r x  ( e) = s eReport an error.tA combination is  only either part is.uA combination is  only if both parts are.tuvwxyz{|}~tuvwxyz{|}~ (C) 2013 Ross Paterson BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+,9A 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.$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 continies after an error and collects all the errors, see  .FConstructor for computations in the exception monad. (The inverse of ).DExtractor for computations in the exception monad. (The inverse of ).7Map the unwrapped computation using the given function.  ( f m) = f ( m)bTransform any exceptions thrown by the computation using the given function (a specialization of ).The inverse of .7Map the unwrapped computation using the given function.  ( f m) = f ( m)MTransform any exceptions thrown by the computation using the given function.Signal an exception value e.  ( e) =  (s e)  e >>= m =  eHandle an exception.  h ( m) =  m  h ( e) = h eLift a callCC operation to the new monad.Lift a listen operation to the new monad.Lift a pass operation to the new monad.!the inner computation2a handler for exceptions in the inner computation (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)ross@soi.city.ac.uk experimentalportableSafe+, SThe 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.5Workaround so that we can have a Haskell 98 instance  .An exception to be thrown.Minimal complete definition:  or .GCreates an exception without a message. The default implementation is  "".DCreates an exception with a message. The default implementation of  s is .7Map the unwrapped computation using the given function.  ( f m) = f ( m)Signal an error value e.  ( e) =  (s e)  e >>= m =  eHandle an error.  h ( m) =  m  h ( e) = h eLift a callCC operation to the new monad.Lift a listen operation to the new monad.Lift a pass operation to the new monad.#A string can be thrown as an error.'the inner computation.a handler for errors in the inner computation"(c) 2007 Magnus Therning BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+,IThe trivial monad transformer, which maps a monad to an equivalent monad.(Lift a unary operation to the new monad.)Lift a binary operation to the new monad.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)ross@soi.city.ac.uk experimentalportableSafe+,0Parameterizable 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)ross@soi.city.ac.uk experimentalportableSafe+,TThe 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 >>=D sequences two subcomputations, exiting if either computation does.#Transform the computation inside a MaybeT.  ( f m) = f ( m) Convert a  computation to ", with a default exception value. Convert a  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)ross@soi.city.ac.uk experimentalportableSafe+, 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 = ; ( 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 =  ; ( 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) =  (\ (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 =  (id *** f) ( m)  ( f m) =  (\ (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) =  (\ ((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 =  ( (\ x -> (x,f)) m)  ( f m) =  (\ (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)ross@soi.city.ac.uk experimentalportableSafea(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+, 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 = ; ( 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 =  ; ( 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) =  (\ (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 =  (id *** f) ( m)  ( f m) =  (\ (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) =  (\ ((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 =  ( (\ x -> (x,f)) m)  ( f m) =  (\ (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)ross@soi.city.ac.uk experimentalportableSafe+,Right-to-left composition of functors. The composition of applicative functors is always applicative, but the composition of monads is not always a monad.                  (c) Ross Paterson 2010 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+, Lifted product of functors.   !"#$%&'()*+,-       !"#$%&'()*+,-(c) Ross Paterson 2014 BSD-style (see the file LICENSE)ross@soi.city.ac.uk experimentalportableSafe+, Lifted sum of functors. ./012345678    ./012345678(c) Russell O'Connor 2009 BSD-style (see the file LICENSE)libraries@haskell.org experimentalportableSafe+,The same functor, but with an 96 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.:;<=>?@ABCDEF:;<=>?@ABCDEF(c) Russell O'Connor 2009 BSD-style (see the file LICENSE)libraries@haskell.org experimentalportableSafe+,The same functor, but with G and H; instances that process the elements in the reverse order.ITraverse from right to left.JFold from right to left.KDerived instance.LDerived instance.MDerived instance.IJKLMNOPQRSTUIJKLMNOPQRSTUV !"#$%&'(()*+,-./01234567899:;<=>?@ABCDEFGGHIJKLMNOPQRS<BCDTUVWXYZ[\]^E_FGGHIJKLMNOPQRS<BCDTUVWXYZ[\]^E_F``abZcdefghijk[\]l^E_Fmn ` ` a b Z c d e f g h i j k [ \ ] l ^ E _ F m n o p q r s t u v w x y z { | } ~ ~           E m nEmnEFEFEFmnTUVWXYEFTUVWXYEF                                   ! " # $ % & ' ( ) * + ,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~trans_ALYlebOVzVI4kxbFX5SGhmControl.Monad.Trans.ClassControl.Monad.SignaturesControl.Monad.IO.ClassControl.Monad.Trans.ContControl.Monad.Trans.ReaderControl.Monad.Trans.RWS.LazyControl.Monad.Trans.RWS.StrictControl.Monad.Trans.State.Lazy Control.Monad.Trans.State.StrictData.Functor.ClassesData.Functor.ConstantControl.Applicative.LiftControl.Monad.Trans.ExceptControl.Monad.Trans.ErrorControl.Monad.Trans.IdentityControl.Monad.Trans.ListControl.Monad.Trans.MaybeControl.Monad.Trans.Writer.Lazy!Control.Monad.Trans.Writer.StrictData.Functor.ComposeData.Functor.ProductData.Functor.SumControl.Applicative.BackwardsData.Functor.ReversethrowEcatchEExceptTControl.Monad.Trans.RWSControl.Monad.Trans.StateErrorsControl.Monad.Trans.Writer MonadTransliftPassListenCatchCallCCMonadIOliftIOContTrunContTContcontrunContevalContmapContwithContresetshift evalContTmapContT withContTcallCCresetTshiftT liftLocalReaderT runReaderTReaderreader runReader mapReader withReader mapReaderT withReaderTasklocalasks liftCallCC liftCatchRWSTrunRWSTRWSrwsrunRWSevalRWSexecRWSmapRWSwithRWSevalRWSTexecRWSTmapRWSTwithRWSTwritertelllistenlistenspasscensorstategetputmodifygets liftCallCC'StateT runStateTStaterunState evalState execStatemapState withState evalStateT execStateT mapStateT withStateTmodify' liftListenliftPassShow1 showsPrec1Read1 readsPrec1Ord1compare1Eq1eq1 readsData readsUnary readsUnary1 readsBinary1 showsUnary showsUnary1 showsBinary1Constant getConstantLiftPureOtherunLiftmapLift runErrorsfailureExceptexcept runExcept mapExcept withExcept runExceptT mapExceptT withExceptTErrorT runErrorT ErrorListlistMsgErrornoMsgstrMsg mapErrorT throwError catchError IdentityT runIdentityT mapIdentityTListTrunListTmapListTMaybeT runMaybeT mapMaybeTmaybeToExceptTexceptToMaybeTWriterT runWriterTWriter runWriter execWriter mapWriter execWriterT mapWriterTCompose getComposeProductPairSumInLInR BackwardsforwardsReverse getReversebaseGHC.Basereturnghc-prim GHC.TypesIO $fMonadIOIOid$fMonadIOContT$fMonadTransContT $fMonadContT$fApplicativeContT$fFunctorContTliftM liftReaderT$fMonadIOReaderT$fMonadTransReaderT$fMonadFixReaderT$fMonadPlusReaderT$fMonadReaderT$fAlternativeReaderT$fApplicativeReaderT$fFunctorReaderT Data.Tupleuncurry $fMonadIORWST$fMonadTransRWST$fMonadFixRWST$fMonadPlusRWST $fMonadRWST$fAlternativeRWST$fApplicativeRWST $fFunctorRWSTfstsnd$!$fMonadIOStateT$fMonadTransStateT$fMonadFixStateT$fMonadPlusStateT $fMonadStateT$fAlternativeStateT$fApplicativeStateT$fFunctorStateTGHC.ShowShowGHC.ReadRead GHC.ClassesOrdEq readsPrec$fShow1Identity$fRead1Identity$fOrd1Identity $fEq1Identity $fShow1Either $fRead1Either $fOrd1Either $fEq1Either $fShow1(,) $fRead1(,) $fOrd1(,)$fEq1(,) $fShow1[] $fRead1[]$fOrd1[]$fEq1[] $fShow1Maybe $fRead1Maybe $fOrd1Maybe $fEq1Maybe$fApplicativeConstant$fTraversableConstant$fFoldableConstant$fFunctorConstant$fShow1Constant$fRead1Constant$fOrd1Constant $fEq1Constant$fShowConstant$fReadConstantpure<*> Data.EitherRightLeft$fAlternativeLift$fApplicativeLift$fTraversableLift$fFoldableLift $fFunctorLift $fShow1Lift $fRead1Lift $fOrd1Lift $fEq1Lift $fShowLift $fReadLift $fOrdLift$fEqLift$fMonadIOExceptT$fMonadTransExceptT$fMonadFixExceptT$fMonadPlusExceptT$fMonadExceptT$fAlternativeExceptT$fApplicativeExceptT$fTraversableExceptT$fFoldableExceptT$fFunctorExceptT$fShow1ExceptT$fRead1ExceptT $fOrd1ExceptT $fEq1ExceptT $fShowExceptT $fReadExceptT $fOrdExceptT $fEqExceptTString $fError[]$fMonadIOErrorT$fMonadTransErrorT$fMonadFixErrorT$fMonadPlusErrorT $fMonadErrorT$fAlternativeErrorT$fApplicativeErrorT$fTraversableErrorT$fFoldableErrorT$fFunctorErrorT $fShow1ErrorT $fRead1ErrorT $fOrd1ErrorT $fEq1ErrorT $fShowErrorT $fReadErrorT $fOrdErrorT $fEqErrorT$fMonadPlusEither$fAlternativeEither$fErrorListChar$fErrorIOException$fAlternativeIO $fMonadPlusIOlift2IdentityT$fMonadTransIdentityT$fMonadIOIdentityT$fMonadFixIdentityT$fMonadPlusIdentityT$fMonadIdentityT$fAlternativeIdentityT$fApplicativeIdentityT$fTraversableIdentityT$fFoldableIdentityT$fFunctorIdentityT$fShow1IdentityT$fRead1IdentityT$fOrd1IdentityT$fEq1IdentityT$fShowIdentityT$fReadIdentityT$fOrdIdentityT $fEqIdentityT$fMonadIOListT$fMonadTransListT$fMonadPlusListT $fMonadListT$fAlternativeListT$fApplicativeListT$fTraversableListT$fFoldableListT$fFunctorListT $fShow1ListT $fRead1ListT $fOrd1ListT $fEq1ListT $fShowListT $fReadListT $fOrdListT $fEqListTMaybe$fMonadIOMaybeT$fMonadTransMaybeT$fMonadFixMaybeT$fMonadPlusMaybeT $fMonadMaybeT$fAlternativeMaybeT$fApplicativeMaybeT$fTraversableMaybeT$fFoldableMaybeT$fFunctorMaybeT $fShow1MaybeT $fRead1MaybeT $fOrd1MaybeT $fEq1MaybeT $fShowMaybeT $fReadMaybeT $fOrdMaybeT $fEqMaybeTmemptymappend$fMonadIOWriterT$fMonadTransWriterT$fMonadFixWriterT$fMonadPlusWriterT$fMonadWriterT$fAlternativeWriterT$fApplicativeWriterT$fTraversableWriterT$fFoldableWriterT$fFunctorWriterT$fShow1WriterT$fRead1WriterT $fOrd1WriterT $fEq1WriterT $fShowWriterT $fReadWriterT $fOrdWriterT $fEqWriterTApplygetApply$fAlternativeCompose$fApplicativeCompose$fTraversableCompose$fFoldableCompose$fFunctorCompose$fShow1Compose$fRead1Compose $fOrd1Compose $fEq1Compose $fShowCompose $fReadCompose $fOrdCompose $fEqCompose $fShowApply $fReadApply $fOrdApply $fEqApply$fMonadFixProduct$fMonadPlusProduct$fMonadProduct$fAlternativeProduct$fApplicativeProduct$fTraversableProduct$fFoldableProduct$fFunctorProduct$fShow1Product$fRead1Product $fOrd1Product $fEq1Product $fShowProduct $fReadProduct $fOrdProduct $fEqProduct$fTraversableSum $fFoldableSum $fFunctorSum $fShow1Sum $fRead1Sum $fOrd1Sum$fEq1Sum $fShowSum $fReadSum$fOrdSum$fEqSum Applicative$fTraversableBackwards$fFoldableBackwards$fAlternativeBackwards$fApplicativeBackwards$fFunctorBackwards$fShow1Backwards$fRead1Backwards$fOrd1Backwards$fEq1Backwards$fShowBackwards$fReadBackwards$fOrdBackwards $fEqBackwards Data.FoldableFoldableData.Traversable Traversable$fTraversableReverse$fFoldableReverse$fAlternativeReverse$fApplicativeReverse$fFunctorReverse$fShow1Reverse$fRead1Reverse $fOrd1Reverse $fEq1Reverse $fShowReverse $fReadReverse $fOrdReverse $fEqReverse