๚ฮฟ@ตเด      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij k l m n o p q r s t u v w x y z { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ ” • – — ˜ ™ š › œ  ž Ÿ   ก ข ฃ ค ฅ ฆ ง จ ฉ ช ซ ฌ ญ ฎ ฏ ฐ ฑ ฒ ณ portable experimentallibraries@haskell.orgportable experimentallibraries@haskell.orgKThe 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. Here are some examples of use: . -- wraps IO action that can throw an error e & type ErrorWithIO e a = ErrorT e IO a  ==> ErrorT (IO (Either e a))  0 -- IO monad wrapped in StateT inside of ErrorT ; type ErrorAndStateWithIO e s a = ErrorT e (StateT s IO) a ' ==> ErrorT (StateT s IO (Either e a)) . ==> ErrorT (StateT (s -> IO (Either e a,s))) 5Workaround so that we can have a Haskell 98 instance   ด.  An exception to be thrown. + An instance must redefine at least one of  ,  . (Creates an exception without a message.  Default implementation is   "". %Creates an exception with a message.  Default implementation is  . Signal an error 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.      portable experimentallibraries@haskell.org1Parameterizable list monad, with an inner monad. Note:G this does not yield a monad unless the argument monad is commutative. Lift a callCC operation to the new monad. Lift a  catchError operation to the new monad. portable experimentallibraries@haskell.orgIdentity wrapper. &Abstraction for wrapping up a object. &If you have an monadic function, say:  " example :: Int -> Identity Int  example x = return (x*x) you can "run" it, using   Main> runIdentity (example 42)  1764 :: Int 9A typical use of the Identity monad is to derive a monad from a monad transformer.   -- derive the Control.Monad.State.State monad using the Control.Monad.State.StateT monad transformer type Control.Monad.State.State s a = Control.Monad.State.StateT s  a The 9 label is used in the type definition because it follows Ga style of monad definition that explicitly represents monad values as Qcomputations. In this style, a monadic computation is built up using the monadic =operators and then the value of the computation is extracted  using the  run****** function.  Because the Identity3 monad does not do any computation, its definition  is trivial. -For a better example of this style of monad, see the Control.Monad.State.State monad. portable experimentallibraries@haskell.org $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. DRuns a CPS computation, returns its result after applying the final  continuation to it. continuation computation (Cont). 'the final continuation, which produces  the final result (often ถ). !"#$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 $Control.Monad.Trans.Error.throwError  and $Control.Monad.Trans.Error.catchError within an   Control.Monad.Trans.Error.ErrorT 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.  !"#$%  !"#$%  !"#$%portable experimentallibraries@haskell.org&The reader monad transformer. G Can be used to add environment reading functionality to other monads. '()"The parameterizable reader monad. The ท function creates a Reader that ignores the environment,  and produces the given value. The binding operator >>= produces a Reader that uses the G environment to extract the value its left-hand side, and then applies ; the bound function to that value in the same environment. *Runs Reader' and extracts the final value from it. A Reader to run. An initial environment. +,A more general version of 0. -./012Lift a callCC operation to the new monad. 3Lift a  catchError operation to the new monad. &'()*+,-./0123)*+,&'(-./0123&'('()*+,-./0123portable experimentallibraries@haskell.org456789:;<=>?@ABCDEFGHIJKMonadic state transformer. 7Maps an old state to a new state inside a state monad. $ The old state is thrown away. LBGets specific component of the state, using a projection function  supplied. MLift a callCC operation to the new monad. NLift a  catchError operation to the new monad. 456789:;<=>?@ABCDEFGHIJKLMN789:;<456=>?@ABCDEFGHIJKLMN45656789:;<=>?@ABCDEFGHIJKLMN portable experimentallibraries@haskell.org456789:;<=>?@ABCDEFGHIJKLMNportable experimentallibraries@haskell.orgOPQRSTUVWXYZ[\]^_`abcdefMonadic state transformer. 7Maps an old state to a new state inside a state monad. $ The old state is thrown away. gBGets specific component of the state, using a projection function  supplied. hLift a callCC operation to the new monad. iLift a  catchError operation to the new monad. OPQRSTUVWXYZ[\]^_`abcdefghiRSTUVWOPQXYZ[\]^_`abcdefghiOPQPQRSTUVWXYZ[\]^_`abcdefghi portable experimentallibraries@haskell.orgj9A parameterizable state monad for encapsulating an inner  monad. =The StateT Monad structure is parameterized over two things:  s - The state.  m - The inner monad. Here are some examples of use: !(Parser from ParseLib with Hugs)  % type Parser a = StateT String [] a ) ==> StateT (String -> [(a,String)]) %For example, item can be written as:  item = do (x:xs) <- get  put xs  return x  . type BoringState s a = StateT s Identity a ) ==> StateT (s -> Identity (a,s))  ( type StateWithIO s a = StateT s IO a # ==> StateT (s -> IO (a,s))  , type StateWithErr s a = StateT s Maybe a & ==> StateT (s -> Maybe (a,s)) klm$A parameterizable state monad where s is the type of the state  to carry and a is the type of the  return value. no@Evaluate this state monad with the given initial state,throwing ' away the final state. Very much like fst composed with  runstate. The state to evaluate An initial value *The return value of the state application p?Execute this state and return the new state, throwing away the  return value. Very much like snd composed with  runstate. The state to evaluate An initial value The new state qBMap a stateful computation from one (return value, state) pair to D another. For instance, to convert numberTree from a function that C returns a tree to a function that returns the sum of the numbered D tree (see the Examples section for numberTree and sumTree) you may  write: < sumNumberedTree :: (Eq a) => Tree a -> State (Table a) Int K sumNumberedTree = mapState (\ (t, tab) -> (sumTree t, tab)) . numberTree rBApply this function to this state and return the resulting state. s Similar to o t Similar to p u Similar to q v Similar to r wxyMonadic state transformer. 7Maps an old state to a new state inside a state monad. $ The old state is thrown away. zBGets specific component of the state, using a projection function  supplied. {Lift 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. jklmnopqrstuvwxyz{|}~mnopqrjklstuvwxyz{|}~jklklmnopqrstuvwxyz{|}~portable experimentallibraries@haskell.orgjklmnopqrstuvwxyz{|}~ portable experimentallibraries@haskell.org9A parameterizable state monad for encapsulating an inner  monad. =The StateT Monad structure is parameterized over two things:  s - The state.  m - The inner monad. Here are some examples of use: !(Parser from ParseLib with Hugs)  % type Parser a = StateT String [] a ) ==> StateT (String -> [(a,String)]) %For example, item can be written as:  item = do (x:xs) <- get  put xs  return x  . type BoringState s a = StateT s Identity a ) ==> StateT (s -> Identity (a,s))  ( type StateWithIO s a = StateT s IO a # ==> StateT (s -> IO (a,s))  , type StateWithErr s a = StateT s Maybe a & ==> StateT (s -> Maybe (a,s)) €‚$A parameterizable state monad where s is the type of the state  to carry and a is the type of the  return value. ƒ„@Evaluate this state monad with the given initial state,throwing ' away the final state. Very much like fst composed with  runstate. The state to evaluate An initial value *The return value of the state application …?Execute this state and return the new state, throwing away the  return value. Very much like snd composed with  runstate. The state to evaluate An initial value The new state †BMap a stateful computation from one (return value, state) pair to D another. For instance, to convert numberTree from a function that C returns a tree to a function that returns the sum of the numbered D tree (see the Examples section for numberTree and sumTree) you may  write: < sumNumberedTree :: (Eq a) => Tree a -> State (Table a) Int K sumNumberedTree = mapState (\ (t, tab) -> (sumTree t, tab)) . numberTree ‡BApply this function to this state and return the resulting state. ˆ Similar to „ ‰ Similar to … Š Similar to † ‹ Similar to ‡ ŒŽMonadic state transformer. 7Maps an old state to a new state inside a state monad. $ The old state is thrown away. BGets specific component of the state, using a projection function  supplied. Lift 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. €‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“‚ƒ„…†‡€ˆ‰Š‹ŒŽ‘’“€€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“ portable experimentallibraries@haskell.org”•–—˜™š›œžŸ กขLift a callCC operation to the new monad. ฃLift a  catchError operation to the new monad. ”•–—˜™š›œžŸ กขฃ—˜™š”•–›œžŸ กขฃ”•–•–—˜™š›œžŸ กขฃportable experimentallibraries@haskell.org”•–—˜™š›œžŸ กขฃ portable experimentallibraries@haskell.orgคฅฆงจฉชซฌญฎฏฐฑฒLift a callCC operation to the new monad. ณLift a  catchError operation to the new monad. คฅฆงจฉชซฌญฎฏฐฑฒณงจฉชคฅฆซฌญฎฏฐฑฒณคฅฆฅฆงจฉชซฌญฎฏฐฑฒณธ !!"#$%%&''()*+,-./01123456789:;$<<=>?@ABCDEFG9:;HIJKLMNOP$<<=>?@ABCDEFG9:;HIJKLMNOP$ Q Q R S T U V W X Y Z [ \ M N O P  $  Q Q R S T U V W X Y Z [ \ M N O P  $  ] ] ^ _ ` a b c d H I J K L  $ ] ] ^ _ ` a b c d H I J K L  $efghefiefjktransformers-0.0.0.0Control.Monad.TransControl.Monad.Trans.ErrorControl.Monad.Trans.ListControl.Monad.IdentityControl.Monad.Trans.ContControl.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.StrictControl.Monad.Trans.RWSControl.Monad.Trans.StateControl.Monad.Trans.WriterMonadIOliftIO MonadTransliftErrorT runErrorT ErrorListlistMsgErrornoMsgstrMsg mapErrorT throwError catchError liftCallCC liftListenliftPassListTrunListTmapListT liftCatchIdentity runIdentityContTrunContTContrunContmapContwithContmapContT withContTcallCC liftLocalReaderT runReaderTReader runReader mapReader withReader mapReaderT withReaderTasklocalasksRWSTrunRWSTRWSrunRWSevalRWSexecRWSmapRWSwithRWSevalRWSTexecRWSTmapRWSTwithRWSTtelllistenpasslistenscensorgetputmodifygetsStateT runStateTStaterunState evalState execStatemapState withState evalStateT execStateT mapStateT withStateTWriterT runWriterTWriter runWriter execWriter mapWriter execWriterT mapWriterTbaseGHC.BaseString $fError[]idreturn