úÎ!‘~†@Ŕ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ ` 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 { | } ~  €  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ ” • – — ˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżNone =>?@AHSVXŽboxba Committer a "commits" values of type a. A Sink and a Consumer are some other metaphors for this. A Committer absorbsq the value being committed; the value disappears into the opaque thing that is a Committer from the pov of usage.boxlift a committer from STMboxUThis is a contramapMaybe, if such a thing existed, as the contravariant version of a mapMaybe. See .https://hackage.haskell.org/package/witherable witherablebox prism handlerboxboxSafe=>?@ASX— box.sometimes you have no choice but to void it upboxA continuation similar to ContT9 but where the result type is swallowed by an existential  None =>?@AHSVXŘboxan 5 "emits" values of type a. A Source & a Producer (of aDs) are the two other alternative but overloaded metaphors out there.˘An Emitter 'reaches into itself' for the value to emit, where itself is an opaque thing from the pov of usage. An Emitter is named for its main action: it emits."boxlike a monadic mapMaybe. (See  .https://hackage.haskell.org/package/witherable witherable)#box prism handler$boxattoparsec parse emitter%boxread parse emitter#boxbox !"#$% !"#%$None =>?@AHSVX(P-box˙íA Box is a product of a Committer m and an Emitter. Think of a box with an incoming wire and an outgoing wire. Now notice that the abstraction is reversable: are you looking at two wires from "inside a box"; a blind erlang grunt communicating with the outside world via the two thin wires, or are you looking from "outside the box"; interacting with a black box object. Either way, it's a box. And either way, the committer is contravariant and the emitter covariant so it forms a profunctor.a Box can also be seen as having an input tape and output tape, thus available for turing and finite-state machine metaphorics.1boxlift a box from STM2boxa profunctor dimapMaybe-./012-./012None =>?@AHSVX:6box6" specifies how messages are queued=box"create a queue, returning the endsŔbox#write to a queue, checking the sealÁbox*read from a queue, and retry if not sealed>box$turn a queue into a box (and a seal)?box5wait for the first action, and then cancel the second@boxErun two actions concurrently, but wait and return on the left result.AboxFrun two actions concurrently, but wait and return on the right result.Bbox[connect a committer and emitter action via spawning a queue, and wait for both to complete.Cbox`connect a committer and emitter action via spawning a queue, and wait for committer to complete.Dbox^connect a committer and emitter action via spawning a queue, and wait for emitter to complete.Âbox[connect a committer and emitter action via spawning a queue, and wait for both to complete.Eboxcreate an unbounded queueFbox7create an unbounded queue, returning the emitter resultGbox9create an unbounded queue, returning the committer resultHbox7create an unbounded queue, returning the emitter resultIbox7create an unbounded queue, returning the emitter result689<7:;=>?@ABCDEFGHI689<7:;EGFHI?=BDC>@ANone =>?@AHSVXCJboxDhook an emitter action to a queue, creating a committer continuationKboxDhook a committer action to a queue, creating an emitter continuationLboxDhook a committer action to a queue, creating an emitter continuationMboxcreate a double-queued box plugNboxëcreate a box plug from a box action. Caution: implicitly, this (has to) forget interactions between emitter and committer in the one action (and it does so silently). These forgotten interactions are typically those that create racesJKLMNJKLMNNone =>?@AHSVXQđObox'fuse an emitter directly to a committerPboxslightly more efficient versionQbox fuse a box L(fuse (pure . Just) $ liftB <$> (Box <$> cStdout 2 <*> emitter')) >> sleep 1hi bye 9etc () (Transducer id) == fuse (pure . pure) . fmap liftBRbox&fuse a box with an STM mapMaybe actionSboxfuse-branch an emitterTboxfuse a committer to a bufferUboxfuse a committer to a bufferVboxfuse an emitter to a bufferWboxfuse an emitter to a bufferXboxmerge two emittersÁThis differs from `liftA2 (<>)` in that the monoidal (and alternative) instance of an Emitter is left-biased (The left emitter exhausts before the right one is begun). This merge is concurrent.Yboxmonadic versionZboxsplit a committer (STM m)[boxsplit a committer\boxuse a split committer]box5a box modifier that feeds commits back to the emitter^boxOan emitter post-processor that cons transformed emissions back into the emitterOPQRSTUVWXYZ[\]^OPQRS]^VWTUXY[Z\ NoneU2_box a funnelerbboxa broadcaster ebox!create a (broadcaster, committer)fboxsubscribe to a broadcastergboxcreate a (funneler, emitter)hboxwiden to a funneler _`abcdefgh bcdef_`agh None =>?@AHSVX[ę ibox)create a committer from a stream consumerjboxcreate a committer from a foldkboxcreate a committer from a sinklboxcreate an emitter from a streammboxIinsert a queue into a stream (left biased collapse) todo: look at biasesnboxturn an emitter into a streamoboxturn an emitter into a streampboxturn a stream into a committerqboxturn a stream into a committer ijklmnopq npijklmoq None.>SXaŁvboxsleep for x secondswbox9keeping a box open sometimes needs a long running emitterxboxa stream with suggested delays. DiffTime is the length of time to wait since the start of the stream > delayTimed (S.each (zip (fromIntegral  $ [1..10]) [1..10])) |> S.printzbox3adding a time stamp todo: how to do this properly? rstuvwxyz vwxrstuyz None =>?@AHSVXnň~boxtransduction  (https://en.wikipedia.org/wiki/Transducerwiki´ says: "A transducer is a device that converts energy from one form to another." Translated to context, this Transducer converts a stream of type a to a stream of a different type.boxconvert a Pipe to a Transducer‚boxemit - transduce - commitXwith etc, you're in the box, and inside the box, there are no effects: just a stream of a¨s, pure functions and state tracking. It's a nice way to code, and very friendly for the compiler. When the committing and emitting is done, the box collapses to state.€The combination of an input tape, an output tape, and a state-based stream computation lends itself to the etc computation as a  5https://en.wikipedia.org/wiki/Finite-state_transducerfinite-state transducer or mealy machine.~€‚ƒ~€‚ƒ None =>?@AHSVX{`…boxa single stdin committer action†boxa finite stdin committer action‡box a forever stdin committer actionˆboxa Cont stdin emitter‰box,read from console, throwing away read errorsŠboxa single stdout emitter actionĂboxa single stdout emitter action‹boxa finite stdout emitter actionŒboxa finite stdout emitter actionboxa forever stdout emitter actionŽboxa Cont stdout committerboxshow to stdoutbox^console box > etc () (Trans $ s -> s & S.takeWhile (/="q") & S.map ("echo: " <>)) (console 5)‘boxemit lines from a file’boxcommit lines to a file“boxcommit to a list CRef”boxcommit to a monoidal CRef•box<fold an emitter through a transduction, committing to a list–boxget all commissions as a list—boxget all emissions…†‡ˆ‰Š‹ŒŽ‘’“”•–—…†‡ˆ‰Š‹ŒŽ‘’“”•–—None =>?@AHSVX|Žy  !"#$%-./012689<7:;=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz~€‚ƒ…†‡ˆ‰Š‹ŒŽ‘’“”•–—None 27=>?SX€ôŞbox)an effect that can be started and stoppedŤboxLsend Start, wait for a Ready signal, run action, wait x secs, then send Quit˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ Ą˘Ł¤ĽŚœžŸ›˜™š§¨ŠŞŤŹNoneESX…ľšboxZAn updater of a value a, where the updating process consists of an IO fold over an emitterťbox Create an  Updatable value using a pure Äźbox^run an action on each update > listen mempty = id > > listen (f <> g) = listen g . listen fšşťź˝šşťź˝Safe†ĹĆÇČÉĘËĚÍ  !"#$%&'()*+,-../0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk l l m n n o p q r s t u v w x y z { | } } ~  €  ‚ ƒ „ … † ‡ ˆ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ ” • – — ˜ ™ š › œ  ž Ÿ  Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂÂĂÄĹĆÇČÉĘ ËĚÍÎĎĐŃŇÓÔŐÖ× box-0.1.0-IIXwE7JkcxJ3Jk9Epv1E5kBox Box.CommitterBox.Cont Box.EmitterBox.Box Box.Queue Box.PlugsBox.Connectors Box.Broadcast Box.StreamBox.TimeBox.TransducerBox.IO Box.Control Box.Updater Paths_boxbase Data.Function& CommittercommitliftCcmaphandles$fDecidableCommitter$fDivisibleCommitter$fContravariantCommitter$fMonoidCommitter$fSemigroupCommitterCont_with_Contwith $fMonoidCont$fSemigroupCont $fMonadIOCont $fMonadCont$fApplicativeCont $fFunctorCont $fMonoidCont_$fSemigroupCont_$fMonadIOCont_ $fMonadCont_$fApplicativeCont_$fFunctorCont_EmitteremitliftEemapkeepseParseeRead$fMonoidEmitter$fSemigroupEmitter$fMonadPlusEmitter$fAlternativeEmitter$fMonadEmitter$fApplicativeEmitter$fFunctorEmitter committeremitterliftBbmap $fMonoidBox$fSemigroupBox$fProfunctorBoxQueue UnboundedBoundedSingleLatestNewestNewendstoBox waitCancelconcurrentlyLeftconcurrentlyRightwithQwithQCwithQEqueuequeueEqueueCqueueCMqueueEM commitPlugemitPlug emitPlugMboxPlug boxForgetPlugfuse_fuseSTM_fusefuseSTMforkEmit fuseCommit fuseCommitMfuseEmit fuseEmitMemergeemergeMsplitCommitSTM splitCommit contCommitfeedback feedbackEFunnelerunFunnel Broadcaster unBroadcast broadcast subscribefunnelwidentoCommit toCommitFold toCommitSinktoEmit queueStreamtoStream toStreamM fromStream fromStreamMStamped timestampvaluesleepkeepOpen delayTimedstampNow emitStamp $fEqStamped $fShowStamped $fReadStamped Transducer transduceasPipeetcetcM$fCategoryTYPETransducercStdin_cStdincStdin'eStdin readStdineStdout_eStdouteStdoutMeStdout'cStdout showStdout consolePlug emitLines commitLinescCRefcCRefMtoListMgetCommissions getEmissions ControlConfig KeepAlive AllowDeath ControlBoxControlResponseShutDownOnLogControlRequestCheckStopQuitStartResetKilldefaultControlConfigconsoleControlBoxparseControlRequest controlBoxtestBoxtimeOut$fShowControlRequest$fReadControlRequest$fEqControlRequest$fDataControlRequest$fGenericControlRequest$fShowControlResponse$fReadControlResponse$fEqControlResponse$fDataControlResponse$fGenericControlResponse$fShowControlConfig$fEqControlConfigUpdaterupdaterlistenupdates$fApplicativeUpdater$fFunctorUpdater writeCheck readCheckwithQM eStdoutM_"foldl-1.4.5-LJ0a2YZuFPWGh5PU96gyOu Control.FoldlFoldversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName