e9S      !"#$%&'() * + , - . / 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 T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h ijklmnopqrstuvwxyz{|}~portable experimentalross@soi.city.ac.uk Safe-InferredLifted product of functors. portable experimentalross@soi.city.ac.uk Safe-InferredConstant functor. portable experimentalross@soi.city.ac.uk Safe-Inferred'Right-to-left composition of functors. @ The composition of applicative functors is always applicative, 6 but the composition of monads is not always a monad. portable experimentalross@soi.city.ac.uk Safe-InferredIdentity functor and monad.     portable experimentalross@soi.city.ac.uk Safe-Inferred ?The class of monad transformers. Instances should satisfy the " following laws, which state that   is a transformer of monads:    .  =    (m >>= f) =   m >>= (  . f) ELift a computation from the argument monad to the constructed monad.      portable experimentalross@soi.city.ac.uk Safe-Inferred Monads in which  computations may be embedded. E 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.     portable experimentalross@soi.city.ac.uk Safe-Inferred$The continuation monad transformer. :Can be used to add continuation handling to other monads. Continuation monad. Cont r a; is a CPS computation that produces an intermediate result of type a5 within a CPS computation whose final result type is r. The returnC function simply creates a continuation which passes the value on. The >>=? operator adds the bound function into the continuation chain. >Construct a continuation-passing computation from a function.  (The inverse of .) DRuns a CPS computation, returns its result after applying the final  continuation to it.  (The inverse of .) callCC5 (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   monad. The advantage of this  function over calling # is that it makes the continuation 9 explicit, allowing more flexibility and better control. The standard idiom used with callCC# is to provide a lambda-expression H to name the continuation. Then calling the named continuation anywhere G within its scope will escape from the computation, even if it is many ) layers deep within nested computations.  ask local yields a local function for  r m. continuation computation (Cont). 'the final continuation, which produces  the final result (often ).   portable experimentalross@soi.city.ac.uk Safe-Inferred BThe error monad transformer. It can be used to add error handling  to other monads. The ErrorT3 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 ". !(Creates an exception without a message.  The default implementation is " "". "%Creates an exception with a message.  The default implementation of " s is !. #8Map the unwrapped computation using the given function.   (# f m) = f ( m) $Signal an error value e.   ( throwErrorT e) =  ( e)%Handle an error. &Lift 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 &'( !"#$%&'( !"#$%&'( !"#$%&'( portable experimentalross@soi.city.ac.uk Safe-Inferred)JThe 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  catchError operation to the new monad. )*+,-.  )*+,-.)*+,.- )*+,-.  portable experimentalross@soi.city.ac.uk Safe-Inferred/1Parameterizable list monad, with an inner monad. Note:G this does not yield a monad unless the argument monad is commutative. 2 Map between / computations.  1 (2 f m) = f (1 m) 3Lift a callCC operation to the new monad. 4Lift a  catchError operation to the new monad. /01234   /01234/01234 /01234    portable experimentalross@soi.city.ac.uk Safe-Inferred5DThe parameterizable maybe monad, obtained by composing an arbitrary  monad with the  monad. ;Computations are actions that may produce a value or fail. The 1 function yields a successful computation, while >>= < sequences two subcomputations, failing on the first error. 8#Transform the computation inside a MaybeT. 9Lift a callCC operation to the new monad. :Lift a  catchError operation to the new monad. ;Lift a listen operation to the new monad. <Lift a pass operation to the new monad. 56789:;<56789:;<56789:;< 56789:;< portable experimentalross@soi.city.ac.uk Safe-Inferred=The reader monad transformer, 8 which adds a read-only environment to the given monad. The ) function ignores the environment, while >>= passes 4 the inherited environment to both subcomputations. ?>The underlying computation, as a function of the environment. @"The parameterizable reader monad. 4Computations are functions of a shared environment. The ) function ignores the environment, while >>= passes 4 the inherited environment to both subcomputations. A2Constructor for computations in the reader monad. BRuns a Reader' and extracts the final value from it. C"Transform the value returned by a Reader. D0Execute a computation in a modified environment  (a specialization of F). E#Transform the computation inside a ReaderT. F0Execute a computation in a modified environment  (a more general version of H). G$Fetch the value of the environment. H0Execute a computation in a modified environment  (a specialization of F). I0Retrieve a function of the current environment. JLift a callCC operation to the new monad. KLift a  catchError operation to the new monad. =>?@ABA Reader to run. An initial environment. CD(The function to modify the environment. 0Computation to run in the modified environment. EF(The function to modify the environment. 0Computation to run in the modified environment. GH(The function to modify the environment. 0Computation to run in the modified environment. I3The selector function to apply to the environment. JcallCC on the argument monad. Kcatch on the argument monad. Computation to attempt. Exception handler.  !"=>?@ABCDEFGHIJK@ABCD=>?EFGHIJK=>?@ABCDEFGHIJK !" portable experimentalross@soi.city.ac.uk Safe-InferredL: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. O*A monad containing an environment of type r, output of type w  and an updatable state of type s. P.Construct an RWS computation from a function.  (The inverse of Q.) Q)Unwrap an RWS computation as a function.  (The inverse of P.) Z$Fetch the value of the environment. [0Execute a computation in a modified environment \0Retrieve a function of the current environment. ]] w' is an action that produces the output w. ^^ m' is an action that executes the action m and adds its ) output to the value of the computation. __ f m' is an action that executes the action m and adds  the result of applying f0 to the output to the value of the computation.  _ f m = # (id *** f) (^ m)`` m' is an action that executes the action m, which returns F a value and a function, and returns the value, applying the function  to the output. aa f m' is an action that executes the action m and  applies the function f) to its output, leaving the return value  unchanged.  a f m = ` (# (\x -> (x,f)) m)b7Fetch the current value of the state within the monad. cc s$ sets the state within the monad to s. dd f6 is an action that updates the state to the result of  applying f to the current state. eCGet a specific component of the state, using a projection function  supplied.  e f = # f bfUniform lifting of a callCC 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. C This version uses the current state on entering the continuation. hLift a  catchError operation to the new monad. %LMNOPQRSTUVWXYZ[\]^_`abcdefgh$%&'()*+LMNOPQRSTUVWXYZ[\]^_`abcdefghOPQRSTULMNVWXYZ[\]^_`abcdefgh#LMNOPQRSTUVWXYZ[\]^_`abcdefgh$%&'()*+portable experimentalross@soi.city.ac.uk Safe-InferredLMNOPQRSTUVWXYZ[\]^_`abcdefghportable experimentalross@soi.city.ac.uk Safe-Inferredi: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.) w$Fetch the value of the environment. x0Execute a computation in a modified environment y0Retrieve a function of the current environment. zz w' is an action that produces the output w. {{ m' is an action that executes the action m and adds its ) output to the value of the computation. || f m' is an action that executes the action m and adds  the result of applying f0 to the output to the value of the computation.  | f m = # (id *** f) ({ m)}} m' is an action that executes the action m, which returns F a value and a function, and returns the value, applying the function  to the output. ~~ f m' is an action that executes the action m and  applies the function f) to its output, leaving the return value  unchanged.  ~ f m = } (# (\x -> (x,f)) m)7Fetch the current value of the state within the monad.  s$ sets the state within the monad to s.  f6 is an action that updates the state to the result of  applying f to the current state. CGet a specific component of the state, using a projection function  supplied.   f = # f Uniform lifting of a callCC 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. C This version uses the current state on entering the continuation. Lift a  catchError operation to the new monad. %ijklmnopqrstuvwxyz{|}~,-./0123ijklmnopqrstuvwxyz{|}~lmnopqrijkstuvwxyz{|}~#ijklmnopqrstuvwxyz{|}~,-./0123portable experimentalross@soi.city.ac.uk Safe-Inferred,A state transformer monad parameterized by:  s - The state.  m - The inner monad. The , function leaves the state unchanged, while >>= uses B 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 >>= uses B the final state of the first computation as the initial state of  the second. 5Construct a state monad computation from a function.  (The inverse of .) 0Unwrap a state monad computation as a function.  (The inverse of .) :Evaluate a state computation with the given initial state 9 and return the final value, discarding the final state.   m s = 4 ( m s):Evaluate a state computation with the given initial state 9 and return the final state, discarding the final value.   m s = 5 ( m s)AMap 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 >> m:Evaluate a state computation with the given initial state 9 and return the final value, discarding the final state.   m s = # 4 ( m s):Evaluate a state computation with the given initial state 9 and return the final state, discarding the final value.   m s = # 5 ( m s)AMap 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 >> m7Fetch the current value of the state within the monad.  s$ sets the state within the monad to s.  f6 is an action that updates the state to the result of  applying f to the current state. CGet a specific component of the state, using a projection function  supplied.   f = # f Uniform lifting of a callCC 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. C This version uses the current state on entering the continuation. 6 It does not satisfy the laws of a monad transformer. Lift a  catchError 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 state return 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 state 6789:;<=6789:;<=portable experimentalross@soi.city.ac.uk Safe-Inferredportable experimentalross@soi.city.ac.uk Safe-Inferred,A state transformer monad parameterized by:  s - The state.  m - The inner monad. The , function leaves the state unchanged, while >>= uses B 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 >>= uses B the final state of the first computation as the initial state of  the second. 5Construct a state monad computation from a function.  (The inverse of .) 0Unwrap a state monad computation as a function.  (The inverse of .) :Evaluate a state computation with the given initial state 9 and return the final value, discarding the final state.   m s = 4 ( m s):Evaluate a state computation with the given initial state 9 and return the final state, discarding the final value.   m s = 5 ( m s)AMap 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 >> m:Evaluate a state computation with the given initial state 9 and return the final value, discarding the final state.   m s = # 4 ( m s):Evaluate a state computation with the given initial state 9 and return the final state, discarding the final value.   m s = # 5 ( m s)AMap 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 >> m7Fetch the current value of the state within the monad.  s$ sets the state within the monad to s.  f6 is an action that updates the state to the result of  applying f to the current state. CGet a specific component of the state, using a projection function  supplied.   f = # f Uniform lifting of a callCC 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. C This version uses the current state on entering the continuation. 6 It does not satisfy the laws of a monad transformer. Lift a  catchError 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 state return 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 state >?@ABCDE>?@ABCDEportable experimentalross@soi.city.ac.uk Safe-Inferred!A writer monad parameterized by:  w - the output to accumulate.  m - The inner monad. The  function produces the output F, while >>= 3 combines the outputs of the subcomputations using G. )A writer monad parameterized by the type w of output to accumulate. The  function produces the output F, while >>= 3 combines the outputs of the subcomputations using G. =Construct a writer computation from a (result, output) pair.  (The inverse of .) 8Unwrap a writer computation as a (result, output) pair.  (The inverse of .) .Extract the output from a writer computation.   m = 5 ( m)<Map 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 ( m)<Map 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 m 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 f0 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 m, which returns F 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 f) 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  catchError operation to the new monad. HIJKLMNOHIJKLMNOportable experimentalross@soi.city.ac.uk Safe-Inferredportable experimentalross@soi.city.ac.uk Safe-Inferred!A writer monad parameterized by:  w - the output to accumulate.  m - The inner monad. The  function produces the output F, while >>= 3 combines the outputs of the subcomputations using G. )A writer monad parameterized by the type w of output to accumulate. The  function produces the output F, while >>= 3 combines the outputs of the subcomputations using G. =Construct a writer computation from a (result, output) pair.  (The inverse of .) 8Unwrap a writer computation as a (result, output) pair.  (The inverse of .) .Extract the output from a writer computation.   m = 5 ( m)<Map 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 ( m)<Map 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 m 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 f0 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 m, which returns F 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 f) 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  catchError operation to the new monad. PQRSTUVWPQRSTUVWX !"#$%%&'()*+,-./0123456789 : : ; < 7 = > > ? @ 7 = A A B C 7 = 8 9 D D E F G H I J K L M N O 7 = P P Q R S T U V W X Y Z [ \ M N O ] ^ _ ` a b c d e 7 f =PPQRSTUVWXYZ[\MNO]^_`abcde7f=gghijklmnopqrsbcde7f=89gghijklmnopqrsbcde7f=89ttuvwxyz{|]^_`a7=ttuvwxyz{|]^_`a7=}~  transformers-0.2.2.1Data.Functor.ProductData.Functor.ConstantData.Functor.ComposeData.Functor.IdentityControl.Monad.Trans.ClassControl.Monad.IO.ClassControl.Monad.Trans.ContControl.Monad.Trans.ErrorControl.Monad.Trans.IdentityControl.Monad.Trans.ListControl.Monad.Trans.MaybeControl.Monad.Trans.ReaderControl.Monad.Trans.RWS.LazyControl.Monad.Trans.RWS.StrictControl.Monad.Trans.State.Lazy Control.Monad.Trans.State.StrictControl.Monad.Trans.Writer.Lazy!Control.Monad.Trans.Writer.Strict throwError catchErrorErrorTControl.Monad.Trans.RWSControl.Monad.Trans.StateControl.Monad.Trans.WriterProductPairConstant getConstantCompose getComposeIdentity runIdentity MonadTransliftMonadIOliftIOContTrunContTContcontrunContmapContwithContmapContT withContTcallCC liftLocal runErrorT ErrorListlistMsgErrornoMsgstrMsg mapErrorT liftCallCC liftListenliftPass IdentityT runIdentityT mapIdentityT liftCatchListTrunListTmapListTMaybeT runMaybeT mapMaybeTReaderT runReaderTReaderreader runReader mapReader withReader mapReaderT withReaderTasklocalasksRWSTrunRWSTRWSrwsrunRWSevalRWSexecRWSmapRWSwithRWSevalRWSTexecRWSTmapRWSTwithRWSTtelllistenlistenspasscensorgetputmodifygets liftCallCC'StateT runStateTStatestaterunState evalState execStatemapState withState evalStateT execStateT mapStateT withStateTWriterT runWriterTWriterwriter runWriter execWriter mapWriter execWriterT mapWriterT$fAlternativeProduct$fApplicativeProduct$fTraversableProduct$fFoldableProduct$fFunctorProduct$fApplicativeConstant$fTraversableConstant$fFoldableConstant$fFunctorConstant$fAlternativeCompose$fApplicativeCompose$fTraversableCompose$fFoldableCompose$fFunctorCompose$fMonadFixIdentity$fMonadIdentity$fApplicativeIdentity$fTraversableIdentity$fFoldableIdentity$fFunctorIdentitybaseGHC.Basereturnghc-prim GHC.TypesIO $fMonadIOIOid$fMonadIOContT$fMonadTransContT $fMonadContT$fApplicativeContT$fFunctorContTString Data.EitherLeft $fError[]$fMonadIOErrorT$fMonadTransErrorT$fMonadFixErrorT$fMonadPlusErrorT $fMonadErrorT$fAlternativeErrorT$fApplicativeErrorT$fFunctorErrorT$fMonadPlusEither$fAlternativeEither$fErrorListChar$fErrorIOException $fMonadPlusIOlift2IdentityT$fMonadTransIdentityT$fMonadIOIdentityT$fMonadPlusIdentityT$fMonadIdentityT$fAlternativeIdentityT$fApplicativeIdentityT$fFunctorIdentityT$fMonadIOListT$fMonadTransListT$fMonadPlusListT $fMonadListT$fAlternativeListT$fApplicativeListT$fFunctorListT Data.MaybeMaybe$fMonadIOMaybeT$fMonadTransMaybeT$fMonadPlusMaybeT $fMonadMaybeT$fAlternativeMaybeT$fApplicativeMaybeT$fFunctorMaybeT liftReaderT$fMonadIOReaderT$fMonadTransReaderT$fMonadFixReaderT$fMonadPlusReaderT$fMonadReaderT$fAlternativeReaderT$fApplicativeReaderT$fFunctorReaderT Control.MonadliftM $fMonadIORWST$fMonadTransRWST$fMonadFixRWST$fMonadPlusRWST $fMonadRWST$fAlternativeRWST$fApplicativeRWST $fFunctorRWST Data.Tuplefstsnd$fMonadIOStateT$fMonadTransStateT$fMonadFixStateT$fMonadPlusStateT $fMonadStateT$fAlternativeStateT$fApplicativeStateT$fFunctorStateT Data.Monoidmemptymappend$fMonadIOWriterT$fMonadTransWriterT$fMonadFixWriterT$fMonadPlusWriterT$fMonadWriterT$fAlternativeWriterT$fApplicativeWriterT$fFunctorWriterT