!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S TUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(c) Russell O'Connor 2009 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe,12F7The 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) Ross Paterson 2012 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe,F,]Signature of the pass operation, introduced in Control.Monad.Trans.Writer. Any lifting function liftPass should satisfy lift . liftPass = liftPass . liftSignature of the listen operation, introduced in Control.Monad.Trans.Writer. Any lifting function  liftListen should satisfy lift . liftListen = liftListen . liftSignature 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)Signature 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(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe123IaThe 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,12FalThe 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) 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 experimentalportableSafe12v .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.15Workaround so that we can have a Haskell 98 instance 3 .3An exception to be thrown.Minimal complete definition: 4 or 5.4GCreates an exception without a message. The default implementation is 5 "".5DCreates an exception with a message. The default implementation of 5 s is 4.67Map the unwrapped computation using the given function. 0 (6 f m) = f (0 m)7Signal an error value e. 0 (7 e) =  ( e) 7 e >>= m = 7 e8Handle an error. 8 h ( m) =  m 8 h (7 e) = h e9Lift 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.8the inner computation.a handler for errors in the inner computation./0123456789:;34512./06789:;./012345(C) 2013 Ross Paterson BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe12+T9A 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.V$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 .WFConstructor for computations in the exception monad. (The inverse of X).XDExtractor for computations in the exception monad. (The inverse of W).Y7Map the unwrapped computation using the given function. X (Y f m) = f (X m)ZbTransform any exceptions thrown by the computation using the given function (a specialization of ]).[The inverse of T.\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) =  ( e) ^ e >>= m = ^ e_Handle an exception. _ h ( m) =  m _ h (^ e) = h e`Lift a callCC operation to the new monad.aLift a listen operation to the new monad.bLift a pass operation to the new monad._the inner computation2a handler for exceptions in the inner computationTUVWXYZ[\]^_`abVWXYZTU[\]^_`abTU(c) 2007 Magnus Therning BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe,12F{wIThe trivial monad transformer, which maps a monad to an equivalent monad.z(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.wxyz{|wxyz|{wxya(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe120Parameterizable 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 experimentalportableSafe12TThe 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 T", with a default exception value. Convert a T 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 experimentalportableSafe12: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 =  ( 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 =  ( 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 =  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 =  (\ (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)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 =  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 experimentalportableSafe12':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 =  ( 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 =  ( 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 =  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 =  (\ (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) 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 =  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,12FD* 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)R.Paterson@city.ac.uk experimentalportableSafe12rb3+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.6(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.7FConstruct a state monad computation from a function. (The inverse of 8.)8AUnwrap a state monad computation as a function. (The inverse of 7.)9rEvaluate a state computation with the given initial state and return the final value, discarding the final state. 9 m s =  (8 m s):rEvaluate a state computation with the given initial state and return the final state, discarding the final value. : m s =  (8 m s);UMap both the return value and final state of a computation using the given function. 8 (; f m) = f . 8 m<< f m executes action m" on a state modified by applying f. < f m = C f >> m=rEvaluate a state computation with the given initial state and return the final value, discarding the final state. = m s =   (5 m s)>rEvaluate a state computation with the given initial state and return the final state, discarding the final value. > m s =   (5 m s)?UMap both the return value and final state of a computation using the given function. 5 (? f m) = f . 5 m@@ f m executes action m" on a state modified by applying f. @ f m = C f >> mA6Fetch the current value of the state within the monad.BB s$ sets the state within the monad to s.CC f@ is an action that updates the state to the result of applying f to the current state. C f = A >>= (B . f)D A variant of C6 in which the computation is strict in the new state. D f = A >>= (() B . f)EMGet a specific component of the state, using a projection function supplied. E f =  f AFUniform 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. It does not satisfy the uniformity property (see Control.Monad.Signatures).HLift a catchE operation to the new monad.ILift a listen operation to the new monad.JLift a pass operation to the new monad.7pure state transformer$equivalent state-passing computation8$state-passing computation to execute initial statereturn value and final state9$state-passing computation to execute initial value%return value of the state computation:$state-passing computation to execute initial value final state3456789:;<=>?@ABCDEFGHIJ6789:;<345=>?@ABCDEFGHIJ345a(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafev3456789:;<=>?@ABCDEFGHIJa(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe12/T+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.W(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.XFConstruct a state monad computation from a function. (The inverse of Y.)YAUnwrap a state monad computation as a function. (The inverse of X.)ZrEvaluate a state computation with the given initial state and return the final value, discarding the final state. Z m s =  (Y m s)[rEvaluate a state computation with the given initial state and return the final state, discarding the final value. [ m s =  (Y m s)\UMap both the return value and final state of a computation using the given function. Y (\ f m) = f . Y m]] f m executes action m" on a state modified by applying f. ] f m = d f >> m^rEvaluate a state computation with the given initial state and return the final value, discarding the final state. ^ m s =   (V m s)_rEvaluate a state computation with the given initial state and return the final state, discarding the final value. _ m s =   (V m s)`UMap both the return value and final state of a computation using the given function. V (` f m) = f . V maa f m executes action m" on a state modified by applying f. a f m = d f >> mb6Fetch 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)e A variant of d6 in which the computation is strict in the new state. e f = b >>= (() c . f)fMGet a specific component of the state, using a projection function supplied. f f =  f bgUniform lifting of a callCCj operation to the new monad. This version rolls back to the original state on entering the continuation.hIn-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).iLift a catchE operation to the new monad.jLift a listen operation to the new monad.kLift a pass operation to the new monad.Xpure state transformer$equivalent state-passing computationY$state-passing computation to execute initial statereturn value and final stateZ$state-passing computation to execute initial value%return value of the state computation[$state-passing computation to execute initial value final stateTUVWXYZ[\]^_`abcdefghijkWXYZ[\]TUV^_`abcdefghijkTUVa(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe12u 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 .x)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 .yNConstruct a writer computation from a (result, output) pair. (The inverse of z.)zIUnwrap a writer computation as a (result, output) pair. (The inverse of y.){-Extract the output from a writer computation. { m =  (z m)|PMap both the return value and output of a computation using the given function. z (| f m) = f (z m)}-Extract the output from a writer computation. } m =   (w m)~PMap both the return value and output of a computation using the given function. w (~ f m) = f (w 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. w ( m) =  (\ (a, w) -> ((a, w), 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) w ( f m) =  (\ (a, w) -> ((a, f w), 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. w ( m) =  (\ ((a, f), w) -> (a, f w)) (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) w ( f m) =  (\ (a, w) -> (a, f w)) (w m)Lift a callCC operation to the new monad.Lift a catchE operation to the new monad.uvwxyz{|}~xyz{|uvw}~uvwa(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Ǚuvwxyz{|}~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 experimentalportableSafe12 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)R.Paterson@city.ac.uk experimentalportableSafe,12FConstant functor.(c) Ross Paterson 2010 BSD-style (see the file LICENSE)R.Paterson@city.ac.uk experimentalportableSafe12NAn 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.4Extractor for computations with accumulating errors.  ( x) =   x  ( e) =  eReport an error.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,12FThe same functor, but with   and  ; 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.  !"#$%&'()*+,-./00123456789:;<=>?@ABCDEFGGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrsQRStuvwxyz{|}~QQ   Q R S    Q    Q    Q                      Q R S              QRS !"#$Q%&'()*+,-./012345678 !"#$Q%&'()*+,-./01234567899:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`aabcdefghijklmnopqrpqspqtpqupqvpwxypqzp{|pq}p{~p{pqpqpqpqpqpwpp+transformers-0.5.2.0-JvZxppyVi9V6cRRKvBfKDcControl.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.LazyControl.Monad.Trans.RWS.StrictControl.Monad.Trans.ReaderControl.Monad.Trans.State.Lazy Control.Monad.Trans.State.StrictControl.Monad.Trans.Writer.Lazy!Control.Monad.Trans.Writer.StrictData.Functor.ConstantControl.Applicative.LiftData.Functor.ReversethrowEcatchEExceptTErrorsControl.Monad.Trans.RWSControl.Monad.Trans.StateControl.Monad.Trans.Writer Backwardsforwards$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[]$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$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 $fEq1WriterTConstant getConstant$fBifunctorConstant$fMonoidConstant$fApplicativeConstant$fTraversableConstant$fFoldableConstant$fFunctorConstant$fShow1Constant$fRead1Constant$fOrd1Constant $fEq1Constant$fShow2Constant$fRead2Constant$fOrd2Constant $fEq2Constant$fShowConstant$fReadConstant $fEqConstant $fOrdConstantLiftPureOtherunLiftmapLift runErrorsfailure$fAlternativeLift$fApplicativeLift$fTraversableLift$fFoldableLift $fFunctorLift $fShowLift $fReadLift $fOrdLift$fEqLift $fShow1Lift $fRead1Lift $fOrd1Lift $fEq1LiftReverse getReverse$fTraversableReverse$fFoldableReverse$fAlternativeReverse$fApplicativeReverse$fFunctorReverse $fShowReverse $fReadReverse $fOrdReverse $fEqReverse$fShow1Reverse$fRead1Reverse $fOrd1Reverse $fEq1ReversebaseGHC.Base ApplicativereturnMonadidString Data.EitherLeftlift2IdentityTMaybe Data.TupleuncurryliftMfstsnd$!memptymappendpure<*>Right Data.FoldableFoldableData.Traversable Traversable