úή:©ÇI      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHNone3:FMU›Given predicates that detect the begining and end of interesting segments of information, scan through a vector looking for when these begin and end.Detect the end of a column.Detect the end of a row.Segment starts and lengthsNone3:FMU©Given predicates that detect the beginning and end of some interesting segment of information, scan through a vector looking for when these segments begin and end.ƒGiven a stream of starting and ending indices for some segments, convert it to a stream of starting indices and segment lengths.pThe ending indices must be after the starting indices, otherwise the result will contain negative lengths.(Predicate to check for start of segment.(Predicate to check for end of segment.!Index of final element in stream.Stream of indices and elements.(Stream of segment start and end indices.Start and end indices.&Start indices and lengths of segments.None3:FMU Interleaved I. ùGiven a vector of starting values, and a vector of stopping values, produce an stream of elements where we increase each of the starting values to the stopping values in a round-robin order. Also produce a vector of result segment lengths. ÿ- unsafeRatchetS [10,20,30,40] [15,26,33,47] = [10,20,30,40 -- 4 ,11,21,31,41 -- 4 ,12,22,32,42 -- 4 ,13,23 ,43 -- 3 ,14,24 ,44 -- 3 ,25 ,45 -- 2 ,46] -- 1 ^^^^ ^^^ Elements Lengths ðThe function takes the starting values in a mutable vector and updates it during computation. Computation proceeds by making passes through the mutable vector and updating the starting values until they match the stopping values. ZUNSAFE: Both input vectors must have the same length, but this is not checked./Starting values. Overwritten duing computation. Ending valuesVector holding segment lengths. None3:FMU=Extract segments from some source array and concatenate them.)Function to get elements from the source.$Segment start positions and lengths.Result elements. Safe-Inferred3:FMU  A strict J type with three parameters. A strict J type, with two parameters.  A strict J type. Convert a J to an  . Convert an   to a J. Convert a J to an . Convert an  to a J. Convert a J to an . Convert an  to a J.        None3:FMUMerge two key-value streams.5The streams are assumed to be pre-sorted on the keys.%Combine two values with the same key.+Handle a left value without a right value.*Handle a right value without a left value.Stream of keys and left values. Stream of keys and right values.Stream of keys and results. None3:FMUÄGiven a stream of keys and values, and a successor function for keys, if the stream is has keys missing in the sequence then insert the missing key, copying forward the the previous value.Successor functinon for keys. Input stream.None3:FMU  Safe-Inferred3:FMU #Result of a chain computation step.)Signal that the computation has finished.Provide just a new seed.%Yield an output value and a new seed.êA chain is an abstract, stateful producer of elements. It is similar a stream as used in stream fusion, except that internal state is visible in its type. This allows the computation to be paused and resumed at a later point.Expected size of the output.Starting state.Step the chain computation.%Lift a pure chain to a monadic chain. 1Resume a chain computation from a previous state.     Safe-Inferred3:FMU!µPerform a left-to-right scan through an input vector, maintaining a state value between each element. For each element of input we may or may not produce an element of output."xFrom a stream of values which has consecutive runs of idential values, produce a stream of the lengths of these runs.!Worker function.Initial state for scan.Input elements. Output elements and final state."Comparison function.Starting element and count.Input elements.!"!" Safe-Inferred3:FMU#AHow to move the input chains after considering to input elements.(0What to do after considering two input elements.)Weave is finished for now.*Move to the next input.+ Give an element and a new state.,Internal state of a weave.KState of the left input chain.L)Current value loaded from the left input.M+Whether we've hit the end of the left inputNState of the right input chain.O*Current value loaded from the right input.P-Whether we've hit the end of the right input.Q(Worker state at this point in the weave.-3A weave is a generalized merge of two input chains.mThe worker function takes the current state, values from the left and right input chains, and produces a (e which describes any output at that point, as well as how the input chains should be advanced..Apply a # instruction to a weave state.#$%&'()*+,RKLMNOPQ-Worker function.Initial state.Left input chain.Right input chain. Result chain.. #$%&'()*+,RKLMNOPQ-.#'&%$(+*),RKLMNOPQ-. Safe-Inferred3:FMU/"Return state of a folds operation.1State of lengths chain.2State of values chain.34If we're currently in a segment, then hold its name,4Length of current segment.5%Accumulated value of current segment.6@Segmented fold over vectors of segment lengths and input values.jThe total lengths of all segments need not match the length of the input elements vector. The returned ­ state can be inspected to determine whether all segments were completely folded, or the vector of segment lengths or elements was too short relative to the other./0123456Worker function.,Initial state when folding rest of segments.1Name, length and initial state for first segment.Segment names and lengths.Input data to fold./0123456/0123456 Safe-Inferred3:FMU! !"#$%&'()*+,-./0123456! -,(+*)#'&%$.6/012345!"None3:FMU7/Unstream some elements to two separate vectors.S values are ignored.87Unstream some elements to two separate mutable vectors.S values are ignored.9&Produce a chain from a generic vector.:&Compute a chain into a generic vector.;.Compute a chain into a generic mutable vector.7 Source data.Resulting vectors.8 Source data.Resulting vectors.T9:;UV789:;789:;78T9:;UVNone3:FMU <&Produce a chain from a generic vector.=Compute a chain into a vector.>&Compute a chain into a mutable vector.? Interleaved I. ùGiven a vector of starting values, and a vector of stopping values, produce an stream of elements where we increase each of the starting values to the stopping values in a round-robin order. Also produce a vector of result segment lengths. ÿ- unsafeRatchetS [10,20,30,40] [15,26,33,47] = [10,20,30,40 -- 4 ,11,21,31,41 -- 4 ,12,22,32,42 -- 4 ,13,23 ,43 -- 3 ,14,24 ,44 -- 3 ,25 ,45 -- 2 ,46] -- 1 ^^^^ ^^^ Elements Lengths @=Extract segments from some source array and concatenate them. £ let arr = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] in extractS (index arr) [(0, 1), (3, 3), (2, 6)] => [10, 13, 14, 15, 12, 13, 14, 15, 16, 17] A'Merge two pre-sorted key-value streams.BµPerform a left-to-right scan through an input vector, maintaining a state value between each element. For each element of input we may or may not produce an element of output.CxFrom a stream of values which has consecutive runs of idential values, produce a stream of the lengths of these runs.  groupsBy (==) (Just (aH, 4)) ['a', 'a', 'a', 'b', 'b', 'c', 'd', 'd'] => ([(a, 7), (b, 2), (c, 1)], Just ('d', 2)) DêGiven predicates that detect the beginning and end of some interesting segment of information, scan through a vector looking for when these segments begin and end. Return vectors of the segment starting positions and lengths.~As each segment must end on a element where the ending predicate returns True, the miniumum segment length returned is 1.EêGiven predicates that detect the beginning and end of some interesting segment of information, scan through a vector looking for when these segments begin and end. Return vectors of the segment starting positions and lengths.F+Dice a vector stream into rows and columns.G@Segmented fold over vectors of segment lengths and input values.jThe total lengths of all segments need not match the length of the input elements vector. The returned /Æ state can be inspected to determine whether all segments were completely folded, or the vector of segment lengths or elements was too short relative to the other. In the resulting state, Ñ is the index into the lengths vector *after* the last one that was consumed. If this equals the length of the lengths vector then all segment lengths were consumed. Similarly for the elements vector.HÄGiven a stream of keys and values, and a successor function for keys, if the stream is has keys missing in the sequence then insert the missing key, copying forward the the previous value. <=>?Starting and ending values.Elements and Lengths vectors.@)Function to get elements from the source.Segment starts and lengths.Result elements.A%Combine two values with the same key.*Handle a left value without a right value.*Handle a right value without a left value.Vector of keys and left values. Vector of keys and right values.Vector of keys and results.BWorker function.Initial state for scan.Input elements.Output elements.CComparison function.Starting element and count.Input elements.D(Predicate to check for start of segment.&Predicate to check for end of segment. Input vector.E(Predicate to check for start of segment.&Predicate to check for end of segment. Input length.Get an element from the input.FDetect the end of a column.Detect the end of a row.Segment starts and lengthsG%Worker function to fold each segment.$Initial state when folding segments.+Length and initial state for first segment.Segment names and lengths. Elements.HSuccessor function.Input keys and values./012345<=>?@ABCDEFGH<=>?@ADEFHBCG/012345 <=>?@ABCDEFGHW  !"#$%& ' ( ) * + , - - . / 0 1 2 3 456789:;<=>?@ABCDEFGHIJKIJKLMNOPQRSTUVWXVYZ[\]^_`a>VYbcdefrepa-stream-4.0.0.1Data.Repa.StreamData.Repa.OptionData.Repa.ChainData.Repa.Vector.GenericData.Repa.Vector.UnboxedData.Repa.Stream.DiceData.Repa.Stream.SegmentData.Repa.Stream.RatchetData.Repa.Stream.ExtractData.Repa.Stream.MergeData.Repa.Stream.PadData.Repa.Chain.BaseData.Repa.Chain.ScanData.Repa.Chain.WeaveData.Repa.Chain.FoldsCFolds foldLensStatediceSepS findSegmentsSstartLengthsOfSegsSunsafeRatchetSextractSOption3None3Some3Option2None2Some2OptionNoneSometoOption fromOption toOption2 fromOption2 toOption3 fromOption3mergeS padForwardSStepDoneSkipYieldChain mchainSize mchainState mchainStep liftChain resumeChain scanMaybeC groupsByCMoveMoveNoneMoveBoth MoveRightMoveLeftTurnFinishNextGiveWeaveweaveCmove _stateLens _stateVals_nameSeg_lenSeg_valSegfoldsCunstreamToVector2unstreamToMVector2 chainOfVectorunchainToVectorunchainToMVectorratchetextractmerge scanMaybegroupsBy findSegmentsfindSegmentsFromdiceSepfolds padForwardbaseGHC.Enum enumFromTo Data.MaybeMaybe_stateL_elemL_endL_stateR_elemR_endR_hereNothingunstreamToMVector2_maxunchainToMVector_maxunchainToMVector_unknown