Îõ³h*<_88š      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹Œ Ž   ‘ ’ “ ” • – — ˜ ™ 0.9.3.2  Safe-Inferred1box!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-InferredboxMonadically Foldablebox/An endofunctor in the category of endofunctors.Like    but without a ¨ constraint.   Safe-InferredÛ Y 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:;<=0-./?>@789ADBCE456123FG:;<=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.ZboxÅ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.\boxÊ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 queuesaboxÅHook a committer action to a queue, creating an emitter continuation.bboxÅHook a committer action to a queue, creating an emitter continuation.QSTRUVW\]^_ab`YXZ[QSTRUVW\]^_ab`YXZ[ Safe-Inferred)2cbox Queue a list R.pushList <$|> qList [1,2,3][1,2,3]dboxQueue a list with an explicit Q.&pushList <$|> qListWith Single [1,2,3][1,2,3]ebox6Directly supply a list to a committer action, via pop.popList [1..3] showStdout123fbox&Push an Emitter into a list, via push.pushList <$|> qList [1..3][1,2,3]gbox&Push an Emitter into a list, finitely.pushListN 2 <$|> qList [1..3][1,2]hbox*Create a finite Committer Unbounded Queue. +glue <$> sink 2 print <*|> qList [1..3] 1 2ibox Create a finite Committer Queue.jbox,Create a finite (Co)Emitter Unbounded Queue.'glue toStdout <$|> source 2 (pure "hi")hihikbox,Create a finite (Co)Emitter Unbounded Queue.2glue toStdout <$|> sourceWith Single 2 (pure "hi")hihilbox=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]mboxBuffer a committer.nboxBuffer an emitter.oboxConcurrently 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])pbox 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: 3qboxTake and queue n emits.import Control.Monad.State.Lazy-toListM <$|> (takeQ Single 4 =<< qList [0..]) [0,1,2,3]rbox1queue a stateful emitter, supplying initial stateimport Control.Monad.State.Lazy8toListM <$|> (evalEmitter 0 <$> takeE 4 =<< qList [0..]) [0,1,2,3]sbox1queue a stateful emitter, supplying initial statecdefghijklmnopqrscdefghijklmnopqrs Safe-Inferred"05tboxEmit text from stdin %»> emit fromStdin hello Just "hello" uboxCommit to stdout*commit toStdout ("I'm committed!" :: Text)I'm committed!TruevboxA :( to and from std, with an escape phrase.wboxFinite console emitter  »> toListM <$|9> fromStdinN 2 hello hello again ["hello","hello again"] xboxFinite console committerÄglue <$> contramap (pack . show) <$> (toStdoutN 2) <*|> qList [1..3]12ybox,Read from console, throwing away read errors Á»> glueN 2 showStdout (readStdin :: Emitter IO Int) 1 1 hippo 2 2zboxShow to stdout!glue showStdout <$|> qList [1..3]123{box"Emits lines of Text from a handle.|box!Commit lines of Text to a handle.}boxEmit 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.ƒbox Convert a :" from ByteString to lines of Text.„box Convert a :# from lines of Text to ByteStrings.…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 emittertuvwxyz…†{|}€~‚ƒ„ˆ‡‰Š‹Œtuvwxyz…†{|}€~‚ƒ„ˆ‡‰Š‹Œ  Safe-Inferred7#boxUsually represents seconds.ŽboxSleep for x seconds.ºbox convenience conversion to Double»box"convenience conversion from DoubleboxAdd the current timeboxAdd 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-Inferred7}Ž!"# $%& 789:;<=0-./456123@?>ADBCEFGš›œžŸ ¡¢£¤¥¦§cdefghijklmnopqrs {tuvwxyz…†|}€~‚ƒ„ˆ‡‰Š‹ŒQSTRUVW\]^_ab`YXZ[˜Ž‘’“”™–•—½ !"#$%&'()*+,-../01234567899:;<=>?@ABCD  EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”• – — ˜ ™ š › œ  ž Ÿ   ¡ ¢£¤¥£¤¥£¤¦£¤§£¤¨£¤©£¤ª£¤«£¤¬£¤­£¤®£¤¯£¤°£¤±²³´²µ¶·¸¹²³º·¸»·¸¼²³½²³¾¿ÀÁÂÃÄÅÆÇÈ É ÊËÌÍÎ"box-0.9.3.2-6IGLEQiRcoV4Ks0SWMJSzZ Box.Codensity Box.Functor Box.Emitter Box.CommitterBox.Box Box.QueueBox.ConnectorsBox.IOBox.TimeboxControl.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 UnboundedBoundedSingleLatestNewestNewtoBoxSTMtoBoxMconcurrentlyLeftconcurrentlyRightqueueLqueueRqueue fromActionfromActionWithemitQcommitQqList qListWithpopListpushList pushListNsinksinkWithsource sourceWithforkEmitbufferCommitter bufferEmitter concurrentE concurrentCtakeQ evalEmitterevalEmitterWith fromStdintoStdoutstdBox fromStdinN toStdoutN readStdin showStdouthandleEhandleCfileE fileETextfileEBSfileC fileCTextfileCBS toLineBox fromLineBox refCommitter refEmitter logConsoleE logConsoleCpauserchangerquitrestartGapsleepstampNowstampEgapsfromGaps fromGapsNow gapEffect speedEffect gapSkipEffectspeedSkipEffectskipreplay+kan-extensions-5.2.6-6b1GQFXlt0l40f5GxkSPNiControl.Monad.Codensity Codensity runCodensityshiftresetimprovelowerCodensitycodensityToAdjunctionadjunctionToCodensitycodensityToComposedRepcomposedRepToCodensitycodensityToRanranToCodensity wrapCodensitybaseGHC.BaseMonad GHC.MaybeMaybe)contravariant-1.5.5-D7uv6gRHfsshi2SiSflrv$Data.Functor.Contravariant.Divisible Decidable AlternativedivideconquerliftA2puredotcoends writeCheck readCheckwithQLwithQRwithQliftB fuseActionsfuseActionsWithfromNominalDiffTimetoNominalDiffTime time-1.12.2&Data.Time.LocalTime.Internal.LocalTime LocalTime