ú· Ü_      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^None3: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 _. ù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>Insert elements produced by the given function in to a stream.%Produce a new element for this index.Source stream. 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. None3: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 lengths None3:FMUCombination of fold and `. |We walk over the stream front to back, maintaining an accumulator. At each point we can chose to emit an element (or not)Like compactr but use the first value of the stream as the initial state, and add the final state to the end of the output.Worker function.Starting stateInput elements.Worker function.Input elements. None3:FMU Return the a& elements from a stream, dropping the bs. Safe-Inferred3:FMU  A strict c type with three parameters.  A strict c type, with two parameters. A strict c type. Convert a c to an . Convert an  to a c. Convert a c to an  . Convert an   to a c. Convert a c to an  . Convert an   to a c.         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.0Internal state of a weave.dState of the left input chain.e)Current value loaded from the left input.f+Whether we've hit the end of the left inputgState of the right input chain.h*Current value loaded from the right input.i-Whether we've hit the end of the right input.j(Worker state at this point in the weave.13A 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.2Apply a ' instruction to a weave state.'()*+,-./0kdefghij1Worker function.Initial state.Left input chain.Right input chain. Result chain.2'()*+,-./0kdefghij12'+*)(,/.-0kdefghij12 Safe-Inferred3:FMU3"Return state of a folds operation.5State of lengths chain.6State of values chain.74If we're currently in a segment, then hold its name,8Length of current segment.9%Accumulated value of current segment.:@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.3456789:Worker function.,Initial state when folding rest of segments.1Name, length and initial state for first segment.Segment names and lengths.Input data to fold.3456789:3456789: Safe-Inferred3:FMU! !"#$%&'()*+,-./0123456789:! !"#$10,/.-'+*)(2:3456789%&None3:FMU;/Unstream some elements to two separate vectors.b values are ignored.<7Unstream some elements to two separate mutable vectors.b values are ignored.=&Produce a chain from a generic vector.>&Compute a chain into a generic vector.?.Compute a chain into a generic mutable vector.@ Interleaved _. ù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 A=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] B=Insert elements produced by the given function into a vector.C'Merge two pre-sorted key-value streams.DLike CE, but only produce the elements where the worker functions return a.Eµ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.FxFrom 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)) Gê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.Hê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.I+Dice a vector stream into rows and columns.JCombination of fold and `. |We walk over the stream front to back, maintaining an accumulator. At each point we can chose to emit an element (or not)KLike Jr but use the first value of the stream as the initial state, and add the final state to the end of the output.L@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 3Æ 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.MÄ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.; Source data.Resulting vectors.< Source data.Resulting vectors.l=>?mn@Starting and ending values.Elements and Lengths vectors.A)Function to get elements from the source.Segment starts and lengths.Result elements.B%Produce a new element for this index.Source vector.C%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.D%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.EWorker function.Initial state for scan.Input elements.Output elements.FComparison function.Starting element and count.Input elements.G(Predicate to check for start of segment.&Predicate to check for end of segment. Input vector.H(Predicate to check for start of segment.&Predicate to check for end of segment. Input length.Get an element from the input.IDetect the end of a column.Detect the end of a row.Segment starts and lengthsJWorker functionStarting state Input vectorKWorker function.Input elements.L%Worker function to fold each segment.$Initial state when folding segments.+Length and initial state for first segment.Segment names and lengths. Elements.MSuccessor function.Input keys and values.3456789;<=>?@ABCDEFGHIJKLM;<=>?@ABCDGHIJKMEFL3456789;<l=>?mn@ABCDEFGHIJKLMNone3:FMUN&Produce a chain from a generic vector.OCompute a chain into a vector.P&Compute a chain into a mutable vector.Q Interleaved _. ù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 R=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] S=Insert elements produced by the given function into a vector.T'Merge two pre-sorted key-value streams.ULike TE, but only produce the elements where the worker functions return a.Vµ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.WxFrom 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)) Xê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.Yê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.Z+Dice a vector stream into rows and columns.[Combination of fold and `. |We walk over the stream front to back, maintaining an accumulator. At each point we can chose to emit an element (or not)\Like [r but use the first value of the stream as the initial state, and add the final state to the end of the output.]@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 3Æ 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.^Ä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.NOPQStarting and ending values.Elements and Lengths vectors.R)Function to get elements from the source.Segment starts and lengths.Result elements.S%Produce a new element for this index.Source vector.T%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.U%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.VWorker function.Initial state for scan.Input elements.Output elements.WComparison function.Starting element and count.Input elements.X(Predicate to check for start of segment.&Predicate to check for end of segment. Input vector.Y(Predicate to check for start of segment.&Predicate to check for end of segment. Input length.Get an element from the input.ZDetect the end of a column.Detect the end of a row.Segment starts and lengths[Worker functionStarting state Input vector\Worker function.Input elements.]%Worker function to fold each segment.$Initial state when folding segments.+Length and initial state for first segment.Segment names and lengths. Elements.^Successor function.Input keys and values.3456789NOPQRSTUVWXYZ[\]^NOPQRSTUXYZ[\^VW]3456789NOPQRSTUVWXYZ[\]^o      !"#$%&'()*+,- ./01234456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`PQRSTUVWXYZ[\]^_`abcadeafgafhafijklmnopEqrstrepa-stream-4.1.0.1Data.Repa.StreamData.Repa.OptionData.Repa.ChainData.Repa.Vector.GenericData.Repa.Vector.UnboxedData.Repa.Stream.SegmentData.Repa.Stream.RatchetData.Repa.Stream.InsertData.Repa.Stream.ExtractData.Repa.Stream.DiceData.Repa.Stream.CompactData.Repa.Stream.ConcatData.Repa.Stream.MergeData.Repa.Stream.PadData.Repa.Chain.BaseData.Repa.Chain.ScanData.Repa.Chain.WeaveData.Repa.Chain.FoldsCFolds foldLensState findSegmentsSstartLengthsOfSegsSunsafeRatchetSinsertSextractSdiceSepScompactS compactInS catMaybesSOption3None3Some3Option2None2Some2OptionNoneSometoOption fromOption toOption2 fromOption2 toOption3 fromOption3mergeS padForwardSStepDoneSkipYieldChain mchainSize mchainState mchainStep liftChain resumeChain scanMaybeC groupsByCMoveMoveNoneMoveBoth MoveRightMoveLeftTurnFinishNextGiveWeaveweaveCmove _stateLens _stateVals_nameSeg_lenSeg_valSegfoldsCunstreamToVector2unstreamToMVector2 chainOfVectorunchainToVectorunchainToMVectorratchetextractinsertmerge mergeMaybe scanMaybegroupsBy findSegmentsfindSegmentsFromdiceSepcompact compactInfolds padForwardbaseGHC.Enum enumFromToGHC.Listfilter Data.MaybeJustNothingMaybe_stateL_elemL_endL_stateR_elemR_endR_hereunstreamToMVector2_maxunchainToMVector_maxunchainToMVector_unknown