h%TO%      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None&'),2347>?K jet-stream2For each value coming from upstream, what has the  learned?Perhaps we should continue some group we have already started in a previous step.Perhaps we have found entire groups that we should emit in one go, groups we know are already complete.Perhaps we should start a new group that will continue in the next steps.  jet-streamThe continued group will be "closed" if in the current step we emit an entire group or we begin a new group. INVARIANT: we should only continue a group if we have already opened a "new one" with one or more elements in an earlier step.  jet-stream(It's ok if the groups we find are empty.  jet-stream INVARIANT: when we are in the final step, we should not yield elements for the beginning of a new one.  jet-streamA  +https://en.wikipedia.org/wiki/Mealy_machine Mealy machine' with an existentially hidden state. Very much like a FoldM IO from the  https://hackage.haskell.org/package/foldl-1.4.12/docs/Control-Foldl.html#t:FoldMfoldl library, but it emits an output at each step, not only at the end. jet-stream+Delimits groups in the values yielded by a R', and can also transform those values. jet-streamA  value knows how to process a sequence of groups, while keeping a (existentially hidden) state for each group.Very much like a FoldM IO from the  https://hackage.haskell.org/package/foldl-1.4.12/docs/Control-Foldl.html#t:FoldMfoldl< library, but "restartable" with a list of starting states.For converting one into the other, this function should do the trick: \(L.FoldM step allocator coda) -> combiners step coda (Prelude.repeat allocator) jet-streamConfiguration record with some extra options in addition to those in  CreateProcess. jet-stream)Configuration record for the worker pool.' jet-streamThe maximum size in bytes of some destination into which we write the bytes produced by a R.) jet-stream FilePaths are plain strings. This newtype provides a small measure of safety over them., jet-stream.Helper multi-parameter typeclass for creating R>-consuming functions out of a variety of common destinations.?J.each ["aaa","bbb","ccc"] <&> J.stringToLine & J.sink J.stdoutaaabbbccc. jet-streamA function that consumes a R2 totally or partially, without returning a result./ jet-streamException thrown when we find newlines in functions which don't accept them.A direct copy of the NewlineForbidden exception from the  *https://hackage.haskell.org/package/turtleturtle package.1 jet-streamA line of text. While it is guaranteed that the 1s coming out of the  function do not contain newlines, that invariant is not otherwise enforced. 3 jet-streamException thrown when we try to write too much data in a size-bounded destination.5 jet-stream8A sequence of bytes that we might want to keep together.: jet-stream.Helper multi-parameter typeclass for creating R. values out of a variety of common sources.Because there's no functional dependency, sometimes we need to use TypeApplications to give the compiler a hint about the type of elements we want to produce. For example, here we want 1s and not, say, s:7action = J.jet @Line (File "foo.txt") & J.sink J.stdoutR jet-streamA R* is a sequence of values produced through  effects.It allows consuming the elements as they are produced and doesn't force them to be present in memory all at the same time, unlike functions like  from base.U jet-stream0Unidirectional pattern that allows converting a 1 into a  during pattern-matching.V jet-stream&Go through the elements produced by a R, while threading an state s% and possibly performing some effect.8The caller is the one who chooses the type of the state s?, and must pass an initial value for it. The state is kept in  https://en.wikibooks.org/wiki/Haskell/Graph_reduction#Weak_Head_Normal_Formweak-head normal form.The caller must also provide a predicate on the state that informs the R when to stop producing values: whenever the predicate returns True.W jet-streamLike V7, but always goes through all elements produced by the R.Equivalent to run (const False).Z jet-stream7Apply an effectful transformation to each element in a R.:{ J.each "abc" & J.traverse (\c -> let c' = succ c in putStrLn ([c] ++ " -> " ++ [c']) *> pure c') & J.toList:}a -> bb -> cc -> d"bcd"\ jet-streamGo through the R only for the * effects, discarding all yielded elements.] jet-streamBuild a R from any  containerJ.each [True,False] & J.toList [True,False]^ jet-stream#J.repeat True & J.take 2 & J.toList [True,True]_ jet-stream=J.repeatIO (putStrLn "hi" *> pure True) & J.take 2 & J.toListhihi [True,True]` jet-streamJ.replicate 2 True & J.toList [True,True]a jet-stream7J.replicateIO 2 (putStrLn "hi" *> pure True) & J.toListhihi [True,True]Don't confuse this with 3Control.Monad.replicateM :: Int -> Jet a -> Jet [a]$ which has a combinatorial behavior.b jet-stream/J.iterate succ (1 :: Int) & J.take 2 & J.toList[1,2]c jet-streamJ.iterateIO (\x -> putStrLn "hi" *> pure (succ x)) (1 :: Int) & J.take 2 & J.toListhi[1,2]d jet-streamJ.unfold (\case [] -> Nothing ; c : cs -> Just (c,cs)) "abc" & J.toList"abc"e jet-stream:{ #J.unfoldIO (\x -> do putStrLn "hi" & pure $ case x of & [] -> Nothing / c : cs -> Just (c,cs))  "abc" & J.toList:} hihihihi"abc"f jet-streamj = J.untilEOF System.IO.hIsEOF System.IO.hGetLine :: Handle -> Jet Stringg jet-stream:{do ref <- newIORef "abc"= let pop = atomicModifyIORef ref (\case [] -> ([], Nothing) x : xs -> (xs, Just x)) J.untilNothing pop & J.toList :}"abc"h jet-stream1Convert to a regular list. This breaks streaming.J.each "abc" & J.toList"abc"Alternatively, we can use  in combination with  form the  )https://hackage.haskell.org/package/foldlfoldl library:'L.purely (J.fold (J.each "abc")) L.list"abc"+which is more verbose, but more composable.i jet-stream.Returns the number of elements yielded by the R, exhausting it in the process.J.each "abc" & J.length3Alternatively, we can use  in combination with  form the  )https://hackage.haskell.org/package/foldlfoldl library:)L.purely (J.fold (J.each "abc")) L.length3+which is more verbose, but more composable.m jet-stream"J.each "abc" & J.drop 2 & J.toList"c"n jet-stream+J.each [1..5] & J.dropWhile (<3) & J.toList[3,4,5]p jet-stream"J.each "abc" & J.take 2 & J.toList"ab"q jet-stream Synonym for p.r jet-stream*J.each [1..] & J.takeWhile (<5) & J.toList [1,2,3,4]t jet-stream*J.each "abc" & J.filter (=='a') & J.toList"a"v jet-streamBehaves like a combination of  and ; it applies a function to each element of a structure passing an accumulating parameter from left to right.The resulting R5 has the same number of elements as the original one.Unlike -, it doesn't make the final state available. >J.each [1,2,3,4] & J.mapAccum (\a b -> (a + b,a)) 0 & J.toList [0,1,3,6]x jet-stream+J.each "abc" & J.intersperse '-' & J.toList"a-b-c"y jet-stream%J.each "abc" & J.zip [1..] & J.toList[(1,'a'),(2,'b'),(3,'c')]%J.each [1..] & J.zip "abc" & J.toList[('a',1),('b',2),('c',3)]| jet-streamZips a list of  actions with a R5, where the combining function can also have effects.)If the list of actions is exhausted, the R stops:J.each [1..] <&> show & zipWithIO (\c1 c2 -> putStrLn (c1 ++ c2)) [pure "a", pure "b"] & J.toLista1b2[(),()]} jet-streamOpens a file and makes the 8 available to all following statements in the do-block.*Notice that it's often simpler to use the : (for reading) and , (for writing) instances of ).~ jet-stream:{do r <- J.bracket (putStrLn "allocating" *> pure "foo") (\r -> putStrLn $ "deallocating " ++ r)- liftIO $ putStrLn $ "using resource " ++ r& drain:} allocatingusing resource foodeallocating foo jet-stream5Notice how the finalizer runs even when we limit the R::{ 9do J.finally (putStrLn "hi") -- protects statements below liftIO (putStrLn "hey") J.each "abc" & J.limit 2 & J.toList:}heyhi"ab"But if the protected R5 is not consumed at all, the finalizer might not run.:{:do J.finally (putStrLn "hi") -- protects statements below  liftIO (putStrLn "hey")  J.each "abc" & J.limit 0 & J.toList:}"" jet-streamLift a control operation (like 6) for which the callback uses the allocated resource. jet-streamLift a control operation (like =) for which the callback doesn't use the allocated resource. jet-stream"morally", all control operations compatible with this library should execute the callback only once, which means that they should have a linear type. But because linear types are not widespread, they usually are given a less precise non-linear type. If you know what you are doing, use this function to give them a linear type. jet-streamLine <, for when the callback doesn't use the allocated resource. jet-stream>L.purely (J.fold (J.each "abc")) ((,) <$> L.list <*> L.length) ("abc",3) jet-streamL.impurely (J.foldIO (J.each "abc")) (L.FoldM (\() c -> putStrLn [c]) (pure ()) pure *> L.generalize L.length)abc3 jet-streamSplits a stream of bytes into groups bounded by maximum byte sizes. When one group "fills up", the next one is started.When the list of buckets sizes is exhausted, all incoming bytes are put into the same unbounded group.Useful in combination with . jet-stream Constructs a 5 out of the bytes of some  container. jet-streamLength in bytes. jet-streamSplits a stream of  ByteBundles into groups bounded by maximum byte sizes. Bytes belonging to the same 5 are always put in the same group. When one group "fills up", the next one is started.When the list of buckets sizes is exhausted, all incoming bytes are put into the same unbounded group.Useful in combination with .THROWS: 3 exception if the size bound of a group turns out to be too small for holding even a single 5 value. jet-streamTHROWS:  jet-stream Converts a 1* back to text, without adding the newline. jet-stream Converts a 1 to an utf8-encdoed 5, without adding the newline. jet-stream Data.Text.singleton '\n' jet-stream Adds the  to the beginning of the 1. jet-stream+Process the values yielded by the upstream R in a concurrent way, and return the results in the form of another R as they are produced.NB: this function might scramble the order of the returned values. Right now there isn't a function for unscrambling them.:{# J.each [(3,'a'), (2,'b'), (1,'c')] & J.traverseConcurrently (numberOfWorkers 10) (\(d,c) -> threadDelay (d*1e5) *> pure c) & J.toList:}"cba"What happens if we q the resulting R and we reach that limit, or if we otherwise stop consuming the R8 before it gets exhausted? In those cases, all pending IO b tasks are cancelled.:{& J.each [(9999,'a'), (2,'b'), (1,'c')] & J.traverseConcurrently (numberOfWorkers 10) (\(d,c) -> threadDelay (d*1e5) *> pure c) & J.take 2 & J.toList:}"cb" jet-stream?Size of the waiting queue into the worker pool. The default is 1. jet-stream,The size of the worker pool. The default is 1. jet-streamSize of the queue holding results out of the working pool before they are yielded downstream. The default is 1. jet-stream An alias for . Useful with functions like  and 5, for which it means "use the default configuration". jet-streamFeeds the upstream R to an external process' stdin and returns the process' stdout as another Jet. The feeding and reading of the standard streams is done concurrently in order to avoid deadlocks.What happens if we q the resulting R and we reach that limit, or if we otherwise stop consuming the R before it gets exhausted? In those cases, the external process is promptly terminated. jet-streamLike , but feeding and reading 1%s using the default system encoding.:{J.each ["aaa","bbb","ccc"]<&> J.stringToLine,& linesThroughProcess defaults (shell "cat") & J.toList:}["aaa","bbb","ccc"]An example of not reading all the lines from a long-lived process that gets cancelled::{mempty& linesThroughProcess defaults (shell "{ printf \"aaa\\nbbb\\nccc\\n\" ; sleep infinity ; }") & J.limit 2 & J.toList:} ["aaa","bbb"] jet-streamLike , but feeding and reading 1s encoded in UTF8. jet-streamShould we buffer the process' stdin? Usually should be  for interactive scenarios. By default, . jet-streamSets the function that reads a single line of output from the process stderr . It's called repeatedly until stderr is exhausted. The reads are done concurrently with the reads from stdout.By default, lines of text are read using the system's default encoding.This is a good place to throw an exception if we don't like what comes out of stderr. jet-stream)Sets the function that handles the final  of the process.%The default behavior is to throw the ( as an exception if it's not a success. jet-streamThis is a complex, unwieldly, yet versatile function. It can be used to define grouping operations, but also for decoding and other purposes."Groups are delimited in the input R using the <, and the contents of those groups are then combined using 8. The result of each combiner is yielded by the return R.If the list of combiners is finite and becomes exhausted, we stop splitting and the return R stops. jet-streamConstructor for  values. jet-streamA simpler version of  that doen't thread a state; it merely allocates and deallocates the resource h. jet-stream thread a state s while processing each group. Sometimes, in addition to that, we want to allocate a resource h when we start processing a group, and deallocate it after we finish processing the group or an exception is thrown. The typical example is allocating a 7 for writing the elements of the group as they arrive. jet-streamPuts the elements of each group into a list that is kept in memory. This breaks streaming within the group. Useful with . jet-stream.A failed pattern-match in a do-block produces . :{:do Just c <- J.each [Nothing, Just 'a', Nothing, Just 'b'] pure c & J.toList:}"ab" jet-streamSame as  jet-streamSame as . jet-stream is the empty R.*mempty <> J.each "ab" <> mempty & J.toList"ab" jet-streamR concatenation.%J.each "ab" <> J.each "cd" & J.toList"abcd" jet-stream=liftIO (putStrLn "foo") <> liftIO (putStrLn "bar") & J.toListfoobar[(),()] jet-stream9Similar to the instance for pure lists, that does search.:{do string <- J.each ["ab","cd"] J.each string&J.toList:}"abcd" jet-streamSimilar to the instance for pure lists, that generates combinations..(,) <$> J.each "ab" <*> J.each "cd" & J.toList)[('a','c'),('a','d'),('b','c'),('b','d')] jet-streamUses the default system locale. jet-streamUses the default system locale. jet-stream.Uses the default system locale. Adds newlines. jet-streamDistributes incoming bytes through a sequence of files. Once a file is full, we start writing the next one.Each 5 value is garanteed to be written to a single file. If a file turns out to be too small for even a single 5 value, a 3 exception is thrown. jet-streamDistributes incoming bytes through a sequence of files. Once a file is full, we start writing the next one. jet-stream Maps over the yielded elements. & can be used to put the function last.J.each "aa" <&> succ & J.toList"bb" jet-stream*The step function which threads the state. jet-stream0The final output, produced from the final state. jet-stream*An action that produces the initial state.~ jet-stream allocator jet-stream finalizer jet-stream allocator jet-stream finalizer  jet-stream allocator jet-stream finalizer jet-stream%Step function that threads the state s. jet-stream!Coda invoked when a group closes. jet-stream(Actions that produce the initial states s for processing each group. jet-stream)Step function that accesses the resource h. jet-streamFinalizer to run after closing each group, and also in the case of an exception.  jet-stream.Actions that allocate a sequence of resources h. jet-streamThe # value should be consumed linearly. jet-stream)Step function that accesses the resource h and threads the state s. jet-stream!Coda invoked when a group closes. jet-streamFinalizer to run after each coda, and also in the case of an exception.  jet-stream.Actions that allocate a sequence of resources h and produce initial states s for processing each group. jet-streamThe # value should be consumed linearly.  #"!$%&'()*+,-./0123456798:;EGFHJIKMLNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~RSTVWXYZ[\]^_`abcdefghiPQjkNOlmKMLnopqHJIrstuvwEGFxyz{|}~:;798563412U/0.,-)*+'($%& #"!  NoneM '()*+,-.1U345:;<>=?@ABCDRVWXYZ[\]^_`abcdefghimnopqrstuvwxyz{|}~RVW\]^_`abcdefghiZ[XYtupqrsmnovwxyz{|}~<>=?@ABCD51UU:;,-.)*+'(34       !!"#$%&'(()*+,,-..//0123445677889:;<=>?>@ABCDEFGHIJKLMNOOPPQ5RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~y|jet-stream-1.0.0.0-inplaceJet Jet.Internal Control.FoldllistlengthbaseGHC.IO.StdHandlesstderrstdinstdout Data.Function& Data.Functor<&> text-1.2.4.1Data.Text.Encoding.ErrorUnicodeExceptionprocess-1.6.11.0System.ProcessprocshellSplitStepResult$continuationOfPreviouslyStartedGroup entireGroupsstartOfNewGroupMealyIOSplitter Combiners RecastStateAreWeInsideGroup OutsideGroup InsideGroup ProcConf_ _bufferStdin _writeToStdIn_readFromStdout_readFromStderr_handleExitCodeProcConfPoolConf_inputQueueSize_numberOfWorkers_outputQueueSizeDListrunDList BoundedSizeFile getFilePathJetSinksinkSinkNewlineForbiddenLineLine_BucketOverflow ByteBundle AmIContinuing Continuing NotContinuing JetSourcejet ChunkSizeDefaultChunkSize ChunkSize1K ChunkSize4K ChunkSize8K ChunkSize16K ChunkSize1M ChunkSize2MTouched NotYetTouchedAlreadyTouched TakeState StillTaking TakingNoMore DropState StillDroppingDroppingNoMoreTriplePairrunJetrunconsumeforfor_traverse traverse_draineachrepeatrepeatIO replicate replicateIOiterate iterateIOunfoldunfoldIOuntilEOF untilNothingtoList pairExtractpairEnv tripleExtractdrop dropWhile dropWhileIOtakelimit takeWhile takeWhileIOfilterfilterIOmapAccum mapAccumIO interspersezipzipWithzipIO zipWithIOwithFilebracketbracket_bracketOnErrorfinally onExceptioncontrolcontrol_unsafeCoerceControlunsafeCoerceControl_foldfoldIO chunkSizebytesaccumByteLengthsbytesOverBucketsbundle bundleLength bundleBytesbyteBundlesOverBuckets decodeUtf8 encodeUtf8 lineToText lineToUtf8 textToLinenewline textToUtf8 lineContainslineBeginsWith prefixLine stringToLine isEmptyLine emptyLineremoveTrailingCarriageReturnlinesunlines downstream makeAllocator makeDList closeDList singletontraverseConcurrentlydefaultPoolConfinputQueueSizenumberOfWorkersoutputQueueSizedefaultsthroughProcesslinesThroughProcessutf8LinesThroughProcessthroughProcess_defaultProcConf bufferStdinreadFromStderrhandleExitCoderecast combinerswithCombiners_ withCombinerscombineIntoLists$fMonadFailJet$fMonadPlusJet$fAlternativeJet $fMonoidJet$fSemigroupJet $fMonadIOJet $fMonadJet$fApplicativeJet$fJetSourceByteStringHandle$fExceptionBucketOverflow$fJetSourceLineHandle$fExceptionNewlineForbidden$fJetSinkByteBundleHandle$fJetSinkTextHandle$fJetSinkLineHandle$fJetSinkByteStringHandle$fJetSinkaFile$fJetSourceaFile$fJetSinkByteBundle[]$fJetSinkByteString[] $fMonoidDList$fSemigroupDList$fMonoidSplitStepResult$fSemigroupSplitStepResult$fFunctorSplitStepResult$fShowSplitStepResult$fShowPoolConf$fShowBoundedSize$fReadBoundedSize $fShowFile$fShowNewlineForbidden$fEqLine $fOrdLine$fSemigroupLine $fMonoidLine $fShowLine$fIsStringLine$fShowBucketOverflow$fShowByteBundle$fSemigroupByteBundle$fMonoidByteBundle$fShowAmIContinuing$fShowChunkSize $fShowPair$fFunctorMealyIO$fFunctorCombiners $fFunctorJetbytestring-0.10.12.1Data.ByteString.Internal ByteStringghc-prim GHC.TypesIO Control.Monad replicateMData.Text.InternalText Data.FoldableFoldableGHC.BasefmapfoldlData.Traversable mapAccumLGHC.IO.Handle.TypesHandleControl.Exception.BaseidTrueFalseGHC.IO.ExceptionExitCodemzeroMonoidmempty