úÎ!˜ŒĘĀ      !"#$%&'()*+,-./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 absorbs the value being committed; the value disappears into the opaque thing that is a Committer from the pov of usage.boxlift a committer from STMboxdThis 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 upboxiA continuation similar to ` Control.Monad.ContT` but where the result type is swallowed by an existential  None =>?@AHSVXfboxan { "emits" values of type a. A Source & a Producer (of a's) 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.!boxlift an STM emitter"boxlike a monadic mapMaybe. (See  .https://hackage.haskell.org/package/witherable witherable)#box prism handler$boxattoparsec parse emitter%boxread parse emitter#boxbox !"#$% !"#%$None =>?@AHSVX(Þ-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 =>?@AHSVXCĪJboxDhook 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 =>?@AHSVXR~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\ NoneUž_box a funnelerbbox a broadcasterebox!create a (broadcaster, committer)fboxsubscribe to a broadcastergboxcreate a (funneler, emitter)hboxwiden to a funneler _`abcdefgh bcdef_`agh None =>?@AHSVX\t 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.>SXc9rbox$A value with a timestamp annotation.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.printyboxAdd the current timezbox3adding a time stamp todo: how to do this properly? rstuvwxyz vwxrstuyz None =>?@AHSVXpû~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 - commitĸwith 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.ƒboxMonadic version of etc.~€‚ƒ~€‚ƒ None =>?@AHSVX}i…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†å ˜boxShould the box be kept alive?›boxA - that communicates via   and œœbox response ADT box request ADT§boxDefauilt is to let the box die.Ļboxa command-line control box.ĐboxParse command line requestsŠbox)an effect that can be started and stoppedŦboxLsend Start, wait for a Ready signal, run action, wait x secs, then send QuitŽbox!A box with a self-destruct timer.˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ ĄĒĢĪĨ͜žŸ›˜™š§ĻĐŠŦŽNoneESXŒ?đboxZAn updater of a value a, where the updating process consists of an IO fold over an emitterŧbox Create an đ value using a pure Äžbox^run an action on each update > listen mempty = id > > listen (f <> g) = listen g . listen f―box Convert an đ to an Emitter continuation.đšŧž―đšŧž―SafeŒĨÅÆĮČÉĘËĖÍ  !"#$%&'()*+,-../0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk l l m n n o p q r s t u v w x y z { | } } ~  €  ‚ ƒ „ … † ‡ ˆ ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ ” • – — ˜ ™ š › œ  ž Ÿ  ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÂÃÄÅÆĮČÉĘ ËĖÍÎÏÐŅŌÓÔÕÖŨ box-0.2.0-EGKessnexgt3wbLMeHdlLJBox 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.6-8zlRNaYydboLVxQUoKywVZ Control.FoldlFoldversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName