h&faи      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                       (c) 2021 Xy RenBSD3xy.r@outlook.comunstablenon-portable (GHC only)None$&'(+-./<=>? cleffCoerce any boxed value into . cleffCoerce  to a boxed value. This is generally unsafe and it is your responsibility to ensure that the type you're coercing into is the original type that the  is coerced from.  (c) 2021 Xy RenBSD3xy.r@outlook.comunstablenon-portable (GHC only)None$&'(+-./<=>?T cleffxs   es means the list of effects xs% are all present in the effect stack es'. This is a convenient type alias for (e1   es, ..., en   es). cleffe   es means the effect e is present in the effect stack es#, and therefore can be used in an  es computation. cleffThe type of effects. An effect e m a takes an effect monad type m ::  ->  and a result type a :: .   0 0(c) 2021 Xy RenBSD3xy.r@outlook.comunstablenon-portable (GHC only)None%&'(+-./<=>?Ucleff A pointer to  in an .cleffThe effect environment; that corresponds effects in the stack to their respective s. This structure simulates memory: handlers are retrieved via pointers (s), and for each effect in the stack we can either change what pointer it uses or change the handler the pointer points to. The former is used for global effect interpretation (+) and the latter for local interpretation () in order to retain correct HO semantics. For more details on this see  (https://github.com/re-xyr/cleff/issues/5.cleff%The extensible effect monad. A monad  es, is capable of performing any effect in the  effect stack es, which is a type-level list that holds all effects available. However, most of the times, for flexibility, es should be a polymorphic type variable, and you should use the   and   operators in constraints to indicate what effects are in the stack. For example,      es,      es =>  es  (allows you to perform operations of the    effect and the   ' effect in a computation returning an .cleff0The effect monad receives an effect environment 3 that contains all effect handlers and produces an  action.cleffThe internal representation of effect handlers. This is just a natural transformation from the effect type e ( es) to the effect monad  es for any effect stack es.In interpreting functions (see Cleff.Internal.Interpret), the user-facing % type is transformed into this type.cleffCreate an empty  with no address allocated.cleff-Adjust the effect stack via an function over .cleff-Allocate a new, empty address for a handler.  O(1) .cleff&Read the handler a pointer points to.  O(1) .cleff+Overwrite the handler a pointer points to.  O(1) .cleff7Replace the handler pointer of an effect in the stack.  O(n) .cleffAdd a new effect to the stack with its corresponding handler pointer.  O(n) .cleff1Use the state of LHS as a newer version for RHS.  O(1) .cleffPerform an effect operation, i.e. a value of an effect type e ::  . This requires e to be in the effect stack.cleffPerform an action in another effect stack via a transformation to that stack; in other words, this function "maps" the effect operation from effect stack es to es'. This is a generalization of 0; end users most likely won't need to use this.  =   cleff  (handler ::  E) == "Handler E" 'cleffPointer equality.(cleff)An arbitrary total order on the pointers.(c) 2021 Xy RenBSD3xy.r@outlook.comunstablenon-portable (GHC only)None&&'(+-./<=>?'-)cleff9The type of a simple transformation function from effect e to e'.*cleffThe type of an effect handler0, which is a function that transforms an effect e from an arbitrary effect stack into computations in the effect stack es.+cleffYou should not define instances for this typeclass whatsoever.,cleffAdjust the effect stack by a contravariant transformation function over the stack. This function reveals the profunctorial nature of ; in particular,  is a profunctor [ ] -> , lmap is ,, and rmap is .-cleffLift a computation into a bigger effect stack with one more effect. For a more general version see ...cleffLift a computation into a bigger effect stack with arbitrarily more effects. This function requires TypeApplications./cleffLike -, but adds the new effect under the top effect. This is useful for transforming an interpreter e'   es =>  (e ': es)   es into a reinterpreter  (e ': es)   (e' ': es): myInterpreter :: Bar   es =>  (Foo ': es)  , es myInterpreter = ... myReinterpreter ::  (Foo ': es)  - (Bar ': es) myReinterpreter = myInterpreter  / In other words, 8 h == 7 h . / However, note that this function is suited for transforming an existing interpreter into a reinterpreter; if you want to define a reinterpreter from scratch, you should still prefer 82, which is both easier to use and more efficient.0cleffLike /, but allows introducing multiple effects. This function requires TypeApplications.1cleffLike /, but allows introducing the effect under multiple effects. This function requires TypeApplications.2cleffA generalization of both 1 and 0, allowing introducing multiple effects under multiple effects. This function requires TypeApplications and is subject to serious type ambiguity; you most likely will need to supply all three type variables explicitly.3cleffLift a computation with a fixed, known effect stack into some superset of the stack.4cleffEliminate a duplicate effect from the top of the effect stack. For a more general version see 5.5cleffEliminate several duplicate effects from the top of the effect stack. This function requires TypeApplications.6cleffGet the send-site .7cleffInterpret an effect e) in terms of effects in the effect stack es with an effect handler.8cleffLike 7, but adds a new effect e'! that can be used in the handler.9cleffLike 8, but adds two new effects.:cleffLike 8, but adds three new effects.;cleffLike 8, but adds arbitrarily many new effects. This function requires TypeApplications.<cleffRespond to an effect while being able to leave it unhandled (i.e. you can resend the effects in the handler).=cleffLike <?, but allows to introduce one new effect to use in the handler.>cleffLike =, but allows introducing arbitrarily many effects. This requires TypeApplications.?cleffInterpret an effect in terms of another effect in the stack via a simple ). ? trans = 7 ( A  trans) @cleffLike ?, but instead of using an effect in stack, add a new one to the top of it. @ trans = 8 ( A  trans) AcleffRun a computation in the current effect stack. This is useful for interpreting higher-order effects, like a bracketing effect: data Resource m a where Bracket :: m a -> (a -> m ()) -> (a -> m b) -> Resource m b Bracket alloc dealloc use ->  (A alloc) (A . dealloc) (A . use) BcleffRun a computation in the current effect stack, but handles the current effect inside the computation differently by providing a new *. This is useful for interpreting effects with local contexts, like  : runReader :: r ->  (  r ': es)   es runReader x = 7' (handle x) where handle :: r -> * ( " r) es handle r = \case   ->  r   f m -> B (handle $ f r) m Ccleff*Temporarily gain the ability to lift some  es actions into  esSend. This is useful for dealing with effect operations with the monad type in the negative position, which means it's unlikely that you need to use this function in implementing your effects.)*+,-./0123456789:;<=>?@ABC,-.345/012+6*)789:;<=>?@ABC(c) 2021 Xy RenBSD3xy.r@outlook.comunstablenon-portable (GHC only)None%&'(+-./<=>?3I DcleffThe type of an  effect handler0, which is a function that transforms an effect e into ! computations. This is used for K.Ecleff)The effect for lifting and unlifting the  monad, allowing you to use , , , ,  and  functionalities. This is the "final" effect that most effects eventually are interpreted into. For example, you can do: log :: E :> es =>  es () log =  ( "Test logging") It is not recommended to use this effect in application code, as it is too liberal and allows arbitrary IO. Ideally, this is only used in interpreting more fine-grained effects.Note that this is not< a real effect and cannot be interpreted in any way besides H and I. It is similar to Polysemy's Final effect which also cannot be interpreted. This is mainly for performance concern, but also that there doesn't really exist reasonable interpretations other than the current one, given the underlying implementation of the  monad.E5 can be a real effect though, and you can enable the  dynamic-ioe build flag to have that. However it is only for reference purposes and should not be used in production code.FcleffLift an  computation into . This function is  highly unsafe& and should not be used directly; use ? instead, or if you're interpreting higher-order effects, use M.Gcleff$Give a runner function a way to run  actions as an  computation. This function is  highly unsafe' and should not be used directly; use ? instead, or if you're interpreting higher-order effects, use L.HcleffUnsafely eliminate an E effect from the top of the effect stack. This is mainly for implementing effects that uses ! but does not do anything really impure (i.e. can be safely used  on), such as a State effect.Icleff Unwrap an ' computation with side effects into an 0 computation, given that all effects other than E are interpreted.JcleffUnwrap a pure  computation into a pure value, given that all effects are interpreted.Kcleff Interpret an effect in terms of !, by transforming an effect into  computations. K f = 7 (  f) Lcleff*Temporarily gain the ability to unlift an  esSend computation into . This is useful for dealing with higher-order effects that involves .McleffLift an  computation into  esSend. This is useful for dealing with effect operations with the monad type in the negative position within , like ing.OcleffCompatibility instance; use  if possible.PcleffCompatibility instance; use  if possible. DEFGHIJKLM EFGHIJDKLM(c) 2021 Xy RenBSD3xy.r@outlook.comunstablenon-portable (GHC only)None%&'(+-./<=>?9pVcleffFor a datatype T representing an effect, V T generates functions defintions for performing the operations of T via . The naming rule is changing the first uppercase letter in the constructor name to lowercase or removing the : symbol in the case of operator constructors. Also, this function will preserve any fixity declarations defined on the constructors.Because of the limitations of Template Haskell, all constructors of T should be polymorphic in the monad type, if they are to be used by V. For example, this is not OK: data Limited ::   where Noop :: Limited ( es) () because the monad type  es* is not a fully polymorphic type variable.$This function is also "weaker" than polysemy's makeSem, because this function cannot properly handle some cases involving complex higher order effects. Those cases are rare, though. See the tests for more details.WcleffLike V, but doesn't generate type signatures. This is useful when you want to attach Haddock documentation to the function signature, e.g.: data Identity ::   where Noop :: Identity m () W; ''Identity -- | Perform nothing at all. noop :: Identity   es =>  es () 6Be careful that the function signatures must be added after the W call.VWVW(c) 2021 Xy RenBSD3xy.r@outlook.com experimentalnon-portable (GHC only) Trustworthy$&'(+-./<=>?:0 )*+-./012345789:;<=>?@ABCDEIJKLMVW0 EJIVW-.345*789:;<=>DK)?@/012+ABCLM(c) 2021 Xy RenBSD3xy.r@outlook.com experimentalnon-portable (GHC only) Trustworthy%&'(+-./<=>?DGXcleffAn effect capable of breaking out of current control flow by raising an exceptional value e*. This effect roughly corresponds to the  MonadError typeclass and ExceptT monad transformer in mtl.]cleffLift an  value into the X effect.^cleff Lift exceptions generated by an  computation into the X effect._cleffLike ^, but allows to transform the exception into another error type.`cleff Lift exceptions generated by an  computation into the X effect.acleffLike `, but allows to transform the exception into another error type.bcleffTry to extract a value from , throw an error otherwise.ccleff A variant of [5 that allows a predicate to choose whether to catch () or rethrow ( ) the error.dcleff A variant of [5 that allows a predicate to choose whether to catch () or rethrow ( ) the error.ecleffFlipped version of [.fcleffFlipped version of c.gcleffFlipped version of d.hcleff Runs a computation, returning a  value if an error was thrown.icleff A variant of h5 that allows a predicate to choose whether to catch () or rethrow ( ) the error.jcleffRun an X effect.Caveat: j is implemented with s therefore inherits some of its unexpected behaviors. Errors thrown in forked threads will not be directly caught by [s in the parent thread. Instead it will incur an exception, and we won't be quite able to display the details of that exception properly at that point. Therefore please properly handle the errors in the forked threads separately.However if you use async and wait for the action in the same effect scope (i.e. they get to be interpreted by the same j handler), the error will be caught in the parent thread even if you don't deal with it in the forked thread. But if you passed the Async# value out of the effect scope and waited for it elsewhere, the error will again not be caught. The best choice is  not to pass Async values around randomly.kcleff Transform an X into another. This is useful for aggregating multiple errors into one type.XZY[\]^_`abcdefghijkXZY\[]^_`abcdefghijk(c) 2021 Xy RenBSD3xy.r@outlook.com experimentalnon-portable (GHC only) Trustworthy$&'(+-./<=>?FncleffAn effect that expresses failure with a message. This effect allows the use of the  class.pcleffRun a n effect in terms of X.qcleffRun a n+ effect in terms of throwing exceptions in .nopqnopq(c) 2021 Xy RenBSD3xy.r@outlook.com experimentalnon-portable (GHC only) Trustworthy$&'(+-./<=>?IKscleffAn effect capable of ing and specifically, ing operations, i.e.= allowing cleanup after operations that my raise exceptions.|cleff Variant of {, that does not provide a restoring function.}cleff Variant of z, that does not provide a restoring function.~cleff Variant of y that does not pass the allocated resource to the cleanup action.cleffAttach a cleanup action that will always run to a potentially throwing computation.cleffAttach an action that runs if the main computation throws an exception.cleffInterpret the s effect in terms of primitive  actions.stuvwxyz{|}~stuvw{zyx|}~ (c) 2021 Xy RenBSD3xy.r@outlook.com experimentalnon-portable (GHC only) Trustworthy$&'(+-./<=>?Kcleff8An effect capable of providing an immutable environment r4 that can be read. This roughly corresponds to the  MonadReader typeclass and ReaderT monad transformer in the mtl approach.cleff"Apply a function on the result of .cleffRun a ' effect with a given environment value.cleffRun a  effect in terms of a larger  via a . (c) 2021 Xy RenBSD3xy.r@outlook.com experimentalnon-portable (GHC only) Trustworthy$&'(+-./<=>?Qcleff/An effect capable of providing a mutable state s that can be read and written. This roughly corresponds to the  MonadState typeclass and StateT monad transformer in the mtl approach.cleff"Apply a function to the result of .cleff-Modify the value of the state via a function.cleffRun the  effect.Caveat: The ! interpreter is implemented with  s and there is no way to do arbitrary atomic transactions. The 7 operation is atomic though and it is implemented with , which can be faster than atomicModifyIORef in contention. For any more complicated cases of atomicity, please build your own effect that uses either MVars or TVars based on your need.Unlike mtl, in cleff the state will not revert when an error is thrown. will stop taking care of state operations done on forked threads as soon as the main thread finishes its computation. Any state operation done before main thread finishes is still taken into account.cleffRun a  effect in terms of a larger  via a .   (c) 2021 Xy RenBSD3xy.r@outlook.com experimentalnon-portable (GHC only) Trustworthy$&'(+-./<=>?SmcleffAn effect that is capable of reading from some input source, such as an input stream.cleff"Apply a function to the result of .cleffRun an ) effect by giving a constant input value.cleffRun an * effect by going through a list of values.cleffRun an ; effect by performing a computation for each input request. (c) 2021 Xy RenBSD3xy.r@outlook.com experimentalnon-portable (GHC only) Trustworthy$&'(+-./<=>?U@cleffAn effect capable of generating unique values. This effect can be useful in generating variable indices.cleff Interpret a   effect in terms of  .cleff Interpret a   effect in terms of IO actions. (c) 2021 Xy RenBSD3xy.r@outlook.com experimentalnon-portable (GHC only) Trustworthy$&'(+-./<=>?\cleffAn effect capable of accumulating outputs. This roughly corresponds to the  MonadWriter typeclass and WriterT monad transformer in the mtl approach.(However, note that this does not have a pass operation as we are not sure what its semantics should be. In fact, the pass semantics in mtl is also unclear and will change when handlers are put in different orders. To avoid any confusion we decided it is best that we don't include it because no one seems to be relying on it anyway.cleff.Apply a function to the accumulated output of .cleffRun a monoidal  effect.Caveat: Both  and s under  will stop taking care of writer operations done on forked threads as soon as the main thread finishes its computation. Any writer operation done before main thread finishes is still taken into account.cleffRun a monoidal  effect, but appends the listened output to the parent value only when the listen operation finishes. This means that when you run two s on two threads, the values ed inside will not be appended to the parent value in real time, but only after the thread finishes ing. For example, this code ! (   "1"   "2"   "3") (   "4"   "5"   "6") will produce either "123456" or "456123" with 2, but may produce these digits in any order with ./This version of interpreter can be faster than  in 0-intense code. It is subject to all caveats of .(c) 2021 Xy RenBSD3xy.r@outlook.com experimentalnon-portable (GHC only) Trustworthy$&'(+-./<=>?^cleffAn effect that is capable of sending outputs, for example to a log file or an output stream.cleffRun an  effect by accumulating a list.cleffRun an ! effect by translating it into a .cleffIgnore outputs of an  effect altogether.cleffRun an 4 effect by performing a computation for each output.(c) 2021 Xy RenBSD3xy.r@outlook.com experimentalnon-portable (GHC only) Trustworthy$&'(+-./<=>?aGcleffAn effect capable of logging messages, mostly for debugging purposes.cleffRun the  effect by writing to a .cleffRun the  effect by writing to .cleffRun the  effect by writing to .cleffRun the + effect by ignoring all outputs altogether.cleffTransform the  effect into an   effect."None%&'(+-./<=>?a#$%&'(&')*+,*+-*+.*+/012013456789:;<<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                       #$&#$#$*+&&&&&&&&&&&#$#$&&&#$&&&&&&""""""""cleff-0.2.0.0-inplaceCleff.Internal.AnyCleffCleff.Internal.MonadCleff.Internal.InterpretCleff.Internal.Base Cleff.Error Cleff.Fail Cleff.Mask Cleff.Reader Cleff.State Cleff.Input Cleff.Fresh Cleff.Writer Cleff.Output Cleff.TraceCleff.Internal.EffectEff reinterpretN toEffWithReaderStateHandler Data.KindTypeUnliftIObracketLocalAskIOECleff.Internal.TH Data.IORefIORef concurrently_ Paths_cleffghc-prim GHC.TypesAnybaseControl.Monad.IO.ClassliftIOMonadIOrec-smallarray-0.1.0.0-e2041873836fced6be1b59bbe77e6999a54b5580d98e0b9559bee7138c51c681Data.Rec.SmallArray++ KnownListSubset~>unliftio-core-0.2.0.1-e01f5ed3511cc7eceebc04c6d661c9994774650ec89a07c164849d97f27e61f8Control.Monad.IO.Unlift withRunInIO MonadUnliftIOtoAnyfromAny:>>:>Effect HandlerPtrEnvunEffInternalHandler runHandleremptyEnv adjustEnv allocaEnvreadEnvwriteEnv replaceEnv appendEnv updateEnvsendsendVia$fShowInternalHandler$fSemigroupEff $fMonoidEff $fFunctorEff$fApplicativeEff $fMonadEff $fMonadFixEff$fEqHandlerPtr$fOrdHandlerPtr TranslatorHandlingadjustraiseraiseN raiseUnder raiseNUnder raiseUnderN raiseNUnderNinjectsubsumesubsumeNesSend interpret reinterpret reinterpret2 reinterpret3 interposeimposeimposeN transform translatetoEff withFromEff HandlerIO primLiftIO primUnliftIOthisIsPureTrustMerunIOErunPure interpretIOwithToIOfromIO$fPrimMonadEff$fMonadBaseControlIOEff$fMonadBaseIOEff$fMonadMaskEff$fMonadCatchEff$fMonadThrowEff$fMonadUnliftIOEff $fMonadIOEff makeEffect makeEffect_Error ThrowError CatchError catchError throwError fromEither fromExceptionfromExceptionViafromExceptionEfffromExceptionEffVianotecatchErrorJust catchErrorIf handleErrorhandleErrorJust handleErrorIftryError tryErrorJustrunErrormapError$fShowErrorExc$fExceptionErrorExcFailrunFail runFailIO$fMonadFailEffMaskUninterruptibleMaskBracketBracketOnErrorbracketOnErroruninterruptibleMaskmaskmask_uninterruptibleMask_bracket_finallyonErrorrunMasklocalaskasks runReadermagnifyGetPutstateputgetgetsmodifyrunStatezoomInputinputinputs runInputConstinputToListState runInputEffFreshfreshfreshIntToStaterunFreshUniqueWriterTellListenlistentelllistens runWriterrunWriterBatchOutputoutputoutputToListStateoutputToWriter ignoreOutput runOutputEffTracetracerunTraceHandlerunTraceStdoutrunTraceStderr ignoreTrace traceToOutputGHC.BaseStringBoolinteger-wired-inGHC.Integer.TypeIntegerIORecidGHC.Showshowfmap.pureprimitive-0.7.3.0-ab8104f4a6c5bcace27e4a385271dc96d2186f34c091b7c80bfd9bcc6b69faa5Control.Monad.Primitive PrimMonadexceptions-0.10.4Control.Monad.Catch MonadCatch MonadThrow MonadMask System.IOputStrLn GHC.IO.UnsafeunsafeDupablePerformIOunliftio-0.2.20.1-42a8c4186fc60b82c86270fec5ab1031f28e3286907b0ed4370be6f9119ac91dUnliftIO.Exception Data.EitherEither GHC.MaybeMaybeJustNothingTrueFalseLeftGHC.Exception.Type ExceptionControl.Monad.Fail MonadFailmicrolens-0.4.12.0-556412785a6d87023ef2a172dca6dae6480b8d0138d42e9e8b02752ae0ea58dcLens.Micro.TypeLens'atomic-primops-0.8.4-fb800de0513e4ae397d0192bad27b80bfb3cf03afb8816497bd483676969ec91 Data.AtomicsatomicModifyIORefCASInt Data.UniqueUnique$>>GHC.IO.Handle.TypesHandleGHC.IO.Handle.FDstdoutstderrversiongetDataFileName getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDir