!.      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                        !"#$%&'()*+,-None!%&',-.14567=>?@ACHMPSUVX_k extensible-effects-concurrentCatch . thrown by an effect.extensible-effects-concurrentVery similar to / but for 0 s. Unlike 14 this will throw the given value (instead of using 2).3415/6789:;<=>?2None!%&',-.14567=>?@ACHMPSUVX_k_extensible-effects-concurrentuThis effect sends log messages. The logs are not sent one-by-one, but always in batches of containers that must be @ and A* instances. Log messages are consumed by s installed via # or more high level functions like  .extensible-effects-concurrentNA constraint that combines constraints for logging into any log writer monad.extensible-effects-concurrentType alias for the B effect that writes logsextensible-effects-concurrent@A function that takes a log message and returns an effect that logs the message.extensible-effects-concurrent>Log a message. The message is reduced to normal form (strict).extensible-effects-concurrentCLog a bunch of messages. This might be more efficient than calling D multiple times. The messages are reduced to normal form (strict).extensible-effects-concurrent&Map a pure function over log messages.extensible-effects-concurrent6Keep only those messages, for which a predicate holds.,E.g. to keep only messages which begin with OMG: filterLogMessages (\msg -> case msg of 'O':'M':'G':_ -> True _ -> False) (do logMsg "this message will not be logged" logMsg "OMG logged")extensible-effects-concurrentMap an C1ectful function over every bunch of log messages.<For example, to attach the current time to each log message: appendTimestamp :: ( Member (Logs String) e , Lifted IO e) => Eff e a -> Eff e a appendTimestamp = traverseLogMessages $ \ms -> do now <- getCurrentTime return (fmap (show now ++) ms)extensible-effects-concurrentBChange the way log messages are *written*. Replaces the existing  by a new one. The new - is constructed from a function that gets a bunch of messages and returns an Cect. That effect has a B for the previous  and Ds the log writer base monad.extensible-effects-concurrentThrow away all log messages.extensible-effects-concurrentTrace all log messages using E%. The message value is converted to F using the given function.extensible-effects-concurrent Create a # from a function that can write a @ container.extensible-effects-concurrentEfficiently apply the  to a @ container of log messages.extensible-effects-concurrent Create a  from a function that is applied to each individual log message. NOTE: This is probably the simplest, but also the most inefficient and annoying way to make a  . Better use  or even .extensible-effects-concurrent Create a  from a function that is applied to each individual log message. Don't be scared by the type signature, here is an example file appender that re-opens the log file everytime a bunch of log messages are written: fileAppender fn = multiMessageLogWriter (\writeLogMessageWith -> withFile fn AppendMode (writeLogMessageWith . hPutStrLn))extensible-effects-concurrentGet the current Gextensible-effects-concurrentInstall  handler that Hs for a B for the message type and applies the log writer to the messages.extensible-effects-concurrentInstall  handler that Hs for a B for the message type and applies the log writer to the messages. extensible-effects-concurrentHandle log message effects by a monadic action, e.g. an IO action to send logs to the console output or a log-server. The monadic log writer action is wrapped in a newtype called .7Use the smart constructors below to create them, e.g. ,  or mulitMessageLogWriter.Iextensible-effects-concurrentHandle log message effects by a monadic action, e.g. an IO action to send logs to the console output or a log-server. The monadic log writer action is wrapped in a newtype called .7Use the smart constructors below to create them, e.g. ,  or mulitMessageLogWriter.%extensible-effects-concurrent%This instance allows liftings of the " effect, but only, if there is a  in effect.  None!%&',-.14567=>?@ACHMPSUVX_kw#&extensible-effects-concurrent&A log channel processes logs from the y effect by en-queuing them in a shared queue read from a seperate processes. A channel can contain log message filters.Jextensible-effects-concurrent&send all log messages to a log process'extensible-effects-concurrent_Fork a new process in which the given log message writer, will listen on a message queue in a &q, which is passed to the second function. If the function returns or throws, the logging process will be killed.Log messages are deeply evaluated before being sent to the logger process, to prevent that lazy evaluation leads to heavy work being done in the logger process instead of the caller process.*Example usage, a super stupid log to file:  main = withAsyncLogChannel 1000 (singleMessageLogWriter putStrLn) (handleLoggingAndIO (do logMsg "test 1" logMsg "test 2" logMsg "test 3")) (extensible-effects-concurrent/Fork an IO based log writer thread and set the l to an action that will send all logs to that thread via a bounded queue. When the queue is full, flush it)extensible-effects-concurrentLike ( but return ().'extensible-effects-concurrentYSize of the log message input queue. If the queue is full, message are dropped silently.extensible-effects-concurrent&An IO action to write the log messages&'()&'()None!%&',-.14567=>?@ACHMPSUVX_kd *extensible-effects-concurrentAn rfc 5424 facility,extensible-effects-concurrentAn rfc 5424 severityKextensible-effects-concurrentComponent of a ..extensible-effects-concurrentFRFC-5424 defines how structured data can be included in a log message.2extensible-effects-concurrent>A convenient alias for the constraints that enable logging of 3s in the monad, which is Ded into a given Eff effect list.3extensible-effects-concurrent<A message data type inspired by the RFC-5424 Syslog ProtocolAextensible-effects-concurrentA  that applys B. to the log message and then traces it using E.Bextensible-effects-concurrent Render a 3 human readable.Cextensible-effects-concurrent Render a 3\ according to the rules in the given RFC, except for the rules concerning unicode and asciiiextensible-effects-concurrent2Put the source location of the given callstack in ejextensible-effects-concurrent Render a 3, but set the timestamp and thread id fields.kextensible-effects-concurrentPSet a timestamp (if not set), the thread id (if not set) using IO actions then write the log message using the L and F based .lextensible-effects-concurrentUse k to handle logging using  handleLogs.mextensible-effects-concurrent1An IO action that sets the current UTC time (see enableLogMessageTimestamps) in h.nextensible-effects-concurrentAn IO action appends the the M of the calling process (see N) to a.oextensible-effects-concurrent Increase the distanceF of log messages by one. Logs can be filtered by their distance with ppextensible-effects-concurrentDrop all log messages with an ^ greater than the given value.qextensible-effects-concurrentLog a F as 3 with a given ,.rextensible-effects-concurrentLog a F as .sextensible-effects-concurrentLog a message with .textensible-effects-concurrentLog a  message.uextensible-effects-concurrentLog a  message.vextensible-effects-concurrentLog a  message.wextensible-effects-concurrentLog a  message.xextensible-effects-concurrentLog a  message.yextensible-effects-concurrentLog a  message.zextensible-effects-concurrent Construct a 3 with {extensible-effects-concurrent Construct a 3 with |extensible-effects-concurrent Construct a 3 with }extensible-effects-concurrent Construct a 3 with ~extensible-effects-concurrent Construct a 3 with extensible-effects-concurrent Construct a 3 with ^*+,-./0123456789:;<=>?@ABC[\]^_`abcdefghijklmnopqrstuvwxyz{|}~^3456789:;<=>?@2CjlkABopqrstuvwxyz{|}~,-*+_dh`]cbfega^imn./01[\None!%&',-.14567=>?@ACHMPSUVX_ku &'()*+,-./0123456789:;<=>?@ABC[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None"%&',-.14567=>?@ACHMPSUVX_kM{extensible-effects-concurrentEach process is identified by a single process id, that stays constant throughout the life cycle of a process. Also, message sending relies on these values to address messages to processes. extensible-effects-concurrentzA monitored process exited. This message is sent to a process by the scheduler, when a process that was monitored via a SchedulerCommand died. extensible-effects-concurrentBA value that contains a unique reference of a process monitoring.extensible-effects-concurrentAn existential wrapper around extensible-effects-concurrentThis adds a layer of the  effect ontop of extensible-effects-concurrent>eptions containing s. See ,  or extensible-effects-concurrent's which are recoverable are interrupts.extensible-effects-concurrentA sum-type with reasons for why a process exists the scheduling loop, this includes errors, that can occur when scheduleing messages. extensible-effects-concurrentA process has finished a unit of work and might exit or work on something else. This is primarily used for interupting infinite server loops, allowing for additional cleanup work before exitting (e.g. with )extensible-effects-concurrent1A process that should be running was not running.extensible-effects-concurrentA linked process is downextensible-effects-concurrent3An exit reason that has an error message but isn't .extensible-effects-concurrent8A process function returned or exited without any error.extensible-effects-concurrent An unhandled  allows .extensible-effects-concurrentOAn unexpected runtime exception was thrown, i.e. an exception derived from extensible-effects-concurrent)A process was cancelled (e.g. killed, in )extensible-effects-concurrentbThis value indicates wether a process exited in way consistent with the planned behaviour or not.extensible-effects-concurrent#This kind is used to indicate if a H can be treated like a short interrupt which can be handled or ignored.extensible-effects-concurrentThe state that a  is currently in.extensible-effects-concurrent4The process has just been started but not called  handleProcess yet.extensible-effects-concurrent"The process yielded it's timesliceextensible-effects-concurrent%The process is busy with non-blockingextensible-effects-concurrent*The process is busy with sending a messageextensible-effects-concurrent The process is busy with killingextensible-effects-concurrent The process is busy with killingextensible-effects-concurrentThe process blocked by a extensible-effects-concurrentThe process blocked by a 'extensible-effects-concurrentThe process blocked by a (extensible-effects-concurrentThe process blocked by a !extensible-effects-concurrentThe process blocked by a "extensible-effects-concurrentThe process was interruptedextensible-effects-concurrent#The process was shutdown or crashedextensible-effects-concurrentCons  onto a list of effects. extensible-effects-concurrentA constraint for the implicit  parameter. Use  to query it. _EXPERIMENTAL_extensible-effects-concurrentEvery function for a things needs such a proxy value for the low-level effect list, i.e. the effects identified by r in  r : r;, this might be dependent on the scheduler implementation.extensible-effects-concurrent0Tell the typechecker what effects we have below extensible-effects-concurrentLike  but shorterextensible-effects-concurrentLike  but differentextensible-effects-concurrentAA function that deciced if the next message will be received by %. It conveniently is an instance of O so the message selector can be combined: > > selectInt :: MessageSelector Int > selectInt = selectMessage > > selectString :: MessageSelector String > selectString = selectMessage > > selectIntOrString :: MessageSelector (Either Int String) > selectIntOrString = > Left  $ selectTimeout | Right  $ selectStringextensible-effects-concurrentEvery  action returns it's actual result wrapped in this type. It will allow to signal errors as well as pass on normal results such as incoming messages.extensible-effects-concurrent=The current operation of the process was interrupted with a . If A holds for the given reason, the process may choose to continue.extensible-effects-concurrent:The process may resume to do work, using the given result.extensible-effects-concurrentThe process effect is the basis for message passing concurrency. This effect describes an interface for concurrent, communicating isolated processes identified uniquely by a process-id.Processes can raise exceptions that can be caught, exit gracefully or with an error, or be killed by other processes, with the option of ignoring the shutdown request.vProcess Scheduling is implemented in different modules. All scheduler implementations should follow some basic rules:fair scheduling sending a message does not blockreceiving a message does block*spawning a child blocks only a very momentJa newly spawned process shall be scheduled before the parent process after the spawnRawGwhen the first process exists, all process should be killed immediatelyextensible-effects-concurrent3Remove all messages from the process' message queue extensible-effects-concurrentIn cooperative schedulers, this will give processing time to the scheduler. Every other operation implicitly serves the same purpose.extensible-effects-concurrentReturn the current extensible-effects-concurrentjStart a new process, the new process will execute an effect, the function will return immediately with a . extensible-effects-concurrentStart a new process, and  to it .extensible-effects-concurrentGet the process state (or P if the process is dead)extensible-effects-concurrentSShutdown the process; irregardles of the exit reason, this function never returns,extensible-effects-concurrent$Raise an error, that can be handled.extensible-effects-concurrent\Request that another a process interrupts. The targeted process is interrupted and gets an ], the target process may decide to ignore the interrupt and continue as if nothing happened.extensible-effects-concurrent-Send a message to a process addressed by the . Sending a message should **always succeed** and return **immediately**, even if the destination process does not exist, or does not accept messages of the given type.extensible-effects-concurrent~Receive a message that matches a criterium. This should block until an a message was received. The message is returned as a ProcessMessage` value. The function should also return if an exception was caught or a shutdown was requested.extensible-effects-concurrentGenerate a unique Q for the current process. extensible-effects-concurrent>Monitor another process. When the monitored process exits a  is sent to the calling process. The return value is a unique identifier for that monitor. There can be multiple monitors on the same process, and a message for each will be sent. If the process is already dead, the 7 message will be sent immediately, w.thout exit reason extensible-effects-concurrentRemove a monitor. extensible-effects-concurrentaConnect the calling process to another process, such that if one of the processes crashes (i.e.  returns R#), the other is shutdown with the ProcessExitReaon . extensible-effects-concurrent3Unlink the calling proccess from the other process. extensible-effects-concurrent>Create a message selector for a value that can be obtained by S. It will also T the result. extensible-effects-concurrent>Create a message selector for a value that can be obtained by S. It will also T the result. extensible-effects-concurrent4Create a message selector from a predicate. It will T the result. extensible-effects-concurrent4Create a message selector from a predicate. It will T the result. extensible-effects-concurrentSelect a message of type a> and apply the given function to it. If the function returns U The ( function will return the result (sans Maybe ). It will T the result. extensible-effects-concurrentSelect a message of type a> and apply the given function to it. If the function returns U The ( function will return the result (sans Maybe ). It will T the result. extensible-effects-concurrent#Create a message selector. It will T the result. extensible-effects-concurrentCreate a message selector. extensible-effects-concurrentACreate a message selector that will match every message. This is lazy because the result is not Ted. extensible-effects-concurrent>Create a message selector for a value that can be obtained by S& with a proxy argument. It will also T the result. extensible-effects-concurrent>Create a message selector for a value that can be obtained by S& with a proxy argument. It will also T the result. extensible-effects-concurrentGet access to the 4 for the current scheduler effects. _EXPERIMENTAL_ extensible-effects-concurrentSet the  to use, this satisfies  . _EXPERIMENTAL_extensible-effects-concurrent Return a  for a  effect.extensible-effects-concurrentGet the  ExitRecoveryextensible-effects-concurrentGet the  of a .extensible-effects-concurrentA predicate for linked process crashes.extensible-effects-concurrent Handle all s of an  by wrapping them up in  and then do a process .extensible-effects-concurrentHandle \s arising during process operations, e.g. when a linked process crashes while we wait in a  via a call to . extensible-effects-concurrentLike , but instead of passing the  to a handler function, V is returned.extensible-effects-concurrent'Handle interrupts by logging them with   and otherwise ignoring them.extensible-effects-concurrentHandle \s arising during process operations, e.g. when a linked process crashes while we wait in a  via a call to .extensible-effects-concurrentHandle \s arising during process operations, e.g. when a linked process crashes while we wait in a  via a call to .extensible-effects-concurrentWrap all (left) s into  and return the (right)  s as is.extensible-effects-concurrent Throw an , can be handled by recoverFromInterrupt or  or .extensible-effects-concurrentA predicate for crashes. A crash' happens when a process exits with an  other than extensible-effects-concurrentmA predicate for recoverable exit reasons. This predicate defines the exit reasonson which functions such as  extensible-effects-concurrent Partition a  back into either a  or a  extensible-effects-concurrentPrint a  to U a formatted F when  is R>. This can be useful in combination with view patterns, e.g.: slogCrash :: ExitReason -> Eff e () logCrash (toCrashReason -> Just reason) = logError reason logCrash _ = return ()Though this can be improved to: -logCrash = traverse_ logError . toCrashReason extensible-effects-concurrentLog the ProcessExitReaons extensible-effects-concurrentExecute a and action and return the result; if the process is interrupted by an error or exception, or an explicit shutdown from another process, or through a crash of a linked process, i.e. whenever the exit reason satisfies , return the exit reason. extensible-effects-concurrent Execute a : action and resume the process, exit the process when an  was raised. Use   to catch interrupts. extensible-effects-concurrent Execute a : action and resume the process, exit the process when an  was raised. Use   to catch interrupts. extensible-effects-concurrentUse   to execute  . Refer to  for more information.extensible-effects-concurrent-Send a message to a process addressed by the . See .extensible-effects-concurrentSend a W% value to a process addressed by the . See .extensible-effects-concurrent Exit a process addressed by the Z. The process will exit, it might do some cleanup, but is ultimately unrecoverable. See .extensible-effects-concurrent&Interrupts a process addressed by the 7. The process might exit, or it may continue. | Like , but also return True iff the process to exit exists.extensible-effects-concurrentjStart a new process, the new process will execute an effect, the function will return immediately with a 7. If the new process is interrupted, the process will  with the  wrapped in  NotCovered4. For specific use cases it might be better to use .extensible-effects-concurrentLike  but return (). extensible-effects-concurrent0Start a new process, and immediately link to it.extensible-effects-concurrentjStart a new process, the new process will execute an effect, the function will return immediately with a $. The spawned process has only the raw  effects. For non-library code  might be better suited.extensible-effects-concurrentLike  but return (). extensible-effects-concurrentReturn R if the process is alive.extensible-effects-concurrent)Block until a message was received. See  for more documentation.extensible-effects-concurrent0Block until a message was received, that is not P( after applying a callback to it. See  for more documentation.extensible-effects-concurrent%Receive and cast the message to some X instance. See P for more documentation. This will wait for a message of the return type using  extensible-effects-concurrentPRemove and return all messages currently enqueued in the process message queue.extensible-effects-concurrentZEnter a loop to receive messages and pass them to a callback, until the function returns Uy a result. Only the messages of the given type will be received. If the process is interrupted by an exception of by a ; from another process, with an exit reason that satisfies *, then the callback will be invoked with Y ProcessExitReaonC, otherwise the process will be exited with the same reason using ) . See also  for more documentation.extensible-effects-concurrentLike  but  not selective . See also , .extensible-effects-concurrentLike & but refined to casting to a specific X using .extensible-effects-concurrent Returns the  of the current process. extensible-effects-concurrentGenerate a unique Q for the current process.! extensible-effects-concurrent>Monitor another process. When the monitored process exits a  is sent to the calling process. The return value is a unique identifier for that monitor. There can be multiple monitors on the same process, and a message for each will be sent. If the process is already dead, the 7 message will be sent immediately, w.thout exit reason" extensible-effects-concurrentRemove a monitor created with !.# extensible-effects-concurrent!8 another process before while performing an action and " afterwards.$ extensible-effects-concurrentA I for receiving either a monitor of the given process or another message.% extensible-effects-concurrent Trigger an  Interrupt for a  message. The reason will be & extensible-effects-concurrentA MesssageSelector for the  message of a specific process.' extensible-effects-concurrentaConnect the calling process to another process, such that if one of the processes crashes (i.e.  returns R#), the other is shutdown with the ProcessExitReaon .( extensible-effects-concurrent3Unlink the calling proccess from the other process.)extensible-effects-concurrentExit the process with a ProcessExitReaon.*extensible-effects-concurrentExit the process.+extensible-effects-concurrentExit the process with an error.      !"#$%&'()*+hh  )*+'(!"&%#$    None!%&',-.14567=>?@ACHMPSUVX_k i extensible-effects-concurrent+A value to be sent when timer started with r has elapsed.k extensible-effects-concurrent$The reference to a timer started by r , required to stop a timer via s.l extensible-effects-concurrentA number of micro seconds.n extensible-effects-concurrentbWait for a message of the given type for the given time. When no message arrives in time, return P. This is based on o.o extensible-effects-concurrentbWait for a message of the given type for the given time. When no message arrives in time, return Y i. This is based on p and r.p extensible-effects-concurrentA  matching i messages created by r.q extensible-effects-concurrentsSend a message to a given process after waiting. The message is created by applying the function parameter to the k9, such that the message can directly refer to the timer.r extensible-effects-concurrent/Start a new timer, after the time has elapsed, i< is sent to calling process. The message also contains the k! returned by this function. Use s to cancel the timer. Use p to receive the message using 7. To receive messages with guarded with a timeout see n.s extensible-effects-concurrentCancel a timer started with r. ijklmnopqrs lmkijqrspnoNone!%&',-.14567=>?@ACHMPSUVX_kP Zextensible-effects-concurrentThe concrete list of C(ects for running this pure scheduler on IO and with string logging.[extensible-effects-concurrentVInternal data structure that is part of the coroutine based scheduler implementation.\extensible-effects-concurrentaAdd monitor: If the process is dead, enqueue a ProcessDown message into the owners message queueextensible-effects-concurrentLike schedule but pure. The yield effect is just  return (). schedulePure == runIdentity .  (Identity . run) (return ())extensible-effects-concurrentInvoke schedule with lift ] as yield effect. scheduleIO runEff ==  (runLift . runEff) (liftIO ])extensible-effects-concurrentInvoke schedule with lift ] as yield effect. scheduleMonadIOEff ==  id (liftIO ])extensible-effects-concurrentRun processes that have the  and the D8 effects. The user must provide a log handler function."Log messages are evaluated strict. scheduleIOWithLogging == ^ .  captureLogs . schedule (return ())extensible-effects-concurrent Handle the G effect, as well as all lower effects using an effect handler function. Execute the main  and all the other processes xed by it in the current thread concurrently, using a co-routine based, round-robin scheduler. If a process exits with *, +,  raiseError! or is killed by another process Left ...: is returned. Otherwise, the result will be wrapped in a Right.UEvery time a process _yields_ the effects are evaluated down to the a value of type m (Either String a).4If the evaluator function runs the action down e.g. IOh this might improve memory consumption, for long running services, with processes that loop endlessly._extensible-effects-concurrent Internal  handler function.extensible-effects-concurrentA  for Z.extensible-effects-concurrent Execute a  using schedule on top of D IO and  String effects.extensible-effects-concurrentAn that performs a yield w.r.t. the underlying effect r . E.g. if Lift IO$ is present, this might be: @lift ].None!%&',-.14567=>?@ACHMPSUVX_k]`extensible-effects-concurrentRA message queue of a process, contains the actual queue and maybe an exit reason.aextensible-effects-concurrent1Information about a process, needed to implement MessagePassing and , handlers. The message queue is backed by a b and contains  MessageQEntry values.cextensible-effects-concurrent Return any d from a ` in a e and reset the d field to P in the e.fextensible-effects-concurrent~Contains all process info'elements, as well as the state needed to implement inter process communication. It contains also a &6 to which the logs of all processes are forwarded to.gextensible-effects-concurrentBasic effects:  3 and D IOextensible-effects-concurrentThe concrete list of C'ects for this scheduler implementation.extensible-effects-concurrentType class constraint to indicate that an effect union contains the effects required by every process and the scheduler implementation itself.extensible-effects-concurrent+The concrete list of the effects, that the  usesextensible-effects-concurrentThe concrete list of CDects of processes compatible with this scheduler. This builds upon .hextensible-effects-concurrentaAdd monitor: If the process is dead, enqueue a ProcessDown message into the owners message queueiextensible-effects-concurrent Create a new ajextensible-effects-concurrent Create a new fkextensible-effects-concurrent Create a new fk run an IO action, catching all exceptions, and when the actions returns, clean up and kill all processes.extensible-effects-concurrent<Start the message passing concurrency system then execute a  on top of 0 effect. All logging is sent to standard output.extensible-effects-concurrent<Start the message passing concurrency system then execute a  on top of 0 effect. All logging is sent to standard output.extensible-effects-concurrentA  for extensible-effects-concurrentjThis is the main entry point to running a message passing concurrency application. This function takes a  on top of the  effect and a & for concurrent logging. None!%&',-.14567=>?@ACHMPSUVX_k extensible-effects-concurrent'This is a tag-type that wraps around a  and holds an  index type.extensible-effects-concurrentyThe (promoted) constructors of this type specify (at the type level) the reply behavior of a specific constructor of an Api instance.extensible-effects-concurrent[Specify that handling a request is a blocking operation with a specific return type, e.g. -('Synchronous (Either RentalError RentalId))extensible-effects-concurrent,Non-blocking, asynchronous, request handlingextensible-effects-concurrent}This data family defines an API, a communication interface description between at least two processes. The processes act as servers or  client(s), regarding a specific instance of this type.PThe first parameter is usually a user defined phantom type that identifies the  instance.LThe second parameter specifies if a specific constructor of an (GADT-like) Api instance is ;, i.e. returns a result and blocks the caller or if it is Example:  data BookShop deriving Typeable data instance Api BookShop r where RentBook :: BookId -> Api BookShop ('Synchronous (Either RentalError RentalId)) BringBack :: RentalId -> Api BookShop 'Asynchronous type BookId = Int type RentalId = Int type RentalError = String extensible-effects-concurrentTag a  with an  type index to mark it a  process handling that APIextensible-effects-concurrentTag a  with an  type index to mark it a  process handling that API  None!%&',-.14567=>?@ACHMPSUVX_klmnop None!%&',-.14567=>?@ACHMPSUVX_kZ"extensible-effects-concurrent-A command to the server loop started e.g. by server or . Typically returned by an ; member to indicate if the server should continue or stop.extensible-effects-concurrent/Tell the server to keep the server loop runningextensible-effects-concurrent(Tell the server to exit, this will make 7 stop handling requests without exitting the process. 1 will be invoked with the given optional reason.extensible-effects-concurrent3A record of callbacks, handling requests sent to a server , all belonging to a specific 2 family instance. The values of this type can be ed or combined via  or s.extensible-effects-concurrent[A cast will not return a result directly. This is used for async methods. This returns an  to the server loop.extensible-effects-concurrentyA call is a blocking operation, the caller is blocked until this handler calls the reply continuation. This returns an  to the server loop.extensible-effects-concurrentThis callback is called with Nothing if one of these things happen:the process exits or  return 1If the process exist peacefully the parameter is NotServerCallbacking , otherwise Just "error message..."% if the process exits with an error.#The default behavior is defined in .extensible-effects-concurrent Create an  with a , a  and a  implementation.extensible-effects-concurrentLike  but the server will loop until an error is raised or the process exits. The callback actions won't decide wether to stop the server or not, instead the   is used.extensible-effects-concurrent Create an  with only a  implementation.extensible-effects-concurrentLike N but the server will loop until an error is raised or the process exits. See apiHandlerForver.extensible-effects-concurrent Create an  with only a  implementation.extensible-effects-concurrentLike N but the server will loop until an error is raised or the process exits. See apiHandlerForver.extensible-effects-concurrent Create an  with only a  and  implementation.extensible-effects-concurrentLike N but the server will loop until an error is raised or the process exits. See apiHandlerForver.extensible-effects-concurrent"Building block for composition of . A wrapper for . Use this to combine +, allowing a process to implement several N instances. The termination will be evenly propagated. Create this via e.g. ' instances To serve multiple apis use q" to combine server callbacks, e.g.@@ let f = apiHandlerServerCallback px $ ApiHandler ... g = apiHandlerServerCallback px $ ApiHandler ... h = f <> g in serve px h @@extensible-effects-concurrent*Helper type class to allow composition of .extensible-effects-concurrentThe effect of the callbacksextensible-effects-concurrent6The is used to let the spawn function return multiple  @s in a type safe way, e.g. for a tuple instance of this class (Server a, Server b)extensible-effects-concurrent6The is used to let the spawn function return multiple  s in a type safe way.extensible-effects-concurrentConvert the value to a extensible-effects-concurrent>Receive and process incoming requests until the process exits.extensible-effects-concurrent^Spawn a new process, that will receive and process incoming requests until the process exits.extensible-effects-concurrentSpawn a new process, that will receive and process incoming requests until the process exits. Also handle all internal effects.rextensible-effects-concurrentWrap an  into a composable  value.sextensible-effects-concurrentJTry to parse an incoming message to an API request, and apply either the  handleCall method or the  handleCast method to it.textensible-effects-concurrentApply either the ,  or the " callback to an incoming request.extensible-effects-concurrentA default handler to use in  in . It will call  raiseError with a nice error message.extensible-effects-concurrentA default handler to use in  in . It will call  raiseError with a nice error message.extensible-effects-concurrent+Either do nothing, if the error message is Nothing , or call + with the error message.$$ None!%&',-.14567=>?@ACHMPSUVX_knextensible-effects-concurrentThe reader effect for s for s, see extensible-effects-concurrentInstead of passing around a & value and passing to functions like  or , a  can provided by a B effect, if there is only a  single server for a given I instance. This type alias is convenience to express that an effect has  and a reader for a .extensible-effects-concurrentSend an v request that has no return value and return as fast as possible. The type signature enforces that the corresponding  clause is [. The operation never fails, if it is important to know if the message was delivered, use  instead.extensible-effects-concurrentSend an : request and wait for the server to return a result value.3The type signature enforces that the corresponding  clause is .extensible-effects-concurrent"Run a reader effect that contains the one server handling a specific  instance.extensible-effects-concurrentGet the  registered with .extensible-effects-concurrentLike  but take the  from the reader provided by .extensible-effects-concurrentLike  but take the  from the reader provided by . None!%&',-.14567=>?@ACHMPSUVX_kyextensible-effects-concurrent]Contains the communication channels to interact with a scheduler running in its' own thread.extensible-effects-concurrent>Fork a scheduler with a process that communicates with it via u$, which is also the reason for the Lift IO constraint.extensible-effects-concurrent@Exit the schedulder immediately using an asynchronous exception.extensible-effects-concurrentSend a V effect to the main process of a scheduler, this blocks until the effect is executed.extensible-effects-concurrentCombination of  and .extensible-effects-concurrentCombination of  and . None!%&',-.14567=>?@ACHMPSUVX_kextensible-effects-concurrentAn : that schedules the observations to an effectful callback.extensible-effects-concurrent<Alias for the effect that contains the observers managed by extensible-effects-concurrentInternal state for extensible-effects-concurrent An existential wrapper around a  of an G. Needed to support different types of observers to observe the same  in a general fashion.extensible-effects-concurrentAn : index that supports registration and de-registration of s.extensible-effects-concurrent/Type of observations visible on this observableextensible-effects-concurrent Return the  value for the cast_ that registeres an observerextensible-effects-concurrent Return the  value for the cast_ that de-registeres an observerextensible-effects-concurrentAn 0 index that support observation of the another  that is .extensible-effects-concurrent Wrap the  and the  (i.e. the ') that caused the observation into an  value that the  understands.extensible-effects-concurrentSend an  to an extensible-effects-concurrent Send the extensible-effects-concurrent Send the extensible-effects-concurrentSend an  to .extensible-effects-concurrentKeep track of registered .s Observers can be added and removed, and an 0 can be sent to all registerd observers at once.extensible-effects-concurrentAdd an  to the  managed by .extensible-effects-concurrent Delete an  from the  managed by .extensible-effects-concurrentSend an  to all  s in the  state.extensible-effects-concurrentStart a new process for an ; that schedules all observations to an effectful callback.extensible-effects-concurrentStart a new process for an ; that schedules all observations to an effectful callback.None!%&',-.14567=>?@ACHMPSUVX_kextensible-effects-concurrentAn  type for generic s, see . extensible-effects-concurrentJJust a wrapper around a function that will be applied to the result of a s  clause, or an ! caught during the execution of receive or a  extensible-effects-concurrent+Helper type class for the return values of  et al. extensible-effects-concurrent!An existential wrapper around a 8 and a function that handles the selected message. The api" type parameter is a phantom type..The return value if the handler function is a . extensible-effects-concurrent-A command to the server loop started e.g. by server or spawnServerWithEffects. Typically returned by an  ApiHandler; member to indicate if the server should continue or stop.extensible-effects-concurrent/Tell the server to keep the server loop runningextensible-effects-concurrent(Tell the server to exit, this will make serve7 stop handling requests without exitting the process. _terminateCallback1 will be invoked with the given optional reason. extensible-effects-concurrentServe an  in a newly spawned process. extensible-effects-concurrentServe an * in a newly spawned -and linked - process.  extensible-effects-concurrentServer an w in a newly spawned process; the callbacks have access to some state initialed by the function in the first parameter.  extensible-effects-concurrentServer an w in a newly spawned process; The caller provides an effect handler for arbitrary effects used by the server callbacks. extensible-effects-concurrentServer an  in a newly spawned process; The caller provides an effect handler for arbitrary effects used by the server callbacks. Links to the calling process like ' would. extensible-effects-concurrentReceive loop for  call%s. This starts a receive loop for a ". It is used behind the scenes by   and  . extensible-effects-concurrentA smart constructor for s extensible-effects-concurrentA smart constructor for s extensible-effects-concurrentA smart constructor for s extensible-effects-concurrentA smart constructor for s extensible-effects-concurrentA smart constructor for s lhandleCalls SP (\ (RentBook bookId customerId) runCall -> runCall $ do rentalIdE <- rentBook bookId customerId case rentalIdE of -- on fail we just don't send a reply, let the caller run into -- timeout Left err -> return (Nothing, AwaitNext) Right rentalId -> return (Just rentalId, AwaitNext)) extensible-effects-concurrentA smart constructor for sextensible-effects-concurrentA variation of ( that allows to defer a reply to a call. extensible-effects-concurrentA smart constructor for s extensible-effects-concurrent Compose two s to a type-leve pair of them. 1handleCalls api1calls ^: handleCalls api2calls ^: extensible-effects-concurrent]Make a fallback handler, i.e. a handler to which no other can be composed to from the right. extensible-effects-concurrentA # that drops the left-over messages. extensible-effects-concurrentA 1 that terminates if there are unhandled messages. extensible-effects-concurrentA # that drops the left-over messages. extensible-effects-concurrentA smart constructor for sextensible-effects-concurrent,Apply a given callback function to incoming  Observerations.vextensible-effects-concurrentAn  instance for generic s, see .            5None!%&',-.14567=>?@ACHMPSUVX_k-%extensible-effects-concurrentA B for an &.&extensible-effects-concurrent Contains a w$ capturing observations received by * or +.'extensible-effects-concurrent1Read queued observations captured by observing a  that implements an   using * or +. This blocks until the next + received. For a non-blocking variant use ( or ).(extensible-effects-concurrent1Read queued observations captured by observing a  that implements an   using * or +. Return the next  immediately or P if the queue is empty. Use '+ to block until an observation is observed.)extensible-effects-concurrentRead all currently queued s captured by +3. This returns immediately all currently enqueued s. For a blocking variant use '.*extensible-effects-concurrentObserve a(the) registered  that implements an   . Based on +.+extensible-effects-concurrent Observe a  that implements an  , the s can be obtained by '. All observations are captured up to the queue size limit, such that the first message received will be first message returned by '.DThis function captures runtime exceptions and cleans up accordingly.%&'()*+&%'()*+None!%&',-.14567=>?@ACHMPSUVX_k,extensible-effects-concurrent A version of ! that hopefully tricks GHC into notP creating a space leak. The intuition is, that we want to do something that is cheap, and hence should be  recomputed instead of shared.-extensible-effects-concurrent A version of ! that hopefully tricks GHC into notP creating a space leak. The intuition is, that we want to do something that is cheap, and hence should be  recomputed instead of shared.,-,-None!%&',-.14567=>?@ACHMPSUVX_kG &'()*+,-./0123456789:;<=>?@ABC[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+hijklmnopqr  %&'()*+,-      !"#$%&'()*+hijklmnopqr  %&'()*+None"%&',-.14567=>?@ACHMPSUVX_kxyz{|}~ !"#$%&'()*+,-./0123456789:;<= >?@ABCDEFGHIJKLLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                                                                                       !"#$%&'()*+,-./0123456789:;<=>9?@<=A<=B<=C<=D<=E<=F<=G<=H<=I<=J<=K<=L<=M<=N<=N9OP9QR<ST<UV<UW9XY9QZ[<S\]^_`ab9cd9ce9Qf9?g`ah`ai9jklmn9?o9pq9jr9st9puvwx9cy<Uz{|}~9cx9Q   9~;extensible-effects-concurrent-0.14.2-BvJH1WvLpy9EZuUftxwHBRControl.Eff.ExceptionExtraControl.Eff.Log.HandlerControl.Eff.Log.ChannelControl.Eff.Log.MessageControl.Eff.Concurrent.Process$Control.Eff.Concurrent.Process.Timer6Control.Eff.Concurrent.Process.SingleThreadedScheduler.Control.Eff.Concurrent.Process.ForkIOSchedulerControl.Eff.Concurrent.Api!Control.Eff.Concurrent.Api.Server!Control.Eff.Concurrent.Api.Client*Control.Eff.Concurrent.Process.Interactive#Control.Eff.Concurrent.Api.Observer"Control.Eff.Concurrent.Api.Server2)Control.Eff.Concurrent.Api.Observer.QueueControl.Eff.LoopControl.Eff.LogControl.Exception.Safe SomeExceptionAsynccancel#Control.Eff.Concurrent.Api.Internal Control.Monadforever replicateM_Control.Eff.Concurrent#Paths_extensible_effects_concurrentliftTry maybeThrow$fMonadMaskEff$fMonadCatchEff$fMonadThrowEff$fMonadMaskEff0$fMonadCatchEff0$fMonadThrowEff0$fMonadMaskEff1$fMonadCatchEff1$fMonadThrowEff1$fMonadMaskEff2$fMonadCatchEff2$fMonadThrowEff2Logs HasLogWriterLogWriterReader LogWriterlogMsglogMsgsmapLogMessagesfilterLogMessagestraverseLogMessageschangeLogWriter ignoreLogs traceLogsfoldingLogWriterwriteAllLogMessagessingleMessageLogWritermultiMessageLogWriter askLogWriterrunLogs writeLogs$fDefaultLogWriter$fMonadBaseControlmEff LogChannelwithAsyncLogChannelhandleLoggingAndIOhandleLoggingAndIO_Facility fromFacilitySeverity fromSeverityStructuredDataElement SdElement _sdElementId_sdElementParameters HasLogging LogMessage _lmFacility _lmSeverity _lmTimestamp _lmHostname _lmAppname _lmProcessId _lmMessageId_lmStructuredData _lmThreadId _lmSrcLoc _lmMessage _lmDistancetraceLogMessageWriterrenderLogMessage renderRFC5424$fNFDataSdParameter$fShowSdParameter$fNFDataStructuredDataElement$fShowStructuredDataElement$fShowSeverity$fNFDataLogMessage$fEqSdParameter$fOrdSdParameter$fGenericSdParameter$fEqStructuredDataElement$fOrdStructuredDataElement$fGenericStructuredDataElement $fEqSeverity $fOrdSeverity$fGenericSeverity$fNFDataSeverity $fEqFacility $fOrdFacility$fShowFacility$fGenericFacility$fNFDataFacility$fEqLogMessage$fGenericLogMessage sdElementIdsdElementParameters lmAppname lmDistance lmFacility lmHostname lmMessage lmMessageId lmProcessId lmSeveritylmSrcLoclmStructuredData lmThreadId lmTimestamp setCallStackprintLogMessageioLogMessageWriterioLogMessageHandlersetLogMessageTimestampsetLogMessageThreadIdincreaseLogMessageDistancedropDistantLogMessageslogWithSeverity logEmergencylogAlert logCriticallogError logWarning logNoticelogInfologDebug errorMessage infoMessage debugMessageerrorMessageIO infoMessageIOdebugMessageIOemergencySeverity alertSeveritycriticalSeverity errorSeveritywarningSeveritynoticeSeverityinformationalSeverity debugSeveritykernelMessagesuserLevelMessages mailSystem systemDaemonssecurityAuthorizationMessages4linePrinterSubsystemnetworkNewsSubsystem uucpSubsystem clockDaemonsecurityAuthorizationMessages10 ftpDaemon ntpSubsystemlogAuditFacilitylogAlertFacility clockDaemon2local0local1local2local3local4local5local6local7$fDefaultFacility$fDefaultSeverity$fIsStringLogMessage$fDefaultLogMessage ProcessId_fromProcessId ProcessDown downReference downReasonMonitorReference monitorIndexmonitoredProcessSomeExitReasonInterruptableProcess InterruptsInterruptReason ExitReasonProcessFinishedProcessNotRunningLinkedProcessCrashed ProcessError ExitNormally NotRecoveredUnexpectedExceptionKilled ExitSeverity NormalExitCrash ExitRecovery Recoverable NoRecovery ProcessStateProcessBooting ProcessIdle ProcessBusyProcessBusySendingProcessBusySendingShutdownProcessBusySendingInterruptProcessBusyReceivingProcessBusyLinkingProcessBusyUnlinkingProcessBusyMonitoringProcessBusyDemonitoringProcessInterruptedProcessShuttingDown ConsProcess HasSchedulerSchedulerProxySP SchedulerMessageSelectorrunMessageSelector ResumeProcess Interrupted ResumeWithProcess FlushMessages YieldProcessSelfPidSpawn SpawnLinkGetProcessStateShutdown SendShutdown SendInterrupt SendMessageReceiveSelectedMessage MakeReferenceMonitor DemonitorLinkUnlink selectMessageselectMessageLazy filterMessagefilterMessageLazyselectMessageWithselectMessageWithLazyselectDynamicMessageselectDynamicMessageLazyselectAnyMessageLazyselectMessageProxyselectMessageProxyLazygetSchedulerProxywithSchedulerProxythisSchedulerProxytoExitRecoverytoExitSeverity isBecauseDownprovideInterruptsShutdownhandleInterruptstryUninterrupted logInterruptsexitOnInterruptprovideInterrupts!mergeEitherInterruptAndExitReason interruptisCrash isRecoverablefromSomeExitReason toCrashReasonlogProcessExitexecuteAndResumeexecuteAndResumeOrExitexecuteAndResumeOrThrow yieldProcess sendMessagesendAnyMessage sendShutdown sendInterruptspawnspawn_ spawnLinkspawnRaw spawnRaw_isProcessAlivereceiveAnyMessagereceiveSelectedMessagereceiveMessage flushMessagesreceiveSelectedLoopreceiveAnyLoop receiveLoopself makeReferencemonitor demonitor withMonitorreceiveWithMonitorbecauseProcessIsDownselectProcessDown linkProcess unlinkProcess exitBecause exitNormally exitWithError$fAlternativeMessageSelector$fApplicativeMessageSelector$fDefaultProcessState$fNFDataProcessState$fShowExitRecovery$fNFDataExitRecovery$fNFDataExitSeverity$fShowExitSeverity$fShowProcessId$fReadProcessId$fShowMonitorReference$fNFDataMonitorReference$fEqExitReason$fOrdExitReason$fNFDataExitReason$fExceptionExitReason$fExceptionExitReason0$fShowExitReason$fNFDataSomeExitReason$fShowSomeExitReason$fEqSomeExitReason$fOrdSomeExitReason$fShowProcessDown$fNFDataProcessDown$fNFData1ResumeProcess$fNFDataResumeProcess $fShowProcess$fSemigroupMessageSelector$fMonoidMessageSelector$fFunctorMessageSelector$fReadProcessState$fShowProcessState$fOrdProcessState$fEqProcessState$fEnumProcessState$fGenericProcessState$fOrdExitRecovery$fEqExitRecovery$fGenericExitRecovery$fOrdExitSeverity$fEqExitSeverity$fGenericExitSeverity $fEqProcessId$fOrdProcessId$fBoundedProcessId$fNumProcessId$fEnumProcessId$fIntegralProcessId$fRealProcessId$fNFDataProcessId$fReadMonitorReference$fEqMonitorReference$fOrdMonitorReference$fGenericMonitorReference$fGenericProcessDown$fEqProcessDown$fOrdProcessDown$fGenericResumeProcess$fGeneric1ResumeProcess$fShowResumeProcess fromProcessId TimerElapsedfromTimerElapsedTimerReferenceTimeoutfromTimeoutMicros receiveAfterreceiveSelectedAfterselectTimerElapsed sendAfter startTimer cancelTimer $fShowTimeout$fShowTimerReference$fShowTimerElapsed$fNFDataTimeout $fOrdTimeout $fEqTimeout $fNumTimeout$fIntegralTimeout $fRealTimeout $fEnumTimeout$fNFDataTimerReference$fOrdTimerReference$fEqTimerReference$fNumTimerReference$fIntegralTimerReference$fRealTimerReference$fEnumTimerReference$fNFDataTimerElapsed$fOrdTimerElapsed$fEqTimerElapsed schedulePure scheduleIOscheduleMonadIOEffscheduleIOWithLogging scheduleMsingleThreadedIoSchedulerdefaultMainSingleThreaded $fShowSTS $fShowOnYield$fDefaultMessageQ SchedulerIOHasSchedulerIOInterruptableProcEffProcEff defaultMaindefaultMainWithLogChannelforkIoSchedulerschedule$fShowProcessInfoServer _fromServer Synchronicity Synchronous AsynchronousApi $fShowServer $fEqServer $fOrdServer fromServer proxyAsServerasServer ApiServerCmdHandleNextRequest StopApiServer ApiHandler _castCallback _callCallback_terminateCallback apiHandlerapiHandlerForever castHandlercastHandlerForever callHandlercallHandlerForevercastAndCallHandlercastAndCallHandlerForever$fNFDataApiServerCmd$fDefaultApiHandler$fShowApiServerCmd$fGenericApiServerCmdServerCallback_requestHandlerSelector_terminationHandler callCallback castCallbackterminateCallbackServable ServerEff ServerPids toServerPidstoServerCallbackrequestHandlerSelectorterminationHandlerserve spawnServerspawnServerWithEffectsunhandledCallErrorunhandledCastErrordefaultTermination$fMonoidServerCallback$fSemigroupServerCallback $fServable(,)$fServableApiHandler$fServableServerCallback ServerReader ServesApicastcallregisterServer whereIsServercallRegisteredcastRegisteredSchedulerSessionforkInteractiveSchedulerkillInteractiveSchedulersubmit submitCast submitCallCallbackObserver ObserverState Observers SomeObserver Observable ObservationregisterObserverMessageforgetObserverMessageObserverobservationMessagenotifyObserverregisterObserverforgetObservernotifySomeObservermanageObservers addObserverremoveObservernotifyObserversspawnCallbackObserverspawnLoggingObserver$fEqSomeObserver$fOrdSomeObserver$fObserverCallbackObservero $fShowApi$fShowSomeObserver ObservingInterruptCallback ToServerPidsMessageCallbackCallbackResult AwaitNext StopServerspawnApiServerspawnLinkApiServerspawnApiServerStatefulspawnApiServerEffectfulspawnLinkApiServerEffectful apiServerLoophandleMessageshandleSelectedMessageshandleAnyMessages handleCasts handleCallshandleCastsAndCallshandleCallsDeferredhandleProcessDowns^:fallbackHandlerdropUnhandledMessagesexitOnUnhandledlogUnhandledMessagesstopServerOnInterrupthandleObservations$fDefaultMessageCallback$fMonoidMessageCallback$fSemigroupMessageCallback$fToServerPidsTYPEapi1$fToServerPids[]:$fToServerPids[][]$fDefaultInterruptCallback$fObserverObservingoObservationQueueReaderObservationQueuereadObservationQueuetryReadObservationQueueflushObservationQueueenqueueObservationsRegisteredenqueueObservations foreverCheapreplicateCheapM_baseGHC.Exception.Type Exception1extensible-effects-3.1.0.2-CGCob8Du32lBMKRIqv8pEdControl.Eff.Exception liftEither GHC.MaybeMaybe liftMaybeFail ignoreFail liftMaybeM liftEitherM rethrowErroronFail catchErrorrunFailrunErrordie throwError_ throwErrorExcData.Traversable TraversableGHC.Base MonadPlusControl.Eff.Reader.StrictReaderControl.Eff.InternalEffLift Debug.TracetraceMStringrunLogsFilteredaskwriteLogsFilteredConcurrentLogChannel SdParameterghc-prim GHC.TypesIO GHC.Conc.SyncThreadId myThreadId AlternativeNothingIntTrue Data.Dynamic fromDynamicdeepseq-1.4.4.0Control.DeepSeqforceJust Data.EitherEitherDynamicData.Typeable.InternalTypeableLeft LoggingAndIoOnYield addMonitoringyieldrun handleProcessMessageQ ProcessInfo stm-2.5.0.0Control.Concurrent.STM.TQueueTQueuetryTakeNextShutdownRequestSTM_shutdownRequestsTVarSchedulerState LoggingAndIOnewProcessInfonewSchedulerStatewithNewSchedulerStateResponseRequestCallCast<>apiHandlerServerCallbackselectHandlerMethodapplyHandlerMethodGHC.MVarMVarD:R:ApiObservingAsynchronous0Control.Concurrent.STM.TBQueueTBQueueversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName