Îõ³h&;T7@•      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ ‰ Š ‹ Œ  Ž   ‘ ’ “ ”  Safe-Inferredbox!close the Codensity continuation.(close $ glue showStdout <$> qList [1..3]123boxfmap then close a continuation.(process (glue showStdout) (qList [1..3])123boxfmap then close a continuation.!glue showStdout <$|> qList [1..3]123box$apply and then close a continuation.,glue <$> (pure showStdout) <*|> qList [1..3]123•–—˜™š›œžŸ ¡¢03 Safe-InferredñboxMonadically Foldablebox/An endofunctor in the category of endofunctors.Like    but without a £ constraint.   Safe-InferredÚ 7 boxAn   continuation. boxAn    s values of type ¤› a. Source and producer are similar metaphors. An Emitter reaches into itself for the value to emit, where itself is an opaque thing from the pov of usage.'e = Emitter (pure (Just "I'm emitted"))emit eJust "I'm emitted" emit memptyNothingbox:Collect emits into a list, and close on the first Nothing.toListM <$|> qList [1..3][1,2,3]box A monadic .https://hackage.haskell.org/package/witherable WitherableçtoListM <$|> witherE (\x -> bool (print x >> pure Nothing) (pure (Just x)) (even x)) <$> (qList [1..3])1[]box4Like witherE but does not emit Nothing on filtering.çtoListM <$|> filterE (\x -> bool (print x >> pure Nothing) (pure (Just x)) (even x)) <$> (qList [1..3])13[2]box Read parse  &, returning the original text on errorË(toListM . readE) <$|> (qList ["1","2","3","four"]) :: IO [Either Text Int]%[Right 1,Right 2,Right 3,Left "four"]box7Convert a list emitter to a (Stateful) element emitter.import Control.Monad.State.LazyÂflip runStateT [] . toListM . unlistE <$|> (qList [[0..3],[5..7]])([0,1,2,3,5,6,7],[])box Take n emits.import Control.Monad.State.Lazy8flip evalStateT 0 <$|> toListM . takeE 4 <$> qList [0..] [0,1,2,3]box Drop n emits.import Control.Monad.State.Lazy'toListM <$|> (dropE 2 =<< qList [0..3])[2,3]box'Take from an emitter until a predicate./(toListM . takeUntilE (==3)) <$|> (qList [0..])[0,1,2]boxPop from a State sequence.%import qualified Data.Sequence as Seq,import Control.Monad.State.Lazy (evalStateT)3flip evalStateT (Seq.fromList [1..3]) $ toListM pop[1,2,3]boxÑThis fold completes on the first Nothing emitted, which may not be what you want.   Safe-Inferredó box! continuation.!box A Committer #ñs values of type a and signals success or otherwise. A sink or 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. commit toStdout "I'm committed!"I'm committed!True$box A monadic .https://hackage.haskell.org/package/witherable WitherableÙglue (witherC (\x -> pure $ bool Nothing (Just x) (even x)) showStdout) <$|> qList [0..5]024%box+Convert a committer to be a list committer.#glue showStdout <$|> qList [[1..3]][1,2,3]+glue (listC showStdout) <$|> qList [[1..3]]123&boxPush to a state sequence.import Control.Monad.State.Lazy%import qualified Data.Sequence as SeqÄflip execStateT Seq.empty . glue push . foist lift <$|> qList [1..3]fromList [1,2,3] !"#$%&!"# $%& Safe-Inferred-boxbox+Wrong kind signature for the FFunctor class?boxA profunctor dimapMaybe@box qList [1..3]123Abox€Connect an emitter directly to a committer of the same type, returning whether the emitter or committer caused eventual closure."glue' showStdout <$|> qList [1..3]123 EmitterClosedBboxãConnect a Stateful emitter to a (non-stateful) committer of the same type, supplying initial state.5glueES 0 (showStdout) <$|> (takeE 2 <$> qList [1..3])12CboxéConnect a Stateful emitter to a (similarly-stateful) committer of the same type, supplying initial state.?glueS 0 (foist lift showStdout) <$|> (takeE 2 <$> qList [1..3])12Dbox0Glues a committer and emitter, and takes n emits,glueN 3 <$> pure showStdout <*|> qList [1..]123—Note that glueN counts the number of events passing across the connection and doesn't take into account post-transmission activity in the Committer, egãglueN 4 (witherC (\x -> bool (pure Nothing) (pure (Just x)) (even x)) showStdout) <$|> qList [0..9]02Ebox,Glue a Committer to an Emitter within a box. ,fuse (pure . pure) == \(Box c e) -> glue c eA command-line echoer :fuse (pure . Just . ("echo " <>)) (Box toStdout fromStdin)FboxConstruct a CoBox cobox = Box <$> c <*> eÜfuse (pure . Just . ("show: " <>) . pack . show) <$|> (cobox (pure toStdout) (qList [1..3]))show: 1show: 2show: 3GboxState monad queue.«box cps composition of monadic boxes-./0123456789:;<=>?@ABCDEFG:;<=0-./?>@789ADBCE456123FG Safe-Inferred•QboxQ" specifies how messages are queued¬box:create a queue, supplying the ends and a sealing function.­box#write to a queue, checking the seal®box*read from a queue, and retry if not sealedXbox$turn a queue into a box (and a seal)YboxÐturn a queue into a box (and a seal), and lift from stm to the underlying monad.¯boxÅrun two actions concurrently, but wait and return on the left result.°boxÆrun two actions concurrently, but wait and return on the right result.±boxëconnect a committer and emitter action via spawning a queue, and wait for the Committer action to complete.²boxéconnect a committer and emitter action via spawning a queue, and wait for the Emitter action to complete.³boxÛconnect a committer and emitter action via spawning a queue, and wait for both to complete.ZboxÊCreate an unbounded queue, returning the result from the Committer action.[boxÈCreate an unbounded queue, returning the result from the Emitter action.\box2Create an unbounded queue, returning both results.8queue Unbounded (\c -> glue c <$|> qList [1..3]) toListM ((),[1,2,3])´boxlift a box from STM]box)Turn a box action into a box continuation^box)Turn a box action into a box continuationµbox3Connect up two box actions via two Unbounded queues¶box)Connect up two box actions via two queues_boxÅHook a committer action to a queue, creating an emitter continuation.`boxÅHook a committer action to a queue, creating an emitter continuation.QSTRUVWXYZ[\]^_`QSTRUVWZ[\]_`^YX Safe-Inferred)abox Queue a list R.pushList <$|> qList [1,2,3][1,2,3]bboxQueue a list with an explicit Q.&pushList <$|> qListWith Single [1,2,3][1,2,3]cbox6Directly supply a list to a committer action, via pop.popList [1..3] showStdout123dbox&Push an Emitter into a list, via push.pushList <$|> qList [1..3][1,2,3]ebox&Push an Emitter into a list, finitely.pushListN 2 <$|> qList [1..3][1,2]fbox*Create a finite Committer Unbounded Queue.'glue <$> sink 2 print <*|> qList [1..3]12gbox Create a finite Committer Queue.hbox,Create a finite (Co)Emitter Unbounded Queue.'glue toStdout <$|> source 2 (pure "hi")hihiibox,Create a finite (Co)Emitter Unbounded Queue.2glue toStdout <$|> sourceWith Single 2 (pure "hi")hihijbox=Glues an emitter to a committer, then resupplies the emitter.:(c1,l1) <- refCommitter :: IO (Committer IO Int, IO [Int])=close $ toListM <$> (forkEmit <$> (qList [1..3]) <*> pure c1)[1,2,3]l1[1,2,3]kboxBuffer a committer.lboxBuffer an emitter.mboxConcurrently run two emitters.+This differs to (<>), which is left-biased.ìNote that functions such as toListM, which complete on the first Nothing emitted, will not work as expected.Ôclose $ (fmap toListM) (join $ concurrentE Single <$> qList [1..3] <*> qList [5..9])[1,2,3]5In the code below, the ordering is non-deterministic. Œ(c,l) <- refCommitter :: IO (Committer IO Int, IO [Int]) close $ glue c <$> (join $ concurrentE Single <$> qList [1..30] <*> qList [40..60])nbox Concurrently run two committers.!import Data.Functor.Contravariantimport Data.Text (pack)ÊcFast = witherC (\b -> pure (Just b)) . contramap ("fast: " <>) $ toStdout×cSlow = witherC (\b -> sleep 0.1 >> pure (Just b)) . contramap ("slow: " <>) $ toStdoutæclose $ (popList ((pack . show) <$> [1..3]) <$> (concurrentC Unbounded cFast cSlow)) <> pure (sleep 1)fast: 1fast: 2fast: 3slow: 1slow: 2slow: 3oboxTake and queue n emits.import Control.Monad.State.Lazy-toListM <$|> (takeQ Single 4 =<< qList [0..]) [0,1,2,3]pbox1queue a stateful emitter, supplying initial stateimport Control.Monad.State.Lazy8toListM <$|> (evalEmitter 0 <$> takeE 4 =<< qList [0..]) [0,1,2,3]qbox1queue a stateful emitter, supplying initial stateabcdefghijklmnopqabcdefghijklmnopq Safe-Inferred"/WrboxEmit text from stdin %»> emit fromStdin hello Just "hello" sboxCommit to stdout*commit toStdout ("I'm committed!" :: Text)I'm committed!TruetboxFinite console emitter  »> toListM <$|9> fromStdinN 2 hello hello again ["hello","hello again"] uboxFinite console committerÄglue <$> contramap (pack . show) <$> (toStdoutN 2) <*|> qList [1..3]12vbox,Read from console, throwing away read errors Á»> glueN 2 showStdout (readStdin :: Emitter IO Int) 1 1 hippo 2 2wboxShow to stdout!glue showStdout <$|> qList [1..3]123xbox"Emits lines of Text from a handle.ybox!Commit lines of Text to a handle.zboxEmit from a file.{boxEmit lines of Text from a file.|box%Emit lines of ByteString from a file.}boxCommit to a file.~box!Commit Text to a file, as a line.box'Commit ByteString to a file, as a line.€boxCommit to an IORef:(c1,l1) <- refCommitter :: IO (Committer IO Int, IO [Int])glue c1 <$|> qList [1..3]l1[1,2,3]boxEmit from a list IORefe <- refEmitter [1..3] toListM e[1,2,3]‚box'simple console logger for rough testingƒbox'simple console logger for rough testing„box(Pause an emitter based on a Bool emitter…boxÂCreate an emitter that indicates when another emitter has changed.†box&quit a process based on a Bool emitter Ïquit <$> speedEffect (pure 2) <$> (resetGap 5) <*|> pure io 0 1 2 3 4 Left True‡box.restart a process if flagged by a Bool emitterrstuvwxyz{|}~€‚ƒ„…†‡rstuvw€xyz}{|~ƒ‚„…†‡  Safe-Inferred65ˆboxUsually represents seconds.‰boxSleep for x seconds.·box convenience conversion to Double¸box"convenience conversion from DoubleŠboxAdd the current time‹boxAdd the current time stamp. > toListM . stampE  $|ï (qList [1..3]) [(2022-08-30 01:55:16.517127,1),(2022-08-30 01:55:16.517132,2),(2022-08-30 01:55:16.517135,3)] Œbox7Convert stamped emitter to gap between emits in seconds ítoListM <$|> (gaps =<< (fromGapsNow =<< (qList (zip (0:repeat 1) [1..4])))) [(0.0,1),(1.0,2),(1.0,3),(1.0,4)]boxÄConvert gaps in seconds to stamps starting from an initial supplied ¹Žbox (fromGapsNow =<< (qList (zip (0:repeat 1) [1..4]))) [(2022-08-30 22:57:33.835228,1),(2022-08-30 22:57:34.835228,2),(2022-08-30 22:57:35.835228,3),(2022-08-30 22:57:36.835228,4)]boxÐConvert a (Gap,a) emitter to an a emitter, with delays between emits of the gap.box (replay 0.1 1 =<< (fromGapsNow =<< (qList (zip (0:repeat 1) [1..4])))) [(2022-08-31 02:29:39.643831,1),(2022-08-31 02:29:39.643841,2),(2022-08-31 02:29:39.746998,3),(2022-08-31 02:29:39.849615,4)] ˆ‰Š‹ŒŽ‘’“” ‰Š‹ˆŒŽ“”‘’  Safe-Inferred6‰•–—˜™š›œžŸ ¡¢  !"#$%&-./0123456789:=;<>?@ABCDEFGQWVURSTXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”º  !"#$%&'()*+,--./01234567889:;<=>?@ABC  DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ  ‘ ’ “ ” • – — ˜ ™ š › œžŸž ž¡ž¢ž£ž¤ž¥ž¦ž§ž¨ž©žªžªž«¬­®¬¯°±²³¬­´±²µ±²¶¬­·¬­¸¹º»¼½¾¿ÀÁÂÃÄ Å ÆÇÈÉÊ"box-0.9.2.0-IkqeCvBvVzjEChL5zQSsbv Box.Codensity Box.Functor Box.Emitter Box.CommitterBox.Box Box.QueueBox.ConnectorsBox.IOBox.TimeControl.Monad.MorphMFunctorBoxcloseprocess<$|><*|>$fMonoidCodensity$fSemigroupCodensity FoldableMfoldrMFFunctorfoist CoEmitterEmitteremittoListMwitherEfilterEreadEunlistEtakeEdropE takeUntilEpop$fFoldableMEmitter$fMonoidEmitter$fSemigroupEmitter$fMonadPlusEmitter$fAlternativeEmitter$fMonadEmitter$fApplicativeEmitter$fFunctorEmitter$fFFunctorEmitter CoCommitter CommittercommitwitherClistCpush$fDecidableCommitter$fDivisibleCommitter$fContravariantCommitter$fMonoidCommitter$fSemigroupCommitter$fFFunctorCommitterCoBoxMuncoboxCoBoxDecAltchoicelossDivapdivapconpurClosureCommitterClosed EmitterClosed committeremitterfoistbbmapglueglue'glueESglueSglueNfusecoboxseqBox $fMonoidBox$fSemigroupBox$fProfunctorBox $fDivapBox $fDecAltBox$fSemigroupoidTYPECoBoxM $fEqClosure $fShowClosure $fOrdClosureQueue UnboundedBoundedSingleLatestNewestNewtoBoxSTMtoBoxMqueueLqueueRqueue fromActionfromActionWithemitQcommitQqList qListWithpopListpushList pushListNsinksinkWithsource sourceWithforkEmitbufferCommitter bufferEmitter concurrentE concurrentCtakeQ evalEmitterevalEmitterWith fromStdintoStdout fromStdinN toStdoutN readStdin showStdouthandleEhandleCfileE fileETextfileEBSfileC fileCTextfileCBS refCommitter refEmitter logConsoleE logConsoleCpauserchangerquitrestartGapsleepstampNowstampEgapsfromGaps fromGapsNow gapEffect speedEffect gapSkipEffectspeedSkipEffectskipreplay+kan-extensions-5.2.5-ACMNEk1apxpCy75jULJkDEControl.Monad.Codensityshiftreset wrapCodensityimproveranToCodensitycodensityToRancomposedRepToCodensitycodensityToComposedRepadjunctionToCodensitycodensityToAdjunctionlowerCodensity Codensity runCodensitybaseGHC.BaseMonad GHC.MaybeMaybe*contravariant-1.5.5-469aslisNQV7ShPhxUzaR3$Data.Functor.Contravariant.Divisible Decidable AlternativedivideconquerliftA2puredotcoends writeCheck readCheckconcurrentlyLeftconcurrentlyRightwithQLwithQRwithQliftB fuseActionsfuseActionsWithfromNominalDiffTimetoNominalDiffTime time-1.11.1.1&Data.Time.LocalTime.Internal.LocalTime LocalTime