úΪ@X      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWNone4;GNV©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.None4;GNVSegmented replicate.~Given a stream of counts and values, produce a result stream where each value is replciated the associated number of times.None4;GNV Interleaved X. ù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.None4;GNVÄ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. None4;GNVMerge 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. None4;GNV>Insert elements produced by the given function in to a stream.%Produce a new element for this index.Source stream. None4;GNV=Extract segments from some source array and concatenate them.)Function to get elements from the source.$Segment start positions and lengths.Result elements. None4;GNV›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 None4;GNV Combination of fold and Y. |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.  None4;GNV  Return the Z& elements from a stream, dropping the [s.   None4;GNV  Safe4;GNV #Result of a chain computation step. %Yield an output value and a new seed.Provide just a new seed.)Signal that the computation has finished.ê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.    Safe4;GNVSegmented unfold.[The worker function takes the current element from the input stream and current state. «If the worker returns Just x then that output element will be placed in the output stream, and it will be called again with the same input elemenent and next state. YIf the worker returns Nothing then we advance to the next element of the input stream.µ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 the unfold.Input elements.Output elements.Worker function.Initial state for scan.Input elements. Output elements and final state.Comparison function.Starting element and count.Input elements.Safe4;GNVAHow to move the input chains after considering to input elements.$0What to do after considering two input elements.% Give an element and a new state.&Move to the next input.'Weave is finished for now.(Internal state of a weave.\State of the left input chain.])Current value loaded from the left input.^+Whether we've hit the end of the left input_State of the right input chain.`*Current value loaded from the right input.a-Whether we've hit the end of the right input.b(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. !"#$%&'(c\]^_`ab)Worker function.Initial state.Left input chain.Right input chain. Result chain.*def !"#$%&'(c\]^_`ab)* !"#$%&'(c\]^_`ab)*Safe4;GNV+"Return state of a folds operation.-State of lengths chain..State of values chain./4If we're currently in a segment, then hold its name,0Length of current segment.1%Accumulated value of current segment.2@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.+,-./012Worker function.,Initial state when folding rest of segments.1Name, length and initial state for first segment.Segment names and lengths.Input data to fold.+,-./012+,-./012Safe4;GNV'  !"#$%&'()*+,-./012' )($%&' !"#*2+,-./01None4;GNV3/Unstream some elements to two separate vectors.[ values are ignored.47Unstream some elements to two separate mutable vectors.[ values are ignored.5Combination of fold and Y. |We walk over the stream front to back, maintaining an accumulator. At each point we can chose to emit an element (or not)6Like 5r but use the first value of the stream as the initial state, and add the final state to the end of the output.7ê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.8ê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.9+Dice a vector stream into rows and columns.:=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] ;=Insert elements produced by the given function into a vector.<'Merge two pre-sorted key-value streams.=Like <E, but only produce the elements where the worker functions return Z.>Ä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.? Interleaved X. ù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 @Segmented replicate.A&Produce a chain from a generic vector.B&Compute a chain into a generic vector.C.Compute a chain into a generic mutable vector.D@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.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)) 3 Source data.Resulting vectors.4 Source data.Resulting vectors.g5Worker functionStarting state Input vector6Worker function.Input elements.7(Predicate to check for start of segment.&Predicate to check for end of segment. Input vector.8(Predicate to check for start of segment.&Predicate to check for end of segment. Input length.Get an element from the input.9Detect the end of a column.Detect the end of a row.Segment starts and lengths:)Function to get elements from the source.Segment starts and lengths.Result elements.;%Produce a new element for this index.Source vector.<%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.=%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.>Successor function.Input keys and values.?Starting and ending values.Elements and Lengths vectors.@ABChiD%Worker function to fold each segment.$Initial state when folding segments.+Length and initial state for first segment.Segment names and lengths. Elements.EWorker function.Initial state for scan.Input elements.Output elements.FComparison function.Starting element and count.Input elements.+,-./013456789:;<=>?@ABCDEF3456789:;<=>?@ABCD+,-./01EF34g56789:;<=>?@ABChiDEFNone4;GNVG&Produce a chain from a generic vector.HCompute a chain into a vector.I&Compute a chain into a mutable vector.J Interleaved X. ù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 K=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] L=Insert elements produced by the given function into a vector.M'Merge two pre-sorted key-value streams.NLike ME, but only produce the elements where the worker functions return Z.Oµ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.PxFrom 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)) Qê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.Rê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.S+Dice a vector stream into rows and columns.TCombination of fold and Y. |We walk over the stream front to back, maintaining an accumulator. At each point we can chose to emit an element (or not)ULike Tr but use the first value of the stream as the initial state, and add the final state to the end of the output.V@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.WÄ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.GHIJStarting and ending values.Elements and Lengths vectors.K)Function to get elements from the source.Segment starts and lengths.Result elements.L%Produce a new element for this index.Source vector.M%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.N%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.OWorker function.Initial state for scan.Input elements.Output elements.PComparison function.Starting element and count.Input elements.Q(Predicate to check for start of segment.&Predicate to check for end of segment. Input vector.R(Predicate to check for start of segment.&Predicate to check for end of segment. Input length.Get an element from the input.SDetect the end of a column.Detect the end of a row.Segment starts and lengthsTWorker functionStarting state Input vectorUWorker function.Input elements.V%Worker function to fold each segment.$Initial state when folding segments.+Length and initial state for first segment.Segment names and lengths. Elements.WSuccessor function.Input keys and values.+,-./01GHIJKLMNOPQRSTUVWTUQRSKLMNWJHIV+,-./01OPGGHIJKLMNOPQRSTUVWj      !"#$%&&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYTUVRMNOPXYJKLHIWQZ[\Z]^Z_`Z_abcdefgh=ijkijlijmnopqrepas_EFL1b8gJ09pH0kfT6reZR5Data.Repa.StreamData.Repa.ChainData.Repa.Vector.GenericData.Repa.Vector.UnboxedData.Repa.Stream.SegmentData.Repa.Stream.ReplicateData.Repa.Stream.RatchetData.Repa.Stream.PadData.Repa.Stream.MergeData.Repa.Stream.InsertData.Repa.Stream.ExtractData.Repa.Stream.DiceData.Repa.Stream.CompactData.Repa.Stream.ConcatData.Repa.Chain.BaseData.Repa.Chain.ScanData.Repa.Chain.WeaveData.Repa.Chain.FoldsCFolds foldLensState findSegmentsSstartLengthsOfSegsS replicatesSunsafeRatchetS padForwardSmergeSinsertSextractSdiceSepScompactS compactInS catMaybesSStepYieldSkipDoneChain mchainSize mchainState mchainStep liftChain resumeChain StepUnfoldStepUnfoldGiveStepUnfoldNextStepUnfoldBumpStepUnfoldFinishunfoldsC scanMaybeC groupsByCMoveMoveLeft MoveRightMoveBothMoveNoneTurnGiveNextFinishWeaveweaveCmove _stateLens _stateVals_nameSeg_lenSeg_valSegfoldsCunstreamToVector2unstreamToMVector2compact compactIn findSegmentsfindSegmentsFromdiceSepextractinsertmerge mergeMaybe padForwardratchet replicates chainOfVectorunchainToVectorunchainToMVectorfolds scanMaybegroupsBybaseGHC.Enum enumFromToGHC.ListfilterGHC.BaseJustNothing_stateL_elemL_endL_stateR_elemR_endR_hererepas_3ih8WaLBKWQBOo3lIP6awTData.Repa.Scalar.OptionNoneSomeOptionunstreamToMVector2_maxunchainToMVector_maxunchainToMVector_unknown