h$ZS      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX Y Z [ \ ] ^ _ ` 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 { | } ~                                                      %(C) Koz Ross 2022, Manuel Brenz 2021#BSD-3-Clause (see the LICENSE file)koz.ross@retro-freedom.nz ExperimentalGHC only Trustworthy 2<=>qmtlA helper type to decrease boilerplate when defining new transformer instances of s.Most of the instances in this module are derived using this method; for example, our instance of  is derived as follows: deriving via (LiftingAccum (ExceptT e) m) instance (MonadAccum w m) => MonadAccum w (ExceptT e m)smtlThe capability to accumulate. This can be seen in one of two ways:A  which can only append (using ); orA  (limited to 7) with the ability to view the result of all previous s.Lawsv should obey the following: v ( (x, )) =  xv f  v g = v  acc -> let (_, v) = f acc (res, w) = g (acc  v) in (res, v  w)If you choose to define t and u5 instead, their definitions must obey the following: t  t = tu  =  ()u x  u y = u (x  y)u x  t = t  w -> u x  w  xIf you want to define both, the relationship between them is as follows. These are also the default definitions. t = v  acc -> (acc, mempty)u x = v  acc -> ((), x)v f = t$ >>= acc -> let (res, v) = f acc in u v  restmtl'Retrieve the accumulated result so far.umtlAppend a value to the result.vmtl2Embed a simple accumulation action into the monad.wmtl-Retrieve a function of the accumulated value.xmtlymtlzmtl{mtl|mtl}mtl~mtlmtlmtlmtlmtl7The 'ranking' function gains the ability to accumulate ws each time it is called. The final result will include the entire log of all such calls.mtlmtlmtlmtlmtlmtlThe accumulated value 'survives' an exception: even if the computation fails to deliver a result, we still have an accumulated value.mtlThe continuation can see, and interact with, the accumulated value.mtlThe accumulated value 'survives' an error: even if the computation fails to deliver a result, we still have an accumulated value.qrsvtuwsvtuqrw (c) The University of Glasgow 2001, (c) Jeff Newbern 2003-2007, (c) Andriy Palamarchuk 2007 BSD-style (see the file LICENSE)libraries@haskell.org experimentalportableSafemtlcallCC (call-with-current-continuation) calls a function with the current continuation as its argument. Provides an escape continuation mechanism for use with Continuation monads. Escape continuations allow to abort the current computation and return a value immediately. They achieve a similar effect to   and   within an 4 monad. Advantage of this function over calling return is that it makes the continuation explicit, allowing more flexibility and better control (see examples in Control.Monad.Cont).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.mtlmtlmtlmtl (c) The University of Glasgow 2001, (c) Jeff Newbern 2003-2007, (c) Andriy Palamarchuk 2007 BSD-style (see the file LICENSE)libraries@haskell.org experimentalportableSafeefghijklmponmlkjihpongfe (c) Michael Weber 2001, (c) Jeff Newbern 2003-2006, (c) Andriy Palamarchuk 2006 (c) Edward Kmett 2012 BSD-style (see the file LICENSE)libraries@haskell.org experimental+non-portable (multi-parameter type classes)Safe>6 mtlThe strategy of combining computations that can throw exceptions by bypassing bound functions from the point an exception is thrown to the point that it is handled.Is parameterized over the type of error information and the monad type constructor. It is common to use  String as the monad type constructor for an error monad in which error descriptions take the form of strings. In that case and many other common cases the resulting monad is already defined as an instance of the  class. You can also define your own error type and/or use a monad type constructor other than  String or  IOError. In these cases you will have to explicitly define instances of the ) class. (If you are using the deprecated Control.Monad.Error or Control.Monad.Trans.Error!, you may also have to define an Error instance.)mtlIs used within a monadic computation to begin exception processing.mtlA handler function to handle previous errors and return to normal execution. A common idiom is: 5do { action1; action2; action3 } `catchError` handler where the action functions can call . Note that handler1 and the do-block must have the same return type.mtl Lifts an  e into any  e. -do { val <- liftEither =<< action1; action2 }where action1 returns an  to represent errors.mtl analogue to the  function.mtl analogue to the  withExceptT function. Modify the value (but not the type) of an error. The type is fixed because of the functional dependency m -> e&. If you need to change the type of e use .mtlAs handle is flipped ,  is flipped .mtl analogue of the  mapExceptT function. The computation is unwrapped, a function is applied to the Either,, and the result is lifted into the second  instance.mtlmtlmtlmtlmtl(c) Michael Weber 2001, (c) Jeff Newbern 2003-2006, (c) Andriy Palamarchuk 2006 BSD-style (see the file LICENSE)libraries@haskell.org experimental+non-portable (multi-parameter type classes)Safev(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology 2001, (c) Jeff Newbern 2003-2006, (c) Andriy Palamarchuk 2006 BSD-style (see the file LICENSE)libraries@haskell.org experimentalportableSafe (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology 2001, (c) Jeff Newbern 2003-2007, (c) Andriy Palamarchuk 2007 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)Safe>$ mtlSee examples in Control.Monad.Reader-. Note, the partially applied function type (->) r$ is a simple reader monad. See the instance declaration below.mtl Retrieves the monad environment.mtl1Executes a computation in a modified environment.mtl0Retrieves a function of the current environment.mtl0Retrieves a function of the current environment.mtlmtlmtlmtlmtlmtl'The function to modify the environment.mtlReader$ to run in the modified environment.mtl2The selector function to apply to the environment.mtl2The selector function to apply to the environment.(C) Koz Ross 2022#BSD-3-Clause (see the LICENSE file)koz.ross@retro-freedom.nz ExperimentalGHC only Trustworthy 2<=>8_mtlA helper type to decrease boilerplate when defining new transformer instances of .Most of the instances in this module are derived using this method; for example, our instance of  is derived as follows: deriving via (LiftingSelect (ExceptT e) m) instance (MonadSelect r m) => MonadSelect r (ExceptT e m)mtlThe capability to search with backtracking. Essentially describes a 'policy function': given the state of the search (and a 'ranking' or 'evaluation' of each possible result so far), pick the result that's currently best.LawsAny instance of  must follow these laws: ( x) =  x f   g =  gmtlmtlmtlmtlmtlmtl'Readerizes' the accumulator: the 'ranking' function can see the value that has been accumulated (of type w), but can't add anything to it. Effectively, can be thought of as 'extending' the 'ranking' by all values of w, but which w gets given to any rank calls is predetermined by the 'outer accumulation' (and cannot change).mtlA combination of an 'outer' ;, WriterT and StateT%. In short, you get a value of type r which can influence what gets picked, but not how anything is ranked, and the 'ranking' function gets access to an s and a w, but can modify neither.mtlA combination of an 'outer' ;, WriterT and StateT%. In short, you get a value of type r which can influence what gets picked, but not how anything is ranked, and the 'ranking' function gets access to an s and a w, but can modify neither.mtlA combination of an 'outer' ;, WriterT and StateT%. In short, you get a value of type r which can influence what gets picked, but not how anything is ranked, and the 'ranking' function gets access to an s and a w, but can modify neither.mtl'Readerizes' the writer: the 'ranking' function can see the value that's been accumulated (of type w), but can't add anything to the log. Effectively, can be thought of as 'extending' the 'ranking' by all values of w, but which w gets given to any rank calls is predetermined by the 'outer writer' (and cannot change).mtl'Readerizes' the writer: the 'ranking' function can see the value that's been accumulated (of type w), but can't add anything to the log. Effectively, can be thought of as 'extending' the 'ranking' by all values of w, but which w gets given to any rank calls is predetermined by the 'outer writer' (and cannot change).mtl'Readerizes' the writer: the 'ranking' function can see the value that's been accumulated (of type w), but can't add anything to the log. Effectively, can be thought of as 'extending' the 'ranking' by all values of w, but which w gets given to any rank calls is predetermined by the 'outer writer' (and cannot change).mtl3'Readerizes' the state: the 'ranking' function can see a value of type s, but not modify it. Effectively, can be thought of as 'extending' the 'ranking' by all values in s, but which s gets given to any rank calls is predetermined by the 'outer state' (and cannot change).mtl3'Readerizes' the state: the 'ranking' function can see a value of type s, but not modify it. Effectively, can be thought of as 'extending' the 'ranking' by all values in s, but which s gets given to any rank calls is predetermined by the 'outer state' (and cannot change).mtl)Provides a read-only environment of type r to the 'strategy' function. However, the 'ranking' function (or more accurately, representation) has no access to r. Put another way, you can influence what values get chosen by changing r#, but not how solutions are ranked.mtlmtl*'Extends' the possibilities considered by m to include every value of e9; this means that the potential result could be either a  (making it a choice of type e) or a  (making it a choice of type a).mtlThe continuation describes a way of choosing a 'search' or 'ranking' strategy for r, based on a 'ranking' using r' , given any a'. We then get a 'search' strategy for r.mtl*'Extends' the possibilities considered by m to include ; this means that $ gains a 'rank' (namely, a value of r+), and the potential result could also be .(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)Safe>< mtl%Minimal definition is either both of get and put or just statemtl1Return the state from the internals of the monad.mtl#Replace the state inside the monad.mtl+Embed a simple state action into the monad.mtlMonadic state transformer.Maps an old state to a new state inside a state monad. The old state is thrown away.  Main> :t modify ((+1) :: Int -> Int) modify (...) :: (MonadState Int a) => a ()This says that  modify (+1)1 acts over any Monad that is a member of the  MonadState class, with an Int state.mtl A variant of 6 in which the computation is strict in the new state.mtlGets specific component of the state, using a projection function supplied.mtlmtlmtlmtlmtl(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimentalportableSafe=(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)Safe> !"%$#"! %$#(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)Safe?&'()*+,-./210/.-,+*210)('&(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)SafeA<&'()*+,-./210(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology 2001, (c) Jeff Newbern 2003-2007, (c) Andriy Palamarchuk 2007 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)SafeB345678;:98765;:943(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)Safe>H mtl (a,w) embeds a simple writer action.mtl w' is an action that produces the output w.mtl m' is an action that executes the action m6 and adds its output to the value of the computation.mtl m' is an action that executes the action m, which returns a value and a function, and returns the value, applying the function to the output.mtl 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 = liftM (id *** f) ( m)mtl 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 =  (liftM (\x -> (x,f)) m)mtl"There are two valid instances for . It could either: !Lift the operations to the inner  MonadWriter%Handle the operations itself,  la a WriterT.Kmtlmtl(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)SafeL=&<=>?@ABCDEFIHGFEDCBA@IHG?>=<(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)SafeM&JKLMNOPQRSTWVUTSRQPONWVUMLKJ(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)SafeN&JKLMNOPQRSTWVU (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)SafeP%XYZ[\]^_`abcd cba`_^]d\[ZYX(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)SafeQ]   (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)SafeR (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001 BSD-style (see the file LICENSE)libraries@haskell.org experimental;non-portable (multi-param classes, functional dependencies)SafeS!"#!"$!"%!"&!"'!"(!")!"*!"*!+#!+$!+%!+&!+'!+(!+)!+*!+*!,#!,$!,%!,&!,'!,(!,*!-.!-/!-0!-1!-2!-3!-4!-5!-6!-7!-8!-9!-9!:.!:/!:0!:1!:2!:3!:4!:5!:6!:7!:8!:9!:9!;<!;=!;>!;?!;@!;A!;B!;C!;C!DE!DF!DG!DH!DI!DJ!DK!DL!DM!DN!DO!DP!DQ!DQ!RE!RF!RG!RH!RI!RJ!RK!RL!RM!RN!RO!RP!RQ!RQ!SE!SF!SG!SH!SP!SI!SJ!SK!SL!SM!SN!SO!SQ!TU!TV!TW!TX!TY!TZ!T[!T\!T]!T^!T_!T_ ` ` 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 { | } ~                                  !!!!!!!!!!mtl-2.3-IjBuCES7UyO2T1FiKOw7DBControl.Monad.Writer.StrictControl.Monad.Writer.LazyControl.Monad.Writer.CPSControl.Monad.State.StrictControl.Monad.State.LazyControl.Monad.ReaderControl.Monad.RWS.StrictControl.Monad.RWS.LazyControl.Monad.RWS.CPSControl.Monad.ContControl.Monad.AccumControl.Monad.Cont.ClassControl.Monad.Error.ClassControl.Monad.Reader.ClassControl.Monad.SelectControl.Monad.State.ClassControl.Monad.Writer.ClassControl.Monad.RWS.Class MonadState MonadWritertell throwError catchErrorControl.Monad.ExceptExceptControl.ExceptiontryControl.Monad.IdentityControl.Monad.TransControl.Monad.StateControl.Monad.RWSControl.Monad.Writertransformers-0.5.6.2!Control.Monad.Trans.Writer.Strict mapWriterT execWriterT mapWriter execWriter runWriterWriter runWriterTWriterTControl.Monad.Trans.Writer.LazyControl.Monad.Trans.Writer.CPS Control.Monad.Trans.State.Strict withStateT mapStateT execStateT evalStateT withStatemapState execState evalStaterunStateState runStateTStateTControl.Monad.Trans.State.LazyControl.Monad.Trans.Reader withReaderT mapReaderT withReader mapReader runReaderReader runReaderTReaderTControl.Monad.Trans.RWS.StrictwithRWSTmapRWSTexecRWSTevalRWSTwithRWSmapRWSexecRWSevalRWSrunRWSrwsRWSrunRWSTRWSTControl.Monad.Trans.RWS.LazyControl.Monad.Trans.RWS.CPSControl.Monad.Trans.Cont withContTmapContT evalContTwithContmapContevalContrunContcontContrunContTContT LiftingAccum MonadAccumlookaddaccumlooks$fMonadAccumwAccumT$fMonadAccumwLiftingAccum$fFunctorLiftingAccum$fApplicativeLiftingAccum$fMonadLiftingAccum$fMonadAccumw'WriterT$fMonadAccumw'WriterT0$fMonadAccumw'WriterT1$fMonadAccumwStateT$fMonadAccumwStateT0$fMonadAccumwSelectT$fMonadAccumwReaderT$fMonadAccumw'RWST$fMonadAccumw'RWST0$fMonadAccumw'RWST1$fMonadAccumwIdentityT$fMonadAccumwExceptT$fMonadAccumwContT$fMonadAccumwMaybeT MonadContcallCC$fMonadContAccumT$fMonadContWriterT$fMonadContRWST$fMonadContWriterT0$fMonadContWriterT1$fMonadContStateT$fMonadContStateT0$fMonadContRWST0$fMonadContRWST1$fMonadContReaderT$fMonadContMaybeT$fMonadContIdentityT$fMonadContExceptT$fMonadContContT MonadError liftEithertryError withError handleErrormapError$fMonadErroreAccumT$fMonadErroreWriterT$fMonadErroreRWST$fMonadErroreWriterT0$fMonadErroreWriterT1$fMonadErroreStateT$fMonadErroreStateT0$fMonadErroreRWST0$fMonadErroreRWST1$fMonadErroreReaderT$fMonadErroreMaybeT$fMonadErroreIdentityT$fMonadErroreExceptT$fMonadErroreEither$fMonadError()Maybe$fMonadErrorIOExceptionIO MonadReaderasklocalreaderasks$fMonadReaderr'SelectT$fMonadReaderrAccumT$fMonadReaderrWriterT$fMonadReaderrWriterT0$fMonadReaderrWriterT1$fMonadReaderrStateT$fMonadReaderrStateT0$fMonadReaderrMaybeT$fMonadReaderrIdentityT$fMonadReaderrExceptT$fMonadReaderr'ContT$fMonadReaderrRWST$fMonadReaderrRWST0$fMonadReaderrRWST1$fMonadReaderrReaderT$fMonadReaderr-> LiftingSelect MonadSelectselect$fMonadSelectrSelectT$fMonadSelectrLiftingSelect$fFunctorLiftingSelect$fApplicativeLiftingSelect$fMonadLiftingSelect$fMonadSelectrAccumT$fMonadSelectw'RWST$fMonadSelectw'RWST0$fMonadSelectw'RWST1$fMonadSelectw'WriterT$fMonadSelectw'WriterT0$fMonadSelectw'WriterT1$fMonadSelectwStateT$fMonadSelectwStateT0$fMonadSelectr'ReaderT$fMonadSelectrIdentityT$fMonadSelectrExceptT$fMonadSelectr'ContT$fMonadSelectrMaybeTgetputstatemodifymodify'gets$fMonadStatesSelectT$fMonadStatesAccumT$fMonadStatesWriterT$fMonadStatesWriterT0$fMonadStatesWriterT1$fMonadStatesReaderT$fMonadStatesMaybeT$fMonadStatesIdentityT$fMonadStatesExceptT$fMonadStatesContT$fMonadStatesRWST$fMonadStatesRWST0$fMonadStatesRWST1$fMonadStatesStateT$fMonadStatesStateT0writerlistenpasslistenscensor$fMonadWriterwAccumT$fMonadWriterwStateT$fMonadWriterwStateT0$fMonadWriterwReaderT$fMonadWriterwMaybeT$fMonadWriterwIdentityT$fMonadWriterwExceptT$fMonadWriterwRWST$fMonadWriterwRWST0$fMonadWriterwRWST1$fMonadWriterwWriterT$fMonadWriterwWriterT0$fMonadWriterwWriterT1$fMonadWriterw(,)MonadRWS$fMonadRWSrwsMaybeT$fMonadRWSrwsIdentityT$fMonadRWSrwsExceptT$fMonadRWSrwsRWST$fMonadRWSrwsRWST0$fMonadRWSrwsRWST1Control.Monad.Trans.ExceptExceptTbaseGHC.Base<>constmemptypure*>$>>= Data.Functor$> Data.EitherEitherGHC.IOcatchData.Functor.IdentityIdentity runIdentityControl.Monad.Trans.Identity liftCatch liftCallCC mapIdentityT IdentityT runIdentityTLeftRight GHC.MaybeNothingControl.Monad.IO.ClassMonadIOliftIOControl.Monad.Trans.Class MonadTransliftControl.Monad.Trans.AccumAccumT