ob|      !"#$%&'()*+,-./0123456789:;<=>?@ABCD 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 efghi j k l m nopqrstuvwxyz{portable experimentalross@soi.city.ac.uk Safe-Inferred|}~ non-portable (type families) experimentalross@soi.city.ac.uk Safe-InferreddcallCC" (call-with-current-continuation) D calls a function with the current continuation as its argument. P Provides an escape continuation mechanism for use with Continuation monads. K Escape continuations allow to abort the current computation and return  a value immediately. % They achieve a similar effect to   and   within an  monad. , Advantage of this function over calling return is that it makes  the continuation explicit, 1 allowing more flexibility and better control  (see examples in Control.Monad.Cont). The standard idiom used with callCC# is to provide a lambda-expression K to name the continuation. Then calling the named continuation anywhere 7 within its scope will escape from the computation, ? even if it is many layers deep within nested computations. cdcdcd cdportable experimentalross@soi.city.ac.uk Safe-Inferrednon-portable (type families) experimentalross@soi.city.ac.uk Safe-InferredeAThe strategy of combining computations that can throw exceptions by bypassing bound functions Gfrom the point an exception is thrown to the point that it is handled. 8Is parameterized over the type of error information and the monad type constructor. It is common to use  String as the monad type constructor Ifor an error monad in which error descriptions take the form of strings. PIn that case and many other common cases the resulting monad is already defined as an instance of the e class. +You can also define your own error type and/ or use a monad type constructor  other than  String or  IOError. CIn these cases you will have to explicitly define instances of the  and/or e classes. gDIs used within a monadic computation to begin exception processing. hMA handler function to handle previous errors and return to normal execution.  A common idiom is:  7 do { action1; action2; action3 } `catchError` handler  where the action functions can call g.  Note that handler2 and the do-block must have the same return type. efgh efgh efghefghnon-portable (type families) experimentalross@soi.city.ac.uk Safe-Inferred9 efgh efgh portable experimentalross@soi.city.ac.uk Safe-Inferred1 non-portable (type families) experimentalross@soi.city.ac.uk Safe-InferrediSee examples in Control.Monad.Reader. + Note, the partially applied function type (->) r is a simple reader monad.  See the instance declaration below. k!Retrieves the monad environment. l2Executes a computation in a modified environment. m1Retrieves a function of the current environment. ijkl(The function to modify the environment. Reader% to run in the modified environment. m3The selector function to apply to the environment. ijklmijklmijklmnon-portable (type families) experimentalross@soi.city.ac.uk Safe-Inferred>ijklmijklmnon-portable (type families) experimentalross@soi.city.ac.uk Safe-Inferrednget4 returns the state from the internals of the monad. put& replaces the state inside the monad. rMonadic state transformer. 7Maps an old state to a new state inside a state monad. $ The old state is thrown away.  + Main> :t modify ((+1) :: Int -> Int) 1 modify (...) :: (MonadState Int a) => a () This says that  modify (+1) acts over any " Monad that is a member of the  MonadState class,  with an Int state. sBGets specific component of the state, using a projection function  supplied. nopqrsnopqrsnopqrsnopqrsnon-portable (type families) experimentalross@soi.city.ac.uk Safe-Inferredtuvwxyztuvwxyztuvwxyz tuvwxyznon-portable (type families) experimentalross@soi.city.ac.uk Safe-Inferred{ijklmnopqrstuvwxyz{{{non-portable (type families) experimentalross@soi.city.ac.uk Safe-Inferredm     !"#$%&'()ijklmnopqrstuvwxyz{ #)'%"(&$!non-portable (type families) experimentalross@soi.city.ac.uk Safe-Inferredm     !"#$%&'()ijklmnopqrstuvwxyz{non-portable (type families) experimentalross@soi.city.ac.uk Safe-Inferredm    *+,-./0123456ijklmnopqrstuvwxyz{ -0642/,+*531.non-portable (type families) experimentalross@soi.city.ac.uk Safe-InferredC789:;<=>?@ABCnopqrsnopqrs:=CA?<987B@>;non-portable (type families) experimentalross@soi.city.ac.uk Safe-InferredC789:;<=>?@ABCnopqrs non-portable (type families) experimentalross@soi.city.ac.uk Safe-InferredCDEFGHIJKLMNOPnopqrsnopqrsGJPNLIFEDOMKH non-portable (type families) experimentalross@soi.city.ac.uk Safe-Inferred]    QRSTUVWXYtuvwxyztuvwxyzTUYWSRQXVnon-portable (type families) experimentalross@soi.city.ac.uk Safe-Inferred]    QRSTUVWXYtuvwxyz non-portable (type families) experimentalross@soi.city.ac.uk Safe-Inferred]    Z[\]^_`abtuvwxyztuvwxyz]^b`\[Za_non-portable (type families) experimentalross@soi.city.ac.uk Safe-Inferred8cd cd  !"#$%&%'%'%(%)%%*+,+-+-+./0/1/1/2/3/4/5/6/7898:8:8;8<8=8>8?8@8A8B8C8DE9E:E:E;E<E=E>E?E@EAEBECEDFGFHFHFIFJFKFLFMFNFOFPFQFRSGSHSHSISJSKSLSMSNSOSPSQSRTUTVTVTWTXTYTZT[T\]U]V]V]W]X]Y]Z][]\ ^ _`a b c d e fghijklmnopqrstuvuwuw x y z { | } ~   monads-tf-0.1.0.1Control.Monad.ContControl.Monad.ErrorControl.Monad.Error.ClassControl.Monad.ListControl.Monad.ReaderControl.Monad.RWS.LazyControl.Monad.RWS.StrictControl.Monad.State.LazyControl.Monad.State.StrictControl.Monad.Writer.LazyControl.Monad.Writer.StrictControl.Monad.Cont.ClassControl.Monad.Reader.ClassControl.Monad.State.ClassControl.Monad.Writer.ClassControl.Monad.RWS.ClassControl.Monad.Identity throwError catchErrorErrorControl.Monad.TransDataEitherControl.Monad.RWSControl.Monad.StateControl.Monad.Writertransformers-0.3.0.0Control.Monad.Trans.ContrunContTContTCont withContTwithContrunContmapContTmapContControl.Monad.Trans.Error runErrorTErrorTstrMsgnoMsg mapErrorTControl.Monad.Trans.ListrunListTListTmapListTControl.Monad.Trans.Reader runReaderTReaderTReader withReaderT withReader runReader mapReaderT mapReaderControl.Monad.Trans.RWS.LazyrunRWSTRWSTRWSwithRWSTwithRWSrunRWSmapRWSTmapRWSexecRWSTexecRWSevalRWSTevalRWSControl.Monad.Trans.RWS.StrictControl.Monad.Trans.State.Lazy runStateTStateTState withStateT withStaterunState mapStateTmapState execStateT execState evalStateT evalState Control.Monad.Trans.State.StrictControl.Monad.Trans.Writer.Lazy runWriterTWriterTWriter runWriter mapWriterT mapWriter execWriterT execWriter!Control.Monad.Trans.Writer.Strict MonadContcallCC MonadError ErrorType MonadReaderEnvTypeasklocalasks MonadState StateTypegetputmodifygets MonadWriter WriterTypetelllistenpasslistenscensorMonadRWSData.Functor.Identity runIdentityIdentity$fMonadContWriterT$fMonadContWriterT0$fMonadContStateT$fMonadContStateT0$fMonadContRWST$fMonadContRWST0$fMonadContReaderT$fMonadContMaybeT$fMonadContListT$fMonadContIdentityT$fMonadContErrorT$fMonadContContTControl.Monad.Trans.Class MonadTransControl.Monad.IO.ClassliftIOMonadIOlift$fMonadErrorWriterT$fMonadErrorWriterT0$fMonadErrorStateT$fMonadErrorStateT0$fMonadErrorRWST$fMonadErrorRWST0$fMonadErrorReaderT$fMonadErrorMaybeT$fMonadErrorListT$fMonadErrorIdentityT$fMonadErrorErrorT$fMonadErrorEither$fMonadErrorIObaseGHC.Basefail>>=>>fmapreturnControl.Monad.Fixmfix Control.MonadguardliftMMonadFunctorMonadFix MonadPlus Data.FunctionfixmfilterapliftM5liftM4liftM3liftM2unlesswhen replicateM_ replicateMfoldM_foldM zipWithM_zipWithM mapAndUnzipMjoinvoidforever<=<>=>msumforM_forMfilterMmapM_mapM sequence_sequence=<<mplusmzero$fMonadReaderWriterT$fMonadReaderWriterT0$fMonadReaderStateT$fMonadReaderStateT0$fMonadReaderMaybeT$fMonadReaderListT$fMonadReaderIdentityT$fMonadReaderErrorT$fMonadReaderContT$fMonadReaderRWST$fMonadReaderRWST0$fMonadReaderReaderT$fMonadReader(->)$fMonadStateWriterT$fMonadStateWriterT0$fMonadStateReaderT$fMonadStateMaybeT$fMonadStateListT$fMonadStateIdentityT$fMonadStateErrorT$fMonadStateContT$fMonadStateRWST$fMonadStateRWST0$fMonadStateStateT$fMonadStateStateT0$fMonadWriterStateT$fMonadWriterStateT0$fMonadWriterReaderT$fMonadWriterMaybeT$fMonadWriterIdentityT$fMonadWriterErrorT$fMonadWriterRWST$fMonadWriterRWST0$fMonadWriterWriterT$fMonadWriterWriterT0$fMonadRWSMaybeT$fMonadRWSIdentityT$fMonadRWSErrorT$fMonadRWSRWST$fMonadRWSRWST0 Data.Monoid<>mconcatmappendmemptyMonoidgetDualDualappEndoEndogetAllAllgetAnyAnygetSumSum getProductProductgetFirstFirstgetLastLast