M5.      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                                     !" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                        ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~              !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,- (c) Roman Leshchinskiy 2009-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone+(c) Roman Leshchinskiy 2009 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimentalportable Safe-Inferred+ Box monadIdentity monad FDelay inlining a function until late in the game (simplifier phase 0). . inlined in phase 0 /01234    /01234 (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimentalportable Safe-Inferred+  Size hint Unknown sizeUpper bound on the size Exact sizeMinimum of two size hintsMaximum of two size hints%Convert a size hint to an upper bound5)Compute the minimum size from a size hint5Compute the maximum size from a size hint if possible 56   56(c) Roman Leshchinskiy 2009 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone+;789:;<=>?@ABCD  789:;<=>?@ABCD89 (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone+:HM[ Monadic streams"*Result of taking a single step in a stream# end of stream$just a new seed%a new element and a new seed)  hint of a  * Attach a   hint to a  + Length of a  , Check if a   is empty-Empty  . Singleton  /#Replicate a value to a given length0Yield a  O of values obtained by performing the monadic action the given number of times2"Generate a stream from its indices3Prepend an element4Append an element5Concatenate two  s6First element of the   or error if empty7Last element of the   or error if empty8Element at the given position9!Element at the given position or E if out of bounds:GExtract a substream of the given length starting at the given position.;All but the last element<All but the first element= The first n elements>All but the first n elements?Map a function over a  @Map a monadic function over a  A1Execute a monadic action for each element of the  B Transform a   to use a different monadDPair each element in a   with its indexEPair each element in a  ; with its index, starting from the right and counting downFZip two  !s with the given monadic functionV0Drop elements which do not satisfy the predicateW8Drop elements which do not satisfy the monadic predicateX5Longest prefix of elements that satisfy the predicateY=Longest prefix of elements that satisfy the monadic predicateZ>Drop the longest prefix of elements that satisfy the predicate[FDrop the longest prefix of elements that satisfy the monadic predicate\Check whether the   contains an element] Inverse of \^Yield F3 the first element that satisfies the predicate or E if no such element exists._Yield F< the first element that satisfies the monadic predicate or E if no such element exists.`Yield FA the index of the first element that satisfies the predicate or E if no such element exists.aYield FI the index of the first element that satisfies the monadic predicate or E if no such element exists.b Left foldc!Left fold with a monadic operatordSame as ceLeft fold over a non-empty  fLeft fold over a non-empty   with a monadic operatorgSame as fh#Left fold with a strict accumulatori:Left fold with a strict accumulator and a monadic operatorjSame as ikLeft fold over a non-empty   with a strict accumulatorlLeft fold over a non-empty  2 with a strict accumulator and a monadic operatormSame as ln Right foldo"Right fold with a monadic operatorp"Right fold over a non-empty streamq:Right fold over a non-empty stream with a monadic operatorv Create a   of values from a   of streamable thingswUnfoldxUnfold with a monadic functionyUnfold at most n elementszUnfold at most n" elements with a monadic functions{JApply monadic function n times to value. Zeroth element is original value.|BApply function n times to value. Zeroth element is original value.} Prefix scan~#Prefix scan with a monadic operator#Prefix scan with strict accumulator:Prefix scan with strict accumulator and a monadic operator Suffix scan#Suffix scan with a monadic operator#Suffix scan with strict accumulator;Suffix scan with strict acccumulator and a monadic operatorHaskell-style scan*Haskell-style scan with a monadic operator*Haskell-style scan with strict accumulatorAHaskell-style scan with strict accumulator and a monadic operatorScan over a non-empty  Scan over a non-empty   with a monadic operatorScan over a non-empty   with a strict accumulatorScan over a non-empty  2 with a strict accumulator and a monadic operatorYield a  + of the given length containing the values x, x+y, x+y+y etc.Enumerate valuesWARNING:B This operation can be very inefficient. If at all possible, use  instead.#Enumerate values with a given step.WARNING:> This operation is very inefficient. If at all possible, use  instead. Convert a   to a listConvert a list to a  Convert the first n elements of a list to a  Convert a list to a   with the given   hint. GHIJ !"#$%&'(K)*+,-./0123456789:starting indexlength;<=>?@LABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~MNOPQRSt !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~t !"%$#&(')*+,-.34/01256789:;<=>?@ABCtvDEGFHIJKLMNOPQRSTUVWXYZ[\]^_`abcefdghikljmnopqrsuwxyz|{}~xGJIH !"%$#&('K)*+,-./0123456789:;<=>?@LABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~MNOPQRS58 9 \] (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone+24HMD$Alternative name for monadic streamsThe type of pure streams )Convert a pure stream to a monadic stream  hint of a  Attach a   hint to a  Length of a  Check if a  is emptyEmpty  Singleton #Replicate a value to a given length"Generate a stream from its indicesPrepend an elementAppend an elementConcatenate two sFirst element of the  or error if emptyLast element of the  or error if emptyElement at the given position!Element at the given position or E if out of boundsGExtract a substream of the given length starting at the given position.All but the last elementAll but the first element The first n elementsAll but the first n elementsMap a function over a Pair each element in a  with its indexPair each element in a ; with its index, starting from the right and counting downZip two s with the given function Zip three s with the given function0Drop elements which do not satisfy the predicate5Longest prefix of elements that satisfy the predicate>Drop the longest prefix of elements that satisfy the predicateCheck whether the  contains an element Inverse of Yield F- the first element matching the predicate or E if no such element exists.Yield F; the index of the first element matching the predicate or E if no such element exists. Left foldLeft fold on non-empty s!Left fold with strict accumulatorLeft fold on non-empty s with strict accumulator Right foldRight fold on non-empty sUnfoldUnfold at most n elementsDApply function n-1 times to value. Zeroth element is original value. Prefix scan#Prefix scan with strict accumulator Suffix scan#Suffix scan with strict accumulatorHaskell-style scan*Haskell-style scan with strict accumulatorScan over a non-empty Scan over a non-empty  with a strict accumulator Check if two  s are equalLexicographically compare two s\Apply a monadic action to each element of the stream, producing a monadic stream of results4Apply a monadic action to each element of the streamEYield a monadic stream of elements that satisfy the monadic predicate Monadic fold"Monadic fold over non-empty stream$Monadic fold with strict accumulator8Monad fold over non-empty stream with strict accumulatorYield a + of the given length containing the values x, x+y, x+y+y etc.Enumerate valuesWARNING:C This operations can be very inefficient. If at all possible, use  instead.#Enumerate values with a given step.WARNING:? This operations is very inefficient. If at all possible, use  instead. Convert a  to a list Create a  from a list Create a  from the first n elements of a list %fromListN n xs = fromList (take n xs) Create a  of values from a  of streamable thingsWstarting indexlengthTUVX"#$%X"%$#WTUV   (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone +6=KM*CClass of mutable vectors parametrised with a primitive state token. Minimum complete implementation:NLength of the mutable vector. This method should not be called directly, use  instead.gYield a part of the mutable vector without copying it. This method should not be called directly, use  instead.]Create a mutable vector of the given length. This method should not be called directly, use  instead.Create a mutable vector of the given length and fill it with an initial value. This method should not be called directly, use  instead.YYield the element at the given position. This method should not be called directly, use  instead.[Replace the element at the given position. This method should not be called directly, use  instead.Reset all elements of the vector to some undefined value, clearing all references to external objects. This is usually a noop for unboxed vectors. This method should not be called directly, use  instead.cSet all elements of the vector to the given value. This method should not be called directly, use  instead.`Copy a vector. The two vectors may not overlap. This method should not be called directly, use  instead.lMove the contents of a vector. The two vectors may overlap. This method should not be called directly, use  instead._Grow a vector by the given number of elements. This method should not be called directly, use  instead.?Create a new mutable vector and fill it with elements from the A. The vector will grow exponentially if the maximum size of the  is unknown.Create a new mutable vector and fill it with elements from the monadic stream. The vector will grow exponentially if the maximum size of the stream is unknown.?Create a new mutable vector and fill it with elements from the U from right to left. The vector will grow exponentially if the maximum size of the  is unknown.Create a new mutable vector and fill it with elements from the monadic stream from right to left. The vector will grow exponentially if the maximum size of the stream is unknown.Length of the mutable vector.!Check whether the vector is empty6Yield a part of the mutable vector without copying it.WYield a part of the mutable vector without copying it. No bounds checks are performed. ,Create a mutable vector of the given length.GCreate a mutable vector of the given length. The length is not checked.mCreate a mutable vector of the given length (0 if the length is negative) and fill it with an initial value.Create a mutable vector of the given length (0 if the length is negative) and fill it with values produced by repeatedly executing the monadic action."Create a copy of a mutable vector.LGrow a vector by the given number of elements. The number must be positive.WGrow a vector logarithmicallydGrow a vector by the given number of elements. The number must be positive but this is not checked.Reset all elements of the vector to some undefined value, clearing all references to external objects. This is usually a noop for unboxed vectors. (Yield the element at the given position.*Replace the element at the given position.)Swap the elements at the given positions.XDReplace the element at the give position and return the old element.HYield the element at the given position. No bounds checks are performed.JReplace the element at the given position. No bounds checks are performed.ISwap the elements at the given positions. No bounds checks are performed.YeReplace the element at the give position and return the old element. No bounds checks are performed.2Set all elements of the vector to the given value.NCopy a vector. The two vectors must have the same length and may not overlap.JMove the contents of a vector. The two vectors must have the same length.:If the vectors do not overlap, then this is equivalent to . Otherwise, the copying is performed as if the source vector were copied to a temporary vector and then the temporary vector was copied to the target vector.cCopy a vector. The two vectors must have the same length and may not overlap. This is not checked.cMove the contents of a vector. The two vectors must have the same length, but this is not checked.:If the vectors do not overlap, then this is equivalent to . Otherwise, the copying is performed as if the source vector were copied to a temporary vector and then the temporary vector was copied to the target vector.Pstarting indexlength of the slicetargetsourcetargetsourceZ[\]^_starting indexlength of the slice     `aWbcXYtargetsourcetargetsource !"#$%&d'ef@      !"#$%&'@     " #!$%&'D Z[\]^_     `aWbcXY !"#$%&d'ef (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone +36=HKM (gClass of immutable vectors. Every immutable vector is associated with its mutable version through the 0K type family. Methods of this class should not be used directly. Instead, Data.Vector.GenericB and other Data.Vector modules provide safe and fusible wrappers. Minimum complete implementation:)*+,-)Assumed complexity: O(1)Unsafely convert a mutable vector to its immutable version without copying. The mutable vector may not be used after this operation.*Assumed complexity: O(1)Unsafely convert an immutable vector to its mutable version without copying. The immutable vector may not be used after this operation.+Assumed complexity: O(1)Yield the length of the vector.,Assumed complexity: O(1)OYield a slice of the vector without copying it. No range checks are performed.-Assumed complexity: O(1)SYield the element at the given position in a monad. No range checks are performed.IThe monad allows us to be strict in the vector if we want. Suppose we had unsafeIndex :: v a -> Int -> aCinstead. Now, if we wanted to copy a vector, we'd do something like :copy mv v ... = ... unsafeWrite mv i (unsafeIndex v i) ...For lazy vectors, the indexing would not be evaluated which means that we would retain a reference to the original vector in each element we write. This is not what we want!With - , we can do gcopy mv v ... = ... case basicUnsafeIndexM v i of Box x -> unsafeWrite mv i x ...lwhich does not have this problem because indexing (but not the returned element!) is evaluated immediately..Assumed complexity: O(n)pCopy an immutable vector into a mutable one. The two vectors must have the same length but this is not checked. Instances of (X should redefine this method if they wish to support an efficient block copy operation.%Default definition: copying basic on - and basicUnsafeWrite./ Evaluate a2 as far as storing it in a vector would and yield b. The v a argument only fixes the type and is not touched. The method is only used for optimisation purposes. Thus, it is safe for instances of ( to evaluate a^ less than it would be when stored in a vector although this might result in suboptimal code. 2elemseq v x y = (singleton x `asTypeOf` v) `seq` yDefault defintion: a is not evaluated at all0 Mutable v s a0 is the mutable version of the pure vector type v a with the state token s ()*+,starting indexlength-./0 ()*+,-./0()*+,-./0  (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone+3HM123456789:;<=>?@ABCD123456789:;<=>?@ABCD123456789:;<=>?@ABCD123456789:;<=>?@ABCD  (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone +36=HKMEO(1) Yield the length of the vector.FO(1) Test whether a vector if emptyG O(1) IndexingHO(1) Safe indexingIO(1) First elementJO(1) Last elementKO(1)( Unsafe indexing without bounds checkingLO(1)6 First element without checking if the vector is emptyMO(1)5 Last element without checking if the vector is emptyNO(1) Indexing in a monad.xThe monad allows operations to be strict in the vector when necessary. Suppose vector copying is implemented like this: &copy mv v = ... write mv i (v ! i) ...For lazy vectors, v ! i) would not be evaluated which means that mv, would unnecessarily retain a reference to v in each element written.With N/, copying can be implemented like this instead: Scopy mv v = ... do x <- indexM v i write mv i xHere, no references to v$ are retained because indexing (but not% the elements) is evaluated eagerly.OO(1)+ First element of a vector in a monad. See N+ for an explanation of why this is useful.PO(1)* Last element of a vector in a monad. See N+ for an explanation of why this is useful.QO(1)0 Indexing in a monad without bounds checks. See N+ for an explanation of why this is useful.RO(1)C First element in a monad without checking for empty vectors. See N* for an explanation of why this is useful.SO(1)B Last element in a monad without checking for empty vectors. See N* for an explanation of why this is useful.TO(1)S Yield a slice of the vector without copying it. The vector must contain at least i+n elements.UO(1)N Yield all but the last element without copying. The vector may not be empty.VO(1)O Yield all but the first element without copying. The vector may not be empty.WO(1) Yield the first n= elements without copying. The vector may contain less than n1 elements in which case it is returned unchanged.XO(1) Yield all but the first n= elements without copying. The vector may contain less than n4 elements in which case an empty vector is returned.YO(1) Yield the first n4 elements paired with the remainder without copying. Note that Y n v is equivalent to (W n v, X n v) but slightly more efficient.ZO(1)P Yield a slice of the vector without copying. The vector must contain at least i+n" elements but this is not checked.[O(1)f Yield all but the last element without copying. The vector may not be empty but this is not checked.\O(1)g Yield all but the first element without copying. The vector may not be empty but this is not checked.]O(1) Yield the first n= elements without copying. The vector must contain at least n" elements but this is not checked.^O(1) Yield all but the first n= elements without copying. The vector must contain at least n" elements but this is not checked._O(1) Empty vector`O(1) Vector with exactly one elementaO(n)@ Vector of the given length with the same value in each positionbO(n)O Construct a vector of the given length by applying the function to each indexcO(n)C Apply function n times to value. Zeroth element is original value.dO(n)l Construct a vector by repeatedly applying the generator function to a seed. The generator function yields F' the next element and the new seed or E if there are no more elements. Uunfoldr (\n -> if n == 0 then Nothing else Just (n,n-1)) 10 = <10,9,8,7,6,5,4,3,2,1>eO(n)! Construct a vector with at most n] by repeatedly applying the generator function to the a seed. The generator function yields F' the next element and the new seed or E if there are no more elements. -unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8>fO(n) Construct a vector with ng elements by repeatedly applying the generator function to the already constructed part of the vector. DconstructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in f <a,b,c>gO(n) Construct a vector with n{ elements from right to left by repeatedly applying the generator function to the already constructed part of the vector. DconstructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in f <c,b,a>hO(n): Yield a vector of the given length containing the values x, x+15 etc. This operation is usually more efficient than j. enumFromN 5 3 = <5,6,7>iO(n): Yield a vector of the given length containing the values x, x+y, x+y+y5 etc. This operations is usually more efficient than k. +enumFromStepN 1 0.1 5 = <1,1.1,1.2,1.3,1.4>jO(n) Enumerate values from x to y.WARNING:B This operation can be very inefficient. If at all possible, use h instead.kO(n) Enumerate values from x to y with a specific step z.WARNING:B This operation can be very inefficient. If at all possible, use i instead.lO(n) Prepend an elementmO(n) Append an elementnO(m+n) Concatenate two vectorsoO(n)$ Concatenate all vectors in the listpO(n)Y Execute the monadic action the given number of times and store the results in a vector.qO(n)U Construct a vector of the given length by applying the monadic action to each indexr;Execute the monadic action and freeze the resulting vector. create (do { v <-   2;  v 0 'a';  v 1 'b'; return v }) = <a,b> sO(n)Y Yield the argument but force it not to retain any extra memory, possibly by copying it.@This is especially useful when dealing with slices. For example: force (slice 0 2 <huge vector>)Here, the slice retains a reference to the huge vector. Forcing it creates a copy of just the elements that belong to the slice and allows the huge vector to be garbage collected.tO(m+n) For each pair (i,a)8 from the list, replace the vector element at position i by a. ,<5,9,2,7> // [(2,1),(0,3),(2,8)] = <3,9,8,7>uO(m+n) For each pair (i,a)O from the vector of index/value pairs, replace the vector element at position i by a. 0update <5,9,2,7> <(2,1),(0,3),(2,8)> = <3,9,8,7>vO(m+min(n1,n2)) For each index i4 from the index vector and the corresponding value aO from the value vector, replace the element of the initial vector at position i by a. .update_ <5,9,2,7> <2,0,2> <1,3,8> = <3,9,8,7>)This function is useful for instances of (& that cannot store pairs. Otherwise, u is probably more convenient. update_ xs is ys = u xs ( is ys) w Same as (t) but without bounds checking.xSame as u but without bounds checking.ySame as v but without bounds checking.zO(m+n) For each pair (i,b), from the list, replace the vector element a at position i by f a b. ?accum (+) <5,9,2> [(2,4),(1,6),(0,3),(1,7)] = <5+3, 9+6+7, 2+4>{O(m+n) For each pair (i,b)7 from the vector of pairs, replace the vector element a at position i by f a b. Daccumulate (+) <5,9,2> <(2,4),(1,6),(0,3),(1,7)> = <5+3, 9+6+7, 2+4>|O(m+min(n1,n2)) For each index i4 from the index vector and the corresponding value bT from the the value vector, replace the element of the initial vector at position i by f a b. ?accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4>)This function is useful for instances of (& that cannot store pairs. Otherwise, { is probably more convenient: accumulate_ f as is bs = { f as ( is bs) }Same as z but without bounds checking.~Same as { but without bounds checking.Same as | but without bounds checking.O(n) Reverse a vectorO(n)5 Yield the vector obtained by replacing each element i of the index vector by xsGi. This is equivalent to  (xsG) is# but is often much more efficient. 3backpermute <a,b,c,d> <0,3,2,3,1,0> = <a,d,c,d,b,a>Same as  but without bounds checking.Apply a destructive operation to a vector. The operation will be performed in place if it is safe to do so and will modify a copy of the vector otherwise. modify (\v ->  v 0 'x') (a 3 'a') = <'x','a','a'> O(n)- Pair each element in a vector with its indexO(n) Map a function over a vectorO(n)< Apply a function to every element of a vector and its index9Map a function over a vector and concatenate the results.O(n)V Apply the monadic action to all elements of the vector, yielding a vector of resultsO(n)M Apply the monadic action to all elements of a vector and ignore the resultsO(n)e Apply the monadic action to all elements of the vector, yielding a vector of results. Equvalent to flip .O(n)] Apply the monadic action to all elements of a vector and ignore the results. Equivalent to flip . O(min(m,n))) Zip two vectors with the given function.*Zip three vectors with the given function. O(min(m,n))H Zip two vectors with a function that also takes the elements' indices. O(min(m,n)) Zip two vectors O(min(m,n))K Zip the two vectors with the monadic action and yield a vector of results O(min(m,n))D Zip the two vectors with the monadic action and ignore the results O(min(m,n)) Unzip a vector of pairs.O(n)0 Drop elements that do not satisfy the predicateO(n)^ Drop elements that do not satisfy the predicate which is applied to values and their indicesO(n)8 Drop elements that do not satisfy the monadic predicateO(n)P Yield the longest prefix of elements satisfying the predicate without copying.O(n)Q Drop the longest prefix of elements that satisfy the predicate without copying.O(n) Split the vector in two parts, the first one containing those elements that satisfy the predicate and the second one those that don't. The relative order of the elements is preserved at the cost of a sometimes reduced performance compared to .O(n) Split the vector in two parts, the first one containing those elements that satisfy the predicate and the second one those that don't. The order of the elements is not preserved but the operation is often faster than .O(n)o Split the vector into the longest prefix of elements that satisfy the predicate and the rest without copying.O(n)v Split the vector into the longest prefix of elements that do not satisfy the predicate and the rest without copying.O(n)( Check if the vector contains an elementO(n)= Check if the vector does not contain an element (inverse of )O(n) Yield F- the first element matching the predicate or E if no such element exists.O(n) Yield F; the index of the first element matching the predicate or E if no such element exists.O(n)L Yield the indices of elements satisfying the predicate in ascending order.O(n) Yield F; the index of the first occurence of the given element or EO if the vector does not contain the element. This is a specialised version of .O(n)p Yield the indices of all occurences of the given element in ascending order. This is a specialised version of .O(n) Left foldO(n) Left fold on non-empty vectorsO(n)" Left fold with strict accumulatorO(n)7 Left fold on non-empty vectors with strict accumulatorO(n) Right foldO(n) Right fold on non-empty vectorsO(n)% Right fold with a strict accumulatorO(n)8 Right fold on non-empty vectors with strict accumulatorO(n); Left fold (function applied to each element and its index)O(n)T Left fold with strict accumulator (function applied to each element and its index)O(n)< Right fold (function applied to each element and its index)O(n)U Right fold with strict accumulator (function applied to each element and its index)O(n)- Check if all elements satisfy the predicate.O(n). Check if any element satisfies the predicate.O(n) Check if all elements are gO(n) Check if any element is gO(n) Compute the sum of the elementsO(n)$ Compute the produce of the elementsO(n)G Yield the maximum element of the vector. The vector may not be empty.O(n)r Yield the maximum element of the vector according to the given comparison function. The vector may not be empty.O(n)G Yield the minimum element of the vector. The vector may not be empty.O(n)r Yield the minimum element of the vector according to the given comparison function. The vector may not be empty.O(n)T Yield the index of the maximum element of the vector. The vector may not be empty.O(n) Yield the index of the maximum element of the vector according to the given comparison function. The vector may not be empty.O(n)T Yield the index of the minimum element of the vector. The vector may not be empty.O(n) Yield the index of the minimum element of the vector according to the given comparison function. The vector may not be empty.O(n) Monadic foldO(n)$ Monadic fold over non-empty vectorsO(n)% Monadic fold with strict accumulatorO(n)< Monadic fold over non-empty vectors with strict accumulatorO(n)& Monadic fold that discards the resultO(n)= Monadic fold over non-empty vectors that discards the resultO(n)> Monadic fold with strict accumulator that discards the resultO(n)T Monad fold over non-empty vectors with strict accumulator that discards the result,Evaluate each action and collect the results,Evaluate each action and discard the resultsO(n) Prescan prescanl f z = U .  f z  Example: $prescanl (+) 0 <1,2,3,4> = <0,1,3,6>O(n) Prescan with strict accumulatorO(n) Scan postscanl f z = V .  f z  Example: &postscanl (+) 0 <1,2,3,4> = <1,3,6,10>O(n) Scan with strict accumulatorO(n) Haskell-style scan Sscanl f z <x1,...,xn> = <y1,...,y(n+1)> where y1 = z yi = f y(i-1) x(i-1) Example: $scanl (+) 0 <1,2,3,4> = <0,1,3,6,10>O(n)+ Haskell-style scan with strict accumulatorO(n) Scan over a non-empty vector Jscanl f <x1,...,xn> = <y1,...,yn> where y1 = x1 yi = f y(i-1) xiO(n)7 Scan over a non-empty vector with a strict accumulatorO(n) Right-to-left prescan prescanr f z =  .  (flip f) z .  O(n). Right-to-left prescan with strict accumulatorO(n) Right-to-left scanO(n)+ Right-to-left scan with strict accumulatorO(n)! Right-to-left Haskell-style scanO(n)9 Right-to-left Haskell-style scan with strict accumulatorO(n)+ Right-to-left scan over a non-empty vectorO(n)F Right-to-left scan over a non-empty vector with a strict accumulatorO(n) Convert a vector to a listO(n) Convert a list to a vectorO(n) Convert the first n elements of a list to a vector fromListN n xs =  (W n xs) O(n) Convert different vector typesO(1) Unsafe convert a mutable vector to an immutable one without copying. The mutable vector may not be used after this operation.O(n)/ Yield an immutable copy of the mutable vector.O(1) Unsafely convert an immutable vector to a mutable one without copying. The immutable vector may not be used after this operation.O(n). Yield a mutable copy of the immutable vector.O(n)Y Copy an immutable vector into a mutable one. The two vectors must have the same length.O(n)n Copy an immutable vector into a mutable one. The two vectors must have the same length. This is not checked.O(1) Convert a vector to a O(n) Construct a vector from a O(1) Convert a vector to a , proceeding from right to leftO(n) Construct a vector from a , proceeding from right to left.Construct a vector from a monadic initialiser.SConvert a vector to an initialiser which, when run, produces a copy of the vector.O(n)% Check if two vectors are equal. All (" instances are also instances of hh and it is usually more appropriate to use those. This function is primarily intended for implementing h! instances for new vector types.O(n), Compare two vectors lexicographically. All (" instances are also instances of ih and it is usually more appropriate to use those. This function is primarily intended for implementing i! instances for new vector types.Generic definition of Generic definition of Generic definion of  that views a ( as a list.EFGHIJKLMNOPQRSTi starting indexn lengthUVWXYZi starting indexn length[\]^_`abcdefghijklmnopqrstinitial vector (of length m)%list of index/value pairs (of length n)uinitial vector (of length m)'vector of index/value pairs (of length n)vinitial vector (of length m)index vector (of length n1)value vector (of length n2)jwxykzaccumulating function finitial vector (of length m)%list of index/value pairs (of length n){accumulating function finitial vector (of length m)'vector of index/value pairs (of length n)|accumulating function finitial vector (of length m)index vector (of length n1)value vector (of length n2)l}~mxs value vectoris index vector (of length n)nopqrstuv()*+,-./0EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~()*+,-./0EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcpqrdefghijklmnostuvwxyz{|}~EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvjwxykz{|l}~mnopqrstuvG H n (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone+246M#Mutable vectors of primitive types.-offset, length, underlying mutable byte arrayLength of the mutable vector.!Check whether the vector is empty6Yield a part of the mutable vector without copying it. WYield a part of the mutable vector without copying it. No bounds checks are performed.,Create a mutable vector of the given length.GCreate a mutable vector of the given length. The length is not checked.mCreate a mutable vector of the given length (0 if the length is negative) and fill it with an initial value.Create a mutable vector of the given length (0 if the length is negative) and fill it with values produced by repeatedly executing the monadic action."Create a copy of a mutable vector.LGrow a vector by the given number of elements. The number must be positive.dGrow a vector by the given number of elements. The number must be positive but this is not checked.Reset all elements of the vector to some undefined value, clearing all references to external objects. This is usually a noop for unboxed vectors. (Yield the element at the given position.*Replace the element at the given position.)Swap the elements at the given positions.HYield the element at the given position. No bounds checks are performed.JReplace the element at the given position. No bounds checks are performed.ISwap the elements at the given positions. No bounds checks are performed.2Set all elements of the vector to the given value.NCopy a vector. The two vectors must have the same length and may not overlap.cCopy a vector. The two vectors must have the same length and may not overlap. This is not checked. JMove the contents of a vector. The two vectors must have the same length.:If the vectors do not overlap, then this is equivalent to . Otherwise, the copying is performed as if the source vector were copied to a temporary vector and then the temporary vector was copied to the target vector.!cMove the contents of a vector. The two vectors must have the same length, but this is not checked.:If the vectors do not overlap, then this is equivalent to . Otherwise, the copying is performed as if the source vector were copied to a temporary vector and then the temporary vector was copied to the target vector.' starting indexlength of the slice    targetsource !targetsourcewx&      !&      !&      !wx  (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone +246=HKM""Unboxed vectors of primitive types#%offset, length, underlying byte array$O(1) Yield the length of the vector.%O(1) Test whether a vector if empty& O(1) Indexing'O(1) Safe indexing(O(1) First element)O(1) Last element*O(1)( Unsafe indexing without bounds checking+O(1)6 First element without checking if the vector is empty,O(1)5 Last element without checking if the vector is empty-O(1) Indexing in a monad.xThe monad allows operations to be strict in the vector when necessary. Suppose vector copying is implemented like this: &copy mv v = ... write mv i (v ! i) ...For lazy vectors, v ! i) would not be evaluated which means that mv, would unnecessarily retain a reference to v in each element written.With -/, copying can be implemented like this instead: Scopy mv v = ... do x <- indexM v i write mv i xHere, no references to v$ are retained because indexing (but not% the elements) is evaluated eagerly..O(1)+ First element of a vector in a monad. See -+ for an explanation of why this is useful./O(1)* Last element of a vector in a monad. See -+ for an explanation of why this is useful.0O(1)0 Indexing in a monad without bounds checks. See -+ for an explanation of why this is useful.1O(1)C First element in a monad without checking for empty vectors. See -* for an explanation of why this is useful.2O(1)B Last element in a monad without checking for empty vectors. See -* for an explanation of why this is useful.3O(1)S Yield a slice of the vector without copying it. The vector must contain at least i+n elements.4O(1)N Yield all but the last element without copying. The vector may not be empty.5O(1)O Yield all but the first element without copying. The vector may not be empty.6O(1) Yield at the first n= elements without copying. The vector may contain less than n1 elements in which case it is returned unchanged.7O(1) Yield all but the first n= elements without copying. The vector may contain less than n4 elements in which case an empty vector is returned.8O(1) Yield the first n4 elements paired with the remainder without copying. Note that 8 n v is equivalent to (6 n v, 7 n v) but slightly more efficient.9O(1)P Yield a slice of the vector without copying. The vector must contain at least i+n" elements but this is not checked.:O(1)f Yield all but the last element without copying. The vector may not be empty but this is not checked.;O(1)g Yield all but the first element without copying. The vector may not be empty but this is not checked.<O(1) Yield the first n= elements without copying. The vector must contain at least n" elements but this is not checked.=O(1) Yield all but the first n= elements without copying. The vector must contain at least n" elements but this is not checked.>O(1) Empty vector?O(1) Vector with exactly one element@O(n)@ Vector of the given length with the same value in each positionAO(n)O Construct a vector of the given length by applying the function to each indexBO(n)C Apply function n times to value. Zeroth element is original value.CO(n)l Construct a vector by repeatedly applying the generator function to a seed. The generator function yields F' the next element and the new seed or E if there are no more elements. Uunfoldr (\n -> if n == 0 then Nothing else Just (n,n-1)) 10 = <10,9,8,7,6,5,4,3,2,1>DO(n)! Construct a vector with at most n] by repeatedly applying the generator function to the a seed. The generator function yields F' the next element and the new seed or E if there are no more elements. -unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8>EO(n) Construct a vector with ng elements by repeatedly applying the generator function to the already constructed part of the vector. DconstructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in f <a,b,c>FO(n) Construct a vector with n{ elements from right to left by repeatedly applying the generator function to the already constructed part of the vector. DconstructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in f <c,b,a>GO(n): Yield a vector of the given length containing the values x, x+15 etc. This operation is usually more efficient than I. enumFromN 5 3 = <5,6,7>HO(n): Yield a vector of the given length containing the values x, x+y, x+y+y5 etc. This operations is usually more efficient than J. +enumFromStepN 1 0.1 5 = <1,1.1,1.2,1.3,1.4>IO(n) Enumerate values from x to y.WARNING:B This operation can be very inefficient. If at all possible, use G instead.JO(n) Enumerate values from x to y with a specific step z.WARNING:B This operation can be very inefficient. If at all possible, use H instead.KO(n) Prepend an elementLO(n) Append an elementMO(m+n) Concatenate two vectorsNO(n)$ Concatenate all vectors in the listOO(n)Y Execute the monadic action the given number of times and store the results in a vector.PO(n)U Construct a vector of the given length by applying the monadic action to each indexQ;Execute the monadic action and freeze the resulting vector. Fcreate (do { v <- new 2; write v 0 'a'; write v 1 'b'; return v }) = <a,b> RO(n)Y Yield the argument but force it not to retain any extra memory, possibly by copying it.@This is especially useful when dealing with slices. For example: force (slice 0 2 <huge vector>)Here, the slice retains a reference to the huge vector. Forcing it creates a copy of just the elements that belong to the slice and allows the huge vector to be garbage collected.SO(m+n) For each pair (i,a)8 from the list, replace the vector element at position i by a. ,<5,9,2,7> // [(2,1),(0,3),(2,8)] = <3,9,8,7>TO(m+min(n1,n2)) For each index i4 from the index vector and the corresponding value aO from the value vector, replace the element of the initial vector at position i by a. .update_ <5,9,2,7> <2,0,2> <1,3,8> = <3,9,8,7>U Same as (S) but without bounds checking.VSame as T but without bounds checking.WO(m+n) For each pair (i,b), from the list, replace the vector element a at position i by f a b. ?accum (+) <5,9,2> [(2,4),(1,6),(0,3),(1,7)] = <5+3, 9+6+7, 2+4>XO(m+min(n1,n2)) For each index i4 from the index vector and the corresponding value bT from the the value vector, replace the element of the initial vector at position i by f a b. ?accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4>YSame as W but without bounds checking.ZSame as X but without bounds checking.[O(n) Reverse a vector\O(n)5 Yield the vector obtained by replacing each element i of the index vector by xs&i. This is equivalent to _ (xs&) is# but is often much more efficient. 3backpermute <a,b,c,d> <0,3,2,3,1,0> = <a,d,c,d,b,a>]Same as \ but without bounds checking.^Apply a destructive operation to a vector. The operation will be performed in place if it is safe to do so and will modify a copy of the vector otherwise. modify (\v -> write v 0 'x') (@ 3 'a') = <'x','a','a'> _O(n) Map a function over a vector`O(n)< Apply a function to every element of a vector and its indexa9Map a function over a vector and concatenate the results.bO(n)V Apply the monadic action to all elements of the vector, yielding a vector of resultscO(n)M Apply the monadic action to all elements of a vector and ignore the resultsdO(n)e Apply the monadic action to all elements of the vector, yielding a vector of results. Equvalent to flip b.eO(n)] Apply the monadic action to all elements of a vector and ignore the results. Equivalent to flip c.f O(min(m,n))) Zip two vectors with the given function.g*Zip three vectors with the given function.k O(min(m,n))H Zip two vectors with a function that also takes the elements' indices.l<Zip three vectors and their indices with the given function.p O(min(m,n))K Zip the two vectors with the monadic action and yield a vector of resultsq O(min(m,n))D Zip the two vectors with the monadic action and ignore the resultsrO(n)0 Drop elements that do not satisfy the predicatesO(n)^ Drop elements that do not satisfy the predicate which is applied to values and their indicestO(n)8 Drop elements that do not satisfy the monadic predicateuO(n)P Yield the longest prefix of elements satisfying the predicate without copying.vO(n)Q Drop the longest prefix of elements that satisfy the predicate without copying.wO(n) Split the vector in two parts, the first one containing those elements that satisfy the predicate and the second one those that don't. The relative order of the elements is preserved at the cost of a sometimes reduced performance compared to x.xO(n) Split the vector in two parts, the first one containing those elements that satisfy the predicate and the second one those that don't. The order of the elements is not preserved but the operation is often faster than w.yO(n)o Split the vector into the longest prefix of elements that satisfy the predicate and the rest without copying.zO(n)v Split the vector into the longest prefix of elements that do not satisfy the predicate and the rest without copying.{O(n)( Check if the vector contains an element|O(n)= Check if the vector does not contain an element (inverse of {)}O(n) Yield F- the first element matching the predicate or E if no such element exists.~O(n) Yield F; the index of the first element matching the predicate or E if no such element exists.O(n)L Yield the indices of elements satisfying the predicate in ascending order.O(n) Yield F; the index of the first occurence of the given element or EO if the vector does not contain the element. This is a specialised version of ~.O(n)p Yield the indices of all occurences of the given element in ascending order. This is a specialised version of .O(n) Left foldO(n) Left fold on non-empty vectorsO(n)" Left fold with strict accumulatorO(n)7 Left fold on non-empty vectors with strict accumulatorO(n) Right foldO(n) Right fold on non-empty vectorsO(n)% Right fold with a strict accumulatorO(n)8 Right fold on non-empty vectors with strict accumulatorO(n); Left fold (function applied to each element and its index)O(n)T Left fold with strict accumulator (function applied to each element and its index)O(n)< Right fold (function applied to each element and its index)O(n)U Right fold with strict accumulator (function applied to each element and its index)O(n)- Check if all elements satisfy the predicate.O(n). Check if any element satisfies the predicate.O(n) Compute the sum of the elementsO(n)$ Compute the produce of the elementsO(n)G Yield the maximum element of the vector. The vector may not be empty.O(n)r Yield the maximum element of the vector according to the given comparison function. The vector may not be empty.O(n)G Yield the minimum element of the vector. The vector may not be empty.O(n)r Yield the minimum element of the vector according to the given comparison function. The vector may not be empty.O(n)T Yield the index of the maximum element of the vector. The vector may not be empty.O(n) Yield the index of the maximum element of the vector according to the given comparison function. The vector may not be empty.O(n)T Yield the index of the minimum element of the vector. The vector may not be empty.O(n) Yield the index of the minimum element of the vector according to the given comparison function. The vector may not be empty.O(n) Monadic foldO(n)$ Monadic fold over non-empty vectorsO(n)% Monadic fold with strict accumulatorO(n)< Monadic fold over non-empty vectors with strict accumulatorO(n)& Monadic fold that discards the resultO(n)= Monadic fold over non-empty vectors that discards the resultO(n)> Monadic fold with strict accumulator that discards the resultO(n)V Monadic fold over non-empty vectors with strict accumulator that discards the resultO(n) Prescan prescanl f z = 4 .  f z  Example: $prescanl (+) 0 <1,2,3,4> = <0,1,3,6>O(n) Prescan with strict accumulatorO(n) Scan postscanl f z = 5 .  f z  Example: &postscanl (+) 0 <1,2,3,4> = <1,3,6,10>O(n) Scan with strict accumulatorO(n) Haskell-style scan Sscanl f z <x1,...,xn> = <y1,...,y(n+1)> where y1 = z yi = f y(i-1) x(i-1) Example: $scanl (+) 0 <1,2,3,4> = <0,1,3,6,10>O(n)+ Haskell-style scan with strict accumulatorO(n) Scan over a non-empty vector Jscanl f <x1,...,xn> = <y1,...,yn> where y1 = x1 yi = f y(i-1) xiO(n)7 Scan over a non-empty vector with a strict accumulatorO(n) Right-to-left prescan prescanr f z = [ .  (flip f) z . [ O(n). Right-to-left prescan with strict accumulatorO(n) Right-to-left scanO(n)+ Right-to-left scan with strict accumulatorO(n)! Right-to-left Haskell-style scanO(n)9 Right-to-left Haskell-style scan with strict accumulatorO(n)+ Right-to-left scan over a non-empty vectorO(n)F Right-to-left scan over a non-empty vector with a strict accumulatorO(n) Convert a vector to a listO(n) Convert a list to a vectorO(n) Convert the first n elements of a list to a vector fromListN n xs =  (6 n xs) O(1) Unsafe convert a mutable vector to an immutable one without copying. The mutable vector may not be used after this operation.O(1) Unsafely convert an immutable vector to a mutable one without copying. The immutable vector may not be used after this operation.O(n). Yield a mutable copy of the immutable vector.O(n)/ Yield an immutable copy of the mutable vector.O(n)n Copy an immutable vector into a mutable one. The two vectors must have the same length. This is not checked.O(n)Y Copy an immutable vector into a mutable one. The two vectors must have the same length."#$%&'()*+,-./0123i starting indexn length456789i starting indexn length:;<=>?@ABCDEFGHIJKLMNOPQRSinitial vector (of length m)%list of index/value pairs (of length n) Tinitial vector (of length m)index vector (of length n1)value vector (of length n2)UVWaccumulating function finitial vector (of length m)%list of index/value pairs (of length n)Xaccumulating function finitial vector (of length m)index vector (of length n1)value vector (of length n2)YZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~yz{|}~"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"#$%&'()*+,-./0123456789:;<=>?@ABOPQCDEFGHIJKLMNRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~yz{|}~M{| (c) Roman Leshchinskiy 2009-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone+246MMutable -based vectorsLength of the mutable vector.!Check whether the vector is empty6Yield a part of the mutable vector without copying it.WYield a part of the mutable vector without copying it. No bounds checks are performed.,Create a mutable vector of the given length.GCreate a mutable vector of the given length. The length is not checked.mCreate a mutable vector of the given length (0 if the length is negative) and fill it with an initial value.Create a mutable vector of the given length (0 if the length is negative) and fill it with values produced by repeatedly executing the monadic action."Create a copy of a mutable vector.LGrow a vector by the given number of elements. The number must be positive.dGrow a vector by the given number of elements. The number must be positive but this is not checked.Reset all elements of the vector to some undefined value, clearing all references to external objects. This is usually a noop for unboxed vectors. (Yield the element at the given position.*Replace the element at the given position.)Swap the elements at the given positions.HYield the element at the given position. No bounds checks are performed.JReplace the element at the given position. No bounds checks are performed.ISwap the elements at the given positions. No bounds checks are performed.2Set all elements of the vector to the given value.NCopy a vector. The two vectors must have the same length and may not overlap.cCopy a vector. The two vectors must have the same length and may not overlap. This is not checked.JMove the contents of a vector. The two vectors must have the same length.:If the vectors do not overlap, then this is equivalent to . Otherwise, the copying is performed as if the source vector were copied to a temporary vector and then the temporary vector was copied to the target vector.cMove the contents of a vector. The two vectors must have the same length, but this is not checked.:If the vectors do not overlap, then this is equivalent to . Otherwise, the copying is performed as if the source vector were copied to a temporary vector and then the temporary vector was copied to the target vector.O(1) Unsafely cast a mutable vector from one element type to another. The operation just changes the type of the underlying pointer and does not modify the elements.\The resulting vector contains as many elements as can fit into the underlying memory block.Create a mutable vector from a  with an offset and a length.Modifying data through the T afterwards is unsafe if the vector could have been frozen before the modification.0If your offset is 0 it is more efficient to use .O(1) Create a mutable vector from a  and a length.HIt is assumed the pointer points directly to the data (no offset). Use " if you need to specify an offset.Modifying data through the T afterwards is unsafe if the vector could have been frozen before the modification.Yield the underlying V together with the offset to the data and its length. Modifying the data through the D is unsafe if the vector could have frozen before the modification.O(1) Yield the underlying  together with its length.CYou can assume the pointer points directly to the data (no offset).Modifying the data through the D is unsafe if the vector could have frozen before the modification.Pass a pointer to the vector's data to the IO action. Modifying data through the pointer is unsafe if the vector could have been frozen before the modification.0starting indexlength of the slicetargetsourcetargetsourcepointeroffsetlengthpointerlength,,/  (c) Roman Leshchinskiy 2009-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone +246=HKM-based vectorsO(1) Yield the length of the vector.O(1) Test whether a vector if empty O(1) IndexingO(1) Safe indexingO(1) First elementO(1) Last elementO(1)( Unsafe indexing without bounds checkingO(1)6 First element without checking if the vector is emptyO(1)5 Last element without checking if the vector is emptyO(1) Indexing in a monad.xThe monad allows operations to be strict in the vector when necessary. Suppose vector copying is implemented like this: &copy mv v = ... write mv i (v ! i) ...For lazy vectors, v ! i) would not be evaluated which means that mv, would unnecessarily retain a reference to v in each element written.With /, copying can be implemented like this instead: Scopy mv v = ... do x <- indexM v i write mv i xHere, no references to v$ are retained because indexing (but not% the elements) is evaluated eagerly.O(1)+ First element of a vector in a monad. See + for an explanation of why this is useful.O(1)* Last element of a vector in a monad. See + for an explanation of why this is useful.O(1)0 Indexing in a monad without bounds checks. See + for an explanation of why this is useful.O(1)C First element in a monad without checking for empty vectors. See * for an explanation of why this is useful.O(1)B Last element in a monad without checking for empty vectors. See * for an explanation of why this is useful.O(1)S Yield a slice of the vector without copying it. The vector must contain at least i+n elements.O(1)N Yield all but the last element without copying. The vector may not be empty.O(1)O Yield all but the first element without copying. The vector may not be empty.O(1) Yield at the first n= elements without copying. The vector may contain less than n1 elements in which case it is returned unchanged.O(1) Yield all but the first n= elements without copying. The vector may contain less than n4 elements in which case an empty vector is returned.O(1) Yield the first n4 elements paired with the remainder without copying. Note that  n v is equivalent to ( n v,  n v) but slightly more efficient.O(1)P Yield a slice of the vector without copying. The vector must contain at least i+n" elements but this is not checked.O(1)f Yield all but the last element without copying. The vector may not be empty but this is not checked.O(1)g Yield all but the first element without copying. The vector may not be empty but this is not checked.O(1) Yield the first n= elements without copying. The vector must contain at least n" elements but this is not checked.O(1) Yield all but the first n= elements without copying. The vector must contain at least n" elements but this is not checked.O(1) Empty vectorO(1) Vector with exactly one elementO(n)@ Vector of the given length with the same value in each positionO(n)O Construct a vector of the given length by applying the function to each indexO(n)C Apply function n times to value. Zeroth element is original value.O(n)l Construct a vector by repeatedly applying the generator function to a seed. The generator function yields F' the next element and the new seed or E if there are no more elements. Uunfoldr (\n -> if n == 0 then Nothing else Just (n,n-1)) 10 = <10,9,8,7,6,5,4,3,2,1>O(n)! Construct a vector with at most n] by repeatedly applying the generator function to the a seed. The generator function yields F' the next element and the new seed or E if there are no more elements. -unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8>O(n) Construct a vector with ng elements by repeatedly applying the generator function to the already constructed part of the vector. DconstructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in f <a,b,c> O(n) Construct a vector with n{ elements from right to left by repeatedly applying the generator function to the already constructed part of the vector. DconstructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in f <c,b,a> O(n): Yield a vector of the given length containing the values x, x+15 etc. This operation is usually more efficient than  . enumFromN 5 3 = <5,6,7> O(n): Yield a vector of the given length containing the values x, x+y, x+y+y5 etc. This operations is usually more efficient than  . +enumFromStepN 1 0.1 5 = <1,1.1,1.2,1.3,1.4> O(n) Enumerate values from x to y.WARNING:B This operation can be very inefficient. If at all possible, use   instead. O(n) Enumerate values from x to y with a specific step z.WARNING:B This operation can be very inefficient. If at all possible, use   instead.O(n) Prepend an elementO(n) Append an elementO(m+n) Concatenate two vectorsO(n)$ Concatenate all vectors in the listO(n)Y Execute the monadic action the given number of times and store the results in a vector.O(n)U Construct a vector of the given length by applying the monadic action to each index;Execute the monadic action and freeze the resulting vector. Fcreate (do { v <- new 2; write v 0 'a'; write v 1 'b'; return v }) = <a,b> O(n)Y Yield the argument but force it not to retain any extra memory, possibly by copying it.@This is especially useful when dealing with slices. For example: force (slice 0 2 <huge vector>)Here, the slice retains a reference to the huge vector. Forcing it creates a copy of just the elements that belong to the slice and allows the huge vector to be garbage collected.O(m+n) For each pair (i,a)8 from the list, replace the vector element at position i by a. ,<5,9,2,7> // [(2,1),(0,3),(2,8)] = <3,9,8,7>O(m+min(n1,n2)) For each index i4 from the index vector and the corresponding value aO from the value vector, replace the element of the initial vector at position i by a. .update_ <5,9,2,7> <2,0,2> <1,3,8> = <3,9,8,7> Same as () but without bounds checking.Same as  but without bounds checking.O(m+n) For each pair (i,b), from the list, replace the vector element a at position i by f a b. ?accum (+) <5,9,2> [(2,4),(1,6),(0,3),(1,7)] = <5+3, 9+6+7, 2+4>O(m+min(n1,n2)) For each index i4 from the index vector and the corresponding value bT from the the value vector, replace the element of the initial vector at position i by f a b. ?accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4>Same as  but without bounds checking.Same as  but without bounds checking.O(n) Reverse a vectorO(n)5 Yield the vector obtained by replacing each element i of the index vector by xsi. This is equivalent to " (xs) is# but is often much more efficient. 3backpermute <a,b,c,d> <0,3,2,3,1,0> = <a,d,c,d,b,a> Same as  but without bounds checking.!Apply a destructive operation to a vector. The operation will be performed in place if it is safe to do so and will modify a copy of the vector otherwise. modify (\v -> write v 0 'x') ( 3 'a') = <'x','a','a'> "O(n) Map a function over a vector#O(n)< Apply a function to every element of a vector and its index$9Map a function over a vector and concatenate the results.%O(n)V Apply the monadic action to all elements of the vector, yielding a vector of results&O(n)M Apply the monadic action to all elements of a vector and ignore the results'O(n)e Apply the monadic action to all elements of the vector, yielding a vector of results. Equvalent to flip %.(O(n)] Apply the monadic action to all elements of a vector and ignore the results. Equivalent to flip &.) O(min(m,n))) Zip two vectors with the given function.**Zip three vectors with the given function.. O(min(m,n))H Zip two vectors with a function that also takes the elements' indices./<Zip three vectors and their indices with the given function.3 O(min(m,n))K Zip the two vectors with the monadic action and yield a vector of results4 O(min(m,n))D Zip the two vectors with the monadic action and ignore the results5O(n)0 Drop elements that do not satisfy the predicate6O(n)^ Drop elements that do not satisfy the predicate which is applied to values and their indices7O(n)8 Drop elements that do not satisfy the monadic predicate8O(n)P Yield the longest prefix of elements satisfying the predicate without copying.9O(n)Q Drop the longest prefix of elements that satisfy the predicate without copying.:O(n) Split the vector in two parts, the first one containing those elements that satisfy the predicate and the second one those that don't. The relative order of the elements is preserved at the cost of a sometimes reduced performance compared to ;.;O(n) Split the vector in two parts, the first one containing those elements that satisfy the predicate and the second one those that don't. The order of the elements is not preserved but the operation is often faster than :.<O(n)o Split the vector into the longest prefix of elements that satisfy the predicate and the rest without copying.=O(n)v Split the vector into the longest prefix of elements that do not satisfy the predicate and the rest without copying.>O(n)( Check if the vector contains an element?O(n)= Check if the vector does not contain an element (inverse of >)@O(n) Yield F- the first element matching the predicate or E if no such element exists.AO(n) Yield F; the index of the first element matching the predicate or E if no such element exists.BO(n)L Yield the indices of elements satisfying the predicate in ascending order.CO(n) Yield F; the index of the first occurence of the given element or EO if the vector does not contain the element. This is a specialised version of A.DO(n)p Yield the indices of all occurences of the given element in ascending order. This is a specialised version of B.EO(n) Left foldFO(n) Left fold on non-empty vectorsGO(n)" Left fold with strict accumulatorHO(n)7 Left fold on non-empty vectors with strict accumulatorIO(n) Right foldJO(n) Right fold on non-empty vectorsKO(n)% Right fold with a strict accumulatorLO(n)8 Right fold on non-empty vectors with strict accumulatorMO(n); Left fold (function applied to each element and its index)NO(n)T Left fold with strict accumulator (function applied to each element and its index)OO(n)< Right fold (function applied to each element and its index)PO(n)U Right fold with strict accumulator (function applied to each element and its index)QO(n)- Check if all elements satisfy the predicate.RO(n). Check if any element satisfies the predicate.SO(n) Check if all elements are gTO(n) Check if any element is gUO(n) Compute the sum of the elementsVO(n)$ Compute the produce of the elementsWO(n)G Yield the maximum element of the vector. The vector may not be empty.XO(n)r Yield the maximum element of the vector according to the given comparison function. The vector may not be empty.YO(n)G Yield the minimum element of the vector. The vector may not be empty.ZO(n)r Yield the minimum element of the vector according to the given comparison function. The vector may not be empty.[O(n)T Yield the index of the maximum element of the vector. The vector may not be empty.\O(n) Yield the index of the maximum element of the vector according to the given comparison function. The vector may not be empty.]O(n)T Yield the index of the minimum element of the vector. The vector may not be empty.^O(n) Yield the index of the minimum element of the vector according to the given comparison function. The vector may not be empty._O(n) Monadic fold`O(n)$ Monadic fold over non-empty vectorsaO(n)% Monadic fold with strict accumulatorbO(n)< Monadic fold over non-empty vectors with strict accumulatorcO(n)& Monadic fold that discards the resultdO(n)= Monadic fold over non-empty vectors that discards the resulteO(n)> Monadic fold with strict accumulator that discards the resultfO(n)V Monadic fold over non-empty vectors with strict accumulator that discards the resultgO(n) Prescan prescanl f z =  . k f z  Example: $prescanl (+) 0 <1,2,3,4> = <0,1,3,6>hO(n) Prescan with strict accumulatoriO(n) Scan postscanl f z =  . k f z  Example: &postscanl (+) 0 <1,2,3,4> = <1,3,6,10>jO(n) Scan with strict accumulatorkO(n) Haskell-style scan Sscanl f z <x1,...,xn> = <y1,...,y(n+1)> where y1 = z yi = f y(i-1) x(i-1) Example: $scanl (+) 0 <1,2,3,4> = <0,1,3,6,10>lO(n)+ Haskell-style scan with strict accumulatormO(n) Scan over a non-empty vector Jscanl f <x1,...,xn> = <y1,...,yn> where y1 = x1 yi = f y(i-1) xinO(n)7 Scan over a non-empty vector with a strict accumulatoroO(n) Right-to-left prescan prescanr f z =  . g (flip f) z .  pO(n). Right-to-left prescan with strict accumulatorqO(n) Right-to-left scanrO(n)+ Right-to-left scan with strict accumulatorsO(n)! Right-to-left Haskell-style scantO(n)9 Right-to-left Haskell-style scan with strict accumulatoruO(n)+ Right-to-left scan over a non-empty vectorvO(n)F Right-to-left scan over a non-empty vector with a strict accumulatorwO(n) Convert a vector to a listxO(n) Convert a list to a vectoryO(n) Convert the first n elements of a list to a vector fromListN n xs = x ( n xs) zO(1) Unsafely cast a vector from one element type to another. The operation just changes the type of the underlying pointer and does not modify the elements.\The resulting vector contains as many elements as can fit into the underlying memory block.{O(1) Unsafe convert a mutable vector to an immutable one without copying. The mutable vector may not be used after this operation.|O(1) Unsafely convert an immutable vector to a mutable one without copying. The immutable vector may not be used after this operation.}O(n). Yield a mutable copy of the immutable vector.~O(n)/ Yield an immutable copy of the mutable vector.O(n)n Copy an immutable vector into a mutable one. The two vectors must have the same length. This is not checked.O(n)Y Copy an immutable vector into a mutable one. The two vectors must have the same length.O(1) Create a vector from a  with an offset and a length.)The data may not be modified through the  afterwards.0If your offset is 0 it is more efficient to use .O(1) Create a vector from a  and a length.HIt is assumed the pointer points directly to the data (no offset). Use " if you need to specify an offset.)The data may not be modified through the  afterwards.O(1) Yield the underlying ` together with the offset to the data and its length. The data may not be modified through the .O(1) Yield the underlying  together with its length.CYou can assume the pointer points directly to the data (no offset).)The data may not be modified through the .ePass a pointer to the vector's data to the IO action. The data may not be modified through the 'Ptr.i starting indexn lengthi starting indexn length     initial vector (of length m)%list of index/value pairs (of length n) initial vector (of length m)index vector (of length n1)value vector (of length n2)accumulating function finitial vector (of length m)%list of index/value pairs (of length n)accumulating function finitial vector (of length m)index vector (of length n1)value vector (of length n2) !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~pointeroffsetlengthpointerlength      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ]^[\_a`bcedfghijklmnopqrstuvwxyz~}{|      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~>? (c) Roman Leshchinskiy 2009-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone *+36=K      !"#$%&'()*+,/t      !"#$%&'()*+, (c) Roman Leshchinskiy 2009-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone+=HKMO(1) Yield the length of the vector.O(1) Test whether a vector if empty O(1) IndexingO(1) Safe indexingO(1) First elementO(1) Last elementO(1)( Unsafe indexing without bounds checkingO(1)6 First element without checking if the vector is emptyO(1)5 Last element without checking if the vector is emptyO(1) Indexing in a monad.xThe monad allows operations to be strict in the vector when necessary. Suppose vector copying is implemented like this: &copy mv v = ... write mv i (v ! i) ...For lazy vectors, v ! i) would not be evaluated which means that mv, would unnecessarily retain a reference to v in each element written.With /, copying can be implemented like this instead: Scopy mv v = ... do x <- indexM v i write mv i xHere, no references to v$ are retained because indexing (but not% the elements) is evaluated eagerly.O(1)+ First element of a vector in a monad. See + for an explanation of why this is useful.O(1)* Last element of a vector in a monad. See + for an explanation of why this is useful.O(1)0 Indexing in a monad without bounds checks. See + for an explanation of why this is useful.O(1)C First element in a monad without checking for empty vectors. See * for an explanation of why this is useful.O(1)B Last element in a monad without checking for empty vectors. See * for an explanation of why this is useful.O(1)S Yield a slice of the vector without copying it. The vector must contain at least i+n elements.O(1)N Yield all but the last element without copying. The vector may not be empty.O(1)O Yield all but the first element without copying. The vector may not be empty.O(1) Yield at the first n= elements without copying. The vector may contain less than n1 elements in which case it is returned unchanged.O(1) Yield all but the first n= elements without copying. The vector may contain less than n4 elements in which case an empty vector is returned.O(1) Yield the first n4 elements paired with the remainder without copying. Note that  n v is equivalent to ( n v,  n v) but slightly more efficient.O(1)P Yield a slice of the vector without copying. The vector must contain at least i+n" elements but this is not checked.O(1)f Yield all but the last element without copying. The vector may not be empty but this is not checked.O(1)g Yield all but the first element without copying. The vector may not be empty but this is not checked.O(1) Yield the first n= elements without copying. The vector must contain at least n" elements but this is not checked.O(1) Yield all but the first n= elements without copying. The vector must contain at least n" elements but this is not checked.O(1) Empty vectorO(1) Vector with exactly one elementO(n)@ Vector of the given length with the same value in each positionO(n)O Construct a vector of the given length by applying the function to each indexO(n)C Apply function n times to value. Zeroth element is original value.O(n)l Construct a vector by repeatedly applying the generator function to a seed. The generator function yields F' the next element and the new seed or E if there are no more elements. Uunfoldr (\n -> if n == 0 then Nothing else Just (n,n-1)) 10 = <10,9,8,7,6,5,4,3,2,1>O(n)! Construct a vector with at most n] by repeatedly applying the generator function to the a seed. The generator function yields F' the next element and the new seed or E if there are no more elements. -unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8>O(n) Construct a vector with ng elements by repeatedly applying the generator function to the already constructed part of the vector. DconstructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in f <a,b,c>O(n) Construct a vector with n{ elements from right to left by repeatedly applying the generator function to the already constructed part of the vector. DconstructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in f <c,b,a>O(n): Yield a vector of the given length containing the values x, x+15 etc. This operation is usually more efficient than . enumFromN 5 3 = <5,6,7>O(n): Yield a vector of the given length containing the values x, x+y, x+y+y5 etc. This operations is usually more efficient than . +enumFromStepN 1 0.1 5 = <1,1.1,1.2,1.3,1.4>O(n) Enumerate values from x to y.WARNING:B This operation can be very inefficient. If at all possible, use  instead.O(n) Enumerate values from x to y with a specific step z.WARNING:B This operation can be very inefficient. If at all possible, use  instead.O(n) Prepend an elementO(n) Append an elementO(m+n) Concatenate two vectorsO(n)$ Concatenate all vectors in the listO(n)Y Execute the monadic action the given number of times and store the results in a vector.O(n)U Construct a vector of the given length by applying the monadic action to each index;Execute the monadic action and freeze the resulting vector. Fcreate (do { v <- new 2; write v 0 'a'; write v 1 'b'; return v }) = <a,b> O(n)Y Yield the argument but force it not to retain any extra memory, possibly by copying it.@This is especially useful when dealing with slices. For example: force (slice 0 2 <huge vector>)Here, the slice retains a reference to the huge vector. Forcing it creates a copy of just the elements that belong to the slice and allows the huge vector to be garbage collected.O(m+n) For each pair (i,a)8 from the list, replace the vector element at position i by a. ,<5,9,2,7> // [(2,1),(0,3),(2,8)] = <3,9,8,7>O(m+n) For each pair (i,a)O from the vector of index/value pairs, replace the vector element at position i by a. 0update <5,9,2,7> <(2,1),(0,3),(2,8)> = <3,9,8,7>O(m+min(n1,n2)) For each index i4 from the index vector and the corresponding value aO from the value vector, replace the element of the initial vector at position i by a. .update_ <5,9,2,7> <2,0,2> <1,3,8> = <3,9,8,7> The function A provides the same functionality and is usually more convenient. update_ xs is ys =  xs () is ys)  Same as () but without bounds checking.Same as  but without bounds checking.Same as  but without bounds checking.O(m+n) For each pair (i,b), from the list, replace the vector element a at position i by f a b. ?accum (+) <5,9,2> [(2,4),(1,6),(0,3),(1,7)] = <5+3, 9+6+7, 2+4>O(m+n) For each pair (i,b)7 from the vector of pairs, replace the vector element a at position i by f a b. Daccumulate (+) <5,9,2> <(2,4),(1,6),(0,3),(1,7)> = <5+3, 9+6+7, 2+4>O(m+min(n1,n2)) For each index i4 from the index vector and the corresponding value bT from the the value vector, replace the element of the initial vector at position i by f a b. ?accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4> The function A provides the same functionality and is usually more convenient. accumulate_ f as is bs =  f as () is bs) Same as  but without bounds checking.Same as  but without bounds checking.Same as  but without bounds checking.O(n) Reverse a vectorO(n)5 Yield the vector obtained by replacing each element i of the index vector by xsi. This is equivalent to  (xs) is# but is often much more efficient. 3backpermute <a,b,c,d> <0,3,2,3,1,0> = <a,d,c,d,b,a>Same as  but without bounds checking.Apply a destructive operation to a vector. The operation will be performed in place if it is safe to do so and will modify a copy of the vector otherwise. modify (\v -> write v 0 'x') ( 3 'a') = <'x','a','a'> O(n)- Pair each element in a vector with its indexO(n) Map a function over a vectorO(n)< Apply a function to every element of a vector and its index9Map a function over a vector and concatenate the results.O(n)V Apply the monadic action to all elements of the vector, yielding a vector of resultsO(n)M Apply the monadic action to all elements of a vector and ignore the resultsO(n)e Apply the monadic action to all elements of the vector, yielding a vector of results. Equvalent to flip .O(n)] Apply the monadic action to all elements of a vector and ignore the results. Equivalent to flip . O(min(m,n))) Zip two vectors with the given function.*Zip three vectors with the given function. O(min(m,n))H Zip two vectors with a function that also takes the elements' indices.<Zip three vectors and their indices with the given function. O(min(m,n))K Zip the two vectors with the monadic action and yield a vector of results O(min(m,n))D Zip the two vectors with the monadic action and ignore the resultsO(n)0 Drop elements that do not satisfy the predicateO(n)^ Drop elements that do not satisfy the predicate which is applied to values and their indicesO(n)8 Drop elements that do not satisfy the monadic predicateO(n)P Yield the longest prefix of elements satisfying the predicate without copying.O(n)Q Drop the longest prefix of elements that satisfy the predicate without copying.O(n) Split the vector in two parts, the first one containing those elements that satisfy the predicate and the second one those that don't. The relative order of the elements is preserved at the cost of a sometimes reduced performance compared to .O(n) Split the vector in two parts, the first one containing those elements that satisfy the predicate and the second one those that don't. The order of the elements is not preserved but the operation is often faster than .O(n)o Split the vector into the longest prefix of elements that satisfy the predicate and the rest without copying.O(n)v Split the vector into the longest prefix of elements that do not satisfy the predicate and the rest without copying.O(n)( Check if the vector contains an elementO(n)= Check if the vector does not contain an element (inverse of )O(n) Yield F- the first element matching the predicate or E if no such element exists.O(n) Yield F; the index of the first element matching the predicate or E if no such element exists.O(n)L Yield the indices of elements satisfying the predicate in ascending order.O(n) Yield F; the index of the first occurence of the given element or EO if the vector does not contain the element. This is a specialised version of .O(n)p Yield the indices of all occurences of the given element in ascending order. This is a specialised version of .O(n) Left foldO(n) Left fold on non-empty vectorsO(n)" Left fold with strict accumulatorO(n)7 Left fold on non-empty vectors with strict accumulatorO(n) Right foldO(n) Right fold on non-empty vectorsO(n)% Right fold with a strict accumulatorO(n)8 Right fold on non-empty vectors with strict accumulatorO(n); Left fold (function applied to each element and its index)O(n)T Left fold with strict accumulator (function applied to each element and its index)O(n)< Right fold (function applied to each element and its index)O(n)U Right fold with strict accumulator (function applied to each element and its index)O(n)- Check if all elements satisfy the predicate.O(n). Check if any element satisfies the predicate.O(n) Check if all elements are gO(n) Check if any element is gO(n) Compute the sum of the elementsO(n)$ Compute the produce of the elementsO(n)G Yield the maximum element of the vector. The vector may not be empty.O(n)r Yield the maximum element of the vector according to the given comparison function. The vector may not be empty.O(n)G Yield the minimum element of the vector. The vector may not be empty.O(n)r Yield the minimum element of the vector according to the given comparison function. The vector may not be empty.O(n)T Yield the index of the maximum element of the vector. The vector may not be empty.O(n) Yield the index of the maximum element of the vector according to the given comparison function. The vector may not be empty.O(n)T Yield the index of the minimum element of the vector. The vector may not be empty.O(n) Yield the index of the minimum element of the vector according to the given comparison function. The vector may not be empty.O(n) Monadic fold O(n)$ Monadic fold over non-empty vectors O(n)% Monadic fold with strict accumulator O(n)< Monadic fold over non-empty vectors with strict accumulator O(n)& Monadic fold that discards the result O(n)= Monadic fold over non-empty vectors that discards the resultO(n)> Monadic fold with strict accumulator that discards the resultO(n)V Monadic fold over non-empty vectors with strict accumulator that discards the resultO(n) Prescan prescanl f z =  .  f z  Example: $prescanl (+) 0 <1,2,3,4> = <0,1,3,6>O(n) Prescan with strict accumulatorO(n) Scan postscanl f z =  .  f z  Example: &postscanl (+) 0 <1,2,3,4> = <1,3,6,10>O(n) Scan with strict accumulatorO(n) Haskell-style scan Sscanl f z <x1,...,xn> = <y1,...,y(n+1)> where y1 = z yi = f y(i-1) x(i-1) Example: $scanl (+) 0 <1,2,3,4> = <0,1,3,6,10>O(n)+ Haskell-style scan with strict accumulatorO(n) Scan over a non-empty vector Jscanl f <x1,...,xn> = <y1,...,yn> where y1 = x1 yi = f y(i-1) xiO(n)7 Scan over a non-empty vector with a strict accumulatorO(n) Right-to-left prescan prescanr f z =  .  (flip f) z .  O(n). Right-to-left prescan with strict accumulatorO(n) Right-to-left scanO(n)+ Right-to-left scan with strict accumulatorO(n)! Right-to-left Haskell-style scanO(n)9 Right-to-left Haskell-style scan with strict accumulatorO(n)+ Right-to-left scan over a non-empty vectorO(n)F Right-to-left scan over a non-empty vector with a strict accumulator O(n) Convert a vector to a list!O(n) Convert a list to a vector"O(n) Convert the first n elements of a list to a vector fromListN n xs = ! ( n xs) #O(1) Unsafe convert a mutable vector to an immutable one without copying. The mutable vector may not be used after this operation.$O(1) Unsafely convert an immutable vector to a mutable one without copying. The immutable vector may not be used after this operation.%O(n). Yield a mutable copy of the immutable vector.&O(n)/ Yield an immutable copy of the mutable vector.'O(n)n Copy an immutable vector into a mutable one. The two vectors must have the same length. This is not checked.(O(n)Y Copy an immutable vector into a mutable one. The two vectors must have the same length.)O(1) Zip 2 vectors*O(1) Unzip 2 vectors+O(1) Zip 3 vectors,O(1) Unzip 3 vectors-O(1) Zip 4 vectors.O(1) Unzip 4 vectors/O(1) Zip 5 vectors0O(1) Unzip 5 vectors1O(1) Zip 6 vectors2O(1) Unzip 6 vectorsi starting indexn lengthi starting indexn lengthinitial vector (of length m)%list of index/value pairs (of length n) initial vector (of length m)'vector of index/value pairs (of length n)initial vector (of length m)index vector (of length n1)value vector (of length n2)accumulating function finitial vector (of length m)%list of index/value pairs (of length n)accumulating function finitial vector (of length m)'vector of index/value pairs (of length n)accumulating function finitial vector (of length m)index vector (of length n1)value vector (of length n2)      !"#$%&'()*+,-./012-./012      !"#$%&'()*+,-./012)+-/1*,.02      !"&%(#$'      !"#$%&'()*+,-./012-./012 (c) Roman Leshchinskiy 2009-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone+!3Length of the mutable vector.4!Check whether the vector is empty56Yield a part of the mutable vector without copying it.;WYield a part of the mutable vector without copying it. No bounds checks are performed.A,Create a mutable vector of the given length.BGCreate a mutable vector of the given length. The length is not checked.CmCreate a mutable vector of the given length (0 if the length is negative) and fill it with an initial value.DCreate a mutable vector of the given length (0 if the length is negative) and fill it with values produced by repeatedly executing the monadic action.E"Create a copy of a mutable vector.FLGrow a vector by the given number of elements. The number must be positive.GdGrow a vector by the given number of elements. The number must be positive but this is not checked.HReset all elements of the vector to some undefined value, clearing all references to external objects. This is usually a noop for unboxed vectors. I(Yield the element at the given position.J*Replace the element at the given position.K)Swap the elements at the given positions.LHYield the element at the given position. No bounds checks are performed.MJReplace the element at the given position. No bounds checks are performed.NISwap the elements at the given positions. No bounds checks are performed.O2Set all elements of the vector to the given value.PNCopy a vector. The two vectors must have the same length and may not overlap.QcCopy a vector. The two vectors must have the same length and may not overlap. This is not checked.RJMove the contents of a vector. The two vectors must have the same length.:If the vectors do not overlap, then this is equivalent to P. Otherwise, the copying is performed as if the source vector were copied to a temporary vector and then the temporary vector was copied to the target vector.ScMove the contents of a vector. The two vectors must have the same length, but this is not checked.:If the vectors do not overlap, then this is equivalent to Q. Otherwise, the copying is performed as if the source vector were copied to a temporary vector and then the temporary vector was copied to the target vector.TO(1) Zip 2 vectorsUO(1) Unzip 2 vectorsVO(1) Zip 3 vectorsWO(1) Unzip 3 vectorsXO(1) Zip 4 vectorsYO(1) Unzip 4 vectorsZO(1) Zip 5 vectors[O(1) Unzip 5 vectors\O(1) Zip 6 vectors]O(1) Unzip 6 vectors+3456789:;starting indexlength of the slice<=>?@ABCDEFGHIJKLMNOPQtargetsourceRStargetsourceTUVWXYZ[\]D3456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]/3459:678;>?<=@ABCDEFGHTVXZ\UWY[]IJKLMNOPRQS+3456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone +246=K`7Mutable boxed vectors keyed on the monad they live in (3 or ST s).bLength of the mutable vector.c!Check whether the vector is emptyd6Yield a part of the mutable vector without copying it.jWYield a part of the mutable vector without copying it. No bounds checks are performed.p,Create a mutable vector of the given length.qGCreate a mutable vector of the given length. The length is not checked.rmCreate a mutable vector of the given length (0 if the length is negative) and fill it with an initial value.sCreate a mutable vector of the given length (0 if the length is negative) and fill it with values produced by repeatedly executing the monadic action.t"Create a copy of a mutable vector.uLGrow a vector by the given number of elements. The number must be positive.vdGrow a vector by the given number of elements. The number must be positive but this is not checked.wReset all elements of the vector to some undefined value, clearing all references to external objects. This is usually a noop for unboxed vectors. x(Yield the element at the given position.y*Replace the element at the given position.z)Swap the elements at the given positions.{HYield the element at the given position. No bounds checks are performed.|JReplace the element at the given position. No bounds checks are performed.}ISwap the elements at the given positions. No bounds checks are performed.~2Set all elements of the vector to the given value.NCopy a vector. The two vectors must have the same length and may not overlap.cCopy a vector. The two vectors must have the same length and may not overlap. This is not checked.JMove the contents of a vector. The two vectors must have the same length.:If the vectors do not overlap, then this is equivalent to . Otherwise, the copying is performed as if the source vector were copied to a temporary vector and then the temporary vector was copied to the target vector.cMove the contents of a vector. The two vectors must have the same length, but this is not checked.:If the vectors do not overlap, then this is equivalent to . Otherwise, the copying is performed as if the source vector were copied to a temporary vector and then the temporary vector was copied to the target vector.+^_`a45678bcdefghijstarting indexlength of the sliceklmnopqrstuvwxyz{|}~targetsourcetargetsource9%^_`abcdefghijklmnopqrstuvwxyz{|}~%`a_^bcdhiefgjmnklopqrstuvwxyz{|}~*^_`a45678bcdefghijklmnopqrstuvwxyz{|}~9 (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone +246=HKM,Boxed vectors, supporting efficient slicing.O(1) Yield the length of the vector.O(1) Test whether a vector if empty O(1) IndexingO(1) Safe indexingO(1) First elementO(1) Last elementO(1)( Unsafe indexing without bounds checkingO(1)6 First element without checking if the vector is emptyO(1)5 Last element without checking if the vector is emptyO(1) Indexing in a monad.xThe monad allows operations to be strict in the vector when necessary. Suppose vector copying is implemented like this: &copy mv v = ... write mv i (v ! i) ...For lazy vectors, v ! i) would not be evaluated which means that mv, would unnecessarily retain a reference to v in each element written.With /, copying can be implemented like this instead: Scopy mv v = ... do x <- indexM v i write mv i xHere, no references to v$ are retained because indexing (but not% the elements) is evaluated eagerly.O(1)+ First element of a vector in a monad. See + for an explanation of why this is useful.O(1)* Last element of a vector in a monad. See + for an explanation of why this is useful.O(1)0 Indexing in a monad without bounds checks. See + for an explanation of why this is useful.O(1)C First element in a monad without checking for empty vectors. See * for an explanation of why this is useful.O(1)B Last element in a monad without checking for empty vectors. See * for an explanation of why this is useful.O(1)S Yield a slice of the vector without copying it. The vector must contain at least i+n elements.O(1)N Yield all but the last element without copying. The vector may not be empty.O(1)O Yield all but the first element without copying. The vector may not be empty.O(1) Yield at the first n= elements without copying. The vector may contain less than n1 elements in which case it is returned unchanged.O(1) Yield all but the first n= elements without copying. The vector may contain less than n4 elements in which case an empty vector is returned.O(1) Yield the first n4 elements paired with the remainder without copying. Note that  n v is equivalent to ( n v,  n v) but slightly more efficient.O(1)P Yield a slice of the vector without copying. The vector must contain at least i+n" elements but this is not checked.O(1)f Yield all but the last element without copying. The vector may not be empty but this is not checked.O(1)g Yield all but the first element without copying. The vector may not be empty but this is not checked.O(1) Yield the first n= elements without copying. The vector must contain at least n" elements but this is not checked.O(1) Yield all but the first n= elements without copying. The vector must contain at least n" elements but this is not checked.O(1) Empty vectorO(1) Vector with exactly one elementO(n)@ Vector of the given length with the same value in each positionO(n)O Construct a vector of the given length by applying the function to each indexO(n)C Apply function n times to value. Zeroth element is original value.O(n)l Construct a vector by repeatedly applying the generator function to a seed. The generator function yields F' the next element and the new seed or E if there are no more elements. Uunfoldr (\n -> if n == 0 then Nothing else Just (n,n-1)) 10 = <10,9,8,7,6,5,4,3,2,1>O(n)! Construct a vector with at most n] by repeatedly applying the generator function to the a seed. The generator function yields F' the next element and the new seed or E if there are no more elements. -unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8>O(n) Construct a vector with ng elements by repeatedly applying the generator function to the already constructed part of the vector. DconstructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in f <a,b,c>O(n) Construct a vector with n{ elements from right to left by repeatedly applying the generator function to the already constructed part of the vector. DconstructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in f <c,b,a>O(n): Yield a vector of the given length containing the values x, x+15 etc. This operation is usually more efficient than . enumFromN 5 3 = <5,6,7>O(n): Yield a vector of the given length containing the values x, x+y, x+y+y5 etc. This operations is usually more efficient than . +enumFromStepN 1 0.1 5 = <1,1.1,1.2,1.3,1.4>O(n) Enumerate values from x to y.WARNING:B This operation can be very inefficient. If at all possible, use  instead.O(n) Enumerate values from x to y with a specific step z.WARNING:B This operation can be very inefficient. If at all possible, use  instead.O(n) Prepend an elementO(n) Append an elementO(m+n) Concatenate two vectorsO(n)$ Concatenate all vectors in the listO(n)Y Execute the monadic action the given number of times and store the results in a vector.O(n)U Construct a vector of the given length by applying the monadic action to each index;Execute the monadic action and freeze the resulting vector. Fcreate (do { v <- new 2; write v 0 'a'; write v 1 'b'; return v }) = <a,b> O(n)Y Yield the argument but force it not to retain any extra memory, possibly by copying it.@This is especially useful when dealing with slices. For example: force (slice 0 2 <huge vector>)Here, the slice retains a reference to the huge vector. Forcing it creates a copy of just the elements that belong to the slice and allows the huge vector to be garbage collected.O(m+n) For each pair (i,a)8 from the list, replace the vector element at position i by a. ,<5,9,2,7> // [(2,1),(0,3),(2,8)] = <3,9,8,7>O(m+n) For each pair (i,a)O from the vector of index/value pairs, replace the vector element at position i by a. 0update <5,9,2,7> <(2,1),(0,3),(2,8)> = <3,9,8,7>O(m+min(n1,n2)) For each index i4 from the index vector and the corresponding value aO from the value vector, replace the element of the initial vector at position i by a. .update_ <5,9,2,7> <2,0,2> <1,3,8> = <3,9,8,7> The function A provides the same functionality and is usually more convenient. update_ xs is ys =  xs ( is ys)  Same as () but without bounds checking.Same as  but without bounds checking.Same as  but without bounds checking.O(m+n) For each pair (i,b), from the list, replace the vector element a at position i by f a b. ?accum (+) <5,9,2> [(2,4),(1,6),(0,3),(1,7)] = <5+3, 9+6+7, 2+4>O(m+n) For each pair (i,b)7 from the vector of pairs, replace the vector element a at position i by f a b. Daccumulate (+) <5,9,2> <(2,4),(1,6),(0,3),(1,7)> = <5+3, 9+6+7, 2+4>O(m+min(n1,n2)) For each index i4 from the index vector and the corresponding value bT from the the value vector, replace the element of the initial vector at position i by f a b. ?accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4> The function A provides the same functionality and is usually more convenient. accumulate_ f as is bs =  f as ( is bs) Same as  but without bounds checking.Same as  but without bounds checking.Same as  but without bounds checking.O(n) Reverse a vectorO(n)5 Yield the vector obtained by replacing each element i of the index vector by xsi. This is equivalent to  (xs) is# but is often much more efficient. 3backpermute <a,b,c,d> <0,3,2,3,1,0> = <a,d,c,d,b,a>Same as  but without bounds checking.Apply a destructive operation to a vector. The operation will be performed in place if it is safe to do so and will modify a copy of the vector otherwise. modify (\v -> write v 0 'x') ( 3 'a') = <'x','a','a'> O(n)- Pair each element in a vector with its indexO(n) Map a function over a vectorO(n)< Apply a function to every element of a vector and its index9Map a function over a vector and concatenate the results.O(n)V Apply the monadic action to all elements of the vector, yielding a vector of resultsO(n)M Apply the monadic action to all elements of a vector and ignore the resultsO(n)e Apply the monadic action to all elements of the vector, yielding a vector of results. Equvalent to flip .O(n)] Apply the monadic action to all elements of a vector and ignore the results. Equivalent to flip . O(min(m,n))) Zip two vectors with the given function.*Zip three vectors with the given function. O(min(m,n))H Zip two vectors with a function that also takes the elements' indices.<Zip three vectors and their indices with the given function.'Elementwise pairing of array elements. 3zip together three vectors into a vector of triples O(min(m,n)) Unzip a vector of pairs. O(min(m,n))K Zip the two vectors with the monadic action and yield a vector of results O(min(m,n))D Zip the two vectors with the monadic action and ignore the resultsO(n)0 Drop elements that do not satisfy the predicateO(n)^ Drop elements that do not satisfy the predicate which is applied to values and their indicesO(n)8 Drop elements that do not satisfy the monadic predicateO(n)P Yield the longest prefix of elements satisfying the predicate without copying.O(n)Q Drop the longest prefix of elements that satisfy the predicate without copying.O(n) Split the vector in two parts, the first one containing those elements that satisfy the predicate and the second one those that don't. The relative order of the elements is preserved at the cost of a sometimes reduced performance compared to .O(n) Split the vector in two parts, the first one containing those elements that satisfy the predicate and the second one those that don't. The order of the elements is not preserved but the operation is often faster than .O(n)o Split the vector into the longest prefix of elements that satisfy the predicate and the rest without copying.O(n)v Split the vector into the longest prefix of elements that do not satisfy the predicate and the rest without copying.O(n)( Check if the vector contains an elementO(n)= Check if the vector does not contain an element (inverse of )O(n) Yield F- the first element matching the predicate or E if no such element exists.O(n) Yield F; the index of the first element matching the predicate or E if no such element exists.O(n)L Yield the indices of elements satisfying the predicate in ascending order.O(n) Yield F; the index of the first occurence of the given element or EO if the vector does not contain the element. This is a specialised version of .O(n)p Yield the indices of all occurences of the given element in ascending order. This is a specialised version of .O(n) Left foldO(n) Left fold on non-empty vectorsO(n)" Left fold with strict accumulatorO(n)7 Left fold on non-empty vectors with strict accumulatorO(n) Right foldO(n) Right fold on non-empty vectorsO(n)% Right fold with a strict accumulatorO(n)8 Right fold on non-empty vectors with strict accumulatorO(n); Left fold (function applied to each element and its index)O(n)T Left fold with strict accumulator (function applied to each element and its index)O(n)< Right fold (function applied to each element and its index)O(n)U Right fold with strict accumulator (function applied to each element and its index)O(n)- Check if all elements satisfy the predicate.O(n). Check if any element satisfies the predicate.O(n) Check if all elements are gO(n) Check if any element is gO(n) Compute the sum of the elementsO(n)$ Compute the produce of the elementsO(n)G Yield the maximum element of the vector. The vector may not be empty.O(n)r Yield the maximum element of the vector according to the given comparison function. The vector may not be empty.O(n)G Yield the minimum element of the vector. The vector may not be empty.O(n)r Yield the minimum element of the vector according to the given comparison function. The vector may not be empty.O(n)T Yield the index of the maximum element of the vector. The vector may not be empty.O(n) Yield the index of the maximum element of the vector according to the given comparison function. The vector may not be empty. O(n)T Yield the index of the minimum element of the vector. The vector may not be empty. O(n) Yield the index of the minimum element of the vector according to the given comparison function. The vector may not be empty. O(n) Monadic fold O(n)$ Monadic fold over non-empty vectors O(n)% Monadic fold with strict accumulatorO(n)< Monadic fold over non-empty vectors with strict accumulatorO(n)& Monadic fold that discards the resultO(n)= Monadic fold over non-empty vectors that discards the resultO(n)> Monadic fold with strict accumulator that discards the resultO(n)V Monadic fold over non-empty vectors with strict accumulator that discards the result,Evaluate each action and collect the results,Evaluate each action and discard the resultsO(n) Prescan prescanl f z =  .  f z  Example: $prescanl (+) 0 <1,2,3,4> = <0,1,3,6>O(n) Prescan with strict accumulatorO(n) Scan postscanl f z =  .  f z  Example: &postscanl (+) 0 <1,2,3,4> = <1,3,6,10>O(n) Scan with strict accumulatorO(n) Haskell-style scan Sscanl f z <x1,...,xn> = <y1,...,y(n+1)> where y1 = z yi = f y(i-1) x(i-1) Example: $scanl (+) 0 <1,2,3,4> = <0,1,3,6,10>O(n)+ Haskell-style scan with strict accumulatorO(n) Scan over a non-empty vector Jscanl f <x1,...,xn> = <y1,...,yn> where y1 = x1 yi = f y(i-1) xiO(n)7 Scan over a non-empty vector with a strict accumulatorO(n) Right-to-left prescan prescanr f z =  .  (flip f) z .  O(n). Right-to-left prescan with strict accumulatorO(n) Right-to-left scan O(n)+ Right-to-left scan with strict accumulator!O(n)! Right-to-left Haskell-style scan"O(n)9 Right-to-left Haskell-style scan with strict accumulator#O(n)+ Right-to-left scan over a non-empty vector$O(n)F Right-to-left scan over a non-empty vector with a strict accumulator%O(n) Convert a vector to a list&O(n) Convert a list to a vector'O(n) Convert the first n elements of a list to a vector fromListN n xs = & ( n xs) (O(1) Unsafe convert a mutable vector to an immutable one without copying. The mutable vector may not be used after this operation.)O(1) Unsafely convert an immutable vector to a mutable one without copying. The immutable vector may not be used after this operation.*O(n). Yield a mutable copy of the immutable vector.+O(n)/ Yield an immutable copy of the mutable vector.,O(n)n Copy an immutable vector into a mutable one. The two vectors must have the same length. This is not checked.-O(n)Y Copy an immutable vector into a mutable one. The two vectors must have the same length.:i starting indexn lengthi starting indexn lengthinitial vector (of length m)%list of index/value pairs (of length n) initial vector (of length m)'vector of index/value pairs (of length n)initial vector (of length m)index vector (of length n1)value vector (of length n2)accumulating function finitial vector (of length m)%list of index/value pairs (of length n)accumulating function finitial vector (of length m)'vector of index/value pairs (of length n)accumulating function finitial vector (of length m)index vector (of length n1)value vector (of length n2)      !"#$%&'()*+,-;<=>?@ABCDEFGHIJK`      !"#$%&'()*+,-`      !"#$%&'+*-(),:      !"#$%&'()*+,-;<=>?@ABCDEFGHIJKL !"##$%%&'()*+,-./0123456789:;<<=>?@ABACDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~<CDEFGHIKMNOPQRSTUVWXY]^_fghijklmnoprtvwxz|Z[`aq~  E F T W X U V I J    T U V W X E F S P Q  T U V W X G H I K    M N O  J L            ^ Y  Z [   f g h i j      k l m n o ` a      p  q r t    v w x z ! " # |  $ % & ' ( ) * + , - . / 0 1 2 3 4 5 ~ 6 7 8 9 : ; < = > ? @ A B C D E F G H I J    K LMNEFTWXUVIJ   E F S P Q  T U V W X G H I K    M N O  J L          Y  Z [   f g h i j      ` a p  q r t    v w x z ! " # |  $ % & ' ( ) * + , - . / 0 1 2 3 4 5 ~ 6 7 8 9 < = > ? @ A B C E G H F MNEFTWXUVIJOPQRST  E F S P Q  T U V W X G H I K    M N O  J L          Y  Z [   f g h i j      ` a p  q r t    v w x z ! " # |  $ % & ' ( ) * + , - . / 0 1 2 3 4 5 ~ 6 7 8 9 < = > ? @ A B C O E G H F P Q R S TUMNEFSPQTUVWXGHIKMNOJL     ^YZ[fghij`apqrt vwxz!"#|$%&'()*+,-./012345~6789<=>?@ABCEGHFklmnoEFTWXUVIJklmnoMNEFTWXUVIJEFSPQTUVWXGHIKMNOJL     ^YZ[fghijklmno`apqrt vwxz!"#|$%&'()*+,-./012345~6789:;<=>?@ABCEGHFVWXYZ[\]^_`abcdefghijklmnopoqrstuvwxyz{|}~                VVWVW                                       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGVHIJKLMNOPQRSTUvector-0.10.12.3Data.Vector.Storable.MutableData.Vector.Primitive.MutableData.Vector.Storable.InternalData.Vector.Fusion.UtilData.Vector.Fusion.Stream.SizeData.Vector.Internal.Check!Data.Vector.Fusion.Stream.MonadicData.Vector.Fusion.StreamData.Vector.Generic.MutableData.Vector.GenericData.Vector.Generic.NewData.Vector.PrimitiveData.Vector.StorableData.Vector.UnboxedData.Vector.Unboxed.MutableData.Vector.Mutable Data.VectorData.Vector.Generic.BasePrelude showsPrec Text.ReadreadPrec Data.DatagfoldlData.Vector.Unboxed.BasebaseForeign.StorableStorable primitive-0.6Data.Primitive.TypesPrimgetPtrsetPtrupdPtrBoxunBoxIdunId delay_inline delayed_minSizeUnknownMaxExactsmallerlargertoMax upperBoundChecksInternalUnsafeBoundsdoCheckserror internalErrorcheck checkIndex checkLength checkSliceStreamStepDoneSkipYieldSPECSPEC2sizesizedlengthnullempty singleton replicate replicateMgenerate generateMconssnoc++headlast!!!?sliceinittailtakedropmapmapMmapM_transunboxindexedindexedRzipWithM zipWithM_ zipWith3M zipWith4M zipWith5M zipWith6MzipWithzipWith3zipWith4zipWith5zipWith6zipzip3zip4zip5zip6filterfilterM takeWhile takeWhileM dropWhile dropWhileMelemnotElemfindfindM findIndex findIndexMfoldlfoldlMfoldMfoldl1foldl1Mfold1Mfoldl'foldlM'foldM'foldl1'foldl1M'fold1M'foldrfoldrMfoldr1foldr1Mandor concatMap concatMapMflattenunfoldrunfoldrMunfoldrN unfoldrNM iterateNMiterateNprescanl prescanlM prescanl' prescanlM' postscanl postscanlM postscanl' postscanlM'scanlscanlMscanl'scanlM'scanl1scanl1Mscanl1'scanl1M' enumFromStepN enumFromToenumFromThenTotoListfromList fromListNunsafeFromListMStreaminplace liftStreameqcmpMVector basicLengthbasicUnsafeSlice basicOverlapsbasicUnsafeNewbasicUnsafeReplicatebasicUnsafeReadbasicUnsafeWrite basicClearbasicSetbasicUnsafeCopybasicUnsafeMovebasicUnsafeGrowmstreamfill transformmstreamRfillR transformRunstream munstream unstreamR munstreamRsplitAt unsafeSlice unsafeInit unsafeTail unsafeTake unsafeDropoverlapsnew unsafeNewclonegrow unsafeGrowclearreadwriteswap unsafeRead unsafeWrite unsafeSwapsetcopymove unsafeCopy unsafeMoveaccumupdate unsafeAccum unsafeUpdatereverseunstablePartitionunstablePartitionStreampartitionStreamVectorbasicUnsafeFreezebasicUnsafeThawbasicUnsafeIndexMelemseqMutableNewcreaterunrunPrimapplymodifymodifyWithStream! unsafeIndex unsafeHead unsafeLastindexMheadMlastM unsafeIndexM unsafeHeadM unsafeLastM constructN constructrN enumFromNconcatforce//update_ unsafeUpd unsafeUpdate_ accumulate accumulate_unsafeAccumulateunsafeAccumulate_ backpermuteunsafeBackpermuteimapforMforM_izipWith izipWith3 izipWith4 izipWith5 izipWith6unzipunzip3unzip4unzip5unzip6ifilter partitionspanbreak findIndices elemIndex elemIndicesfoldr'foldr1'ifoldlifoldl'ifoldrifoldr'allanysumproductmaximum maximumByminimum minimumBymaxIndex maxIndexByminIndex minIndexByfoldM_fold1M_foldM'_fold1M'_sequence sequence_prescanr prescanr' postscanr postscanr'scanrscanr'scanr1scanr1'convert unsafeFreezefreeze unsafeThawthawstreamstreamRmkTypedataCastSTVectorIOVector unsafeCastunsafeFromForeignPtrunsafeFromForeignPtr0unsafeToForeignPtrunsafeToForeignPtr0 unsafeWithUnboxghc-prim GHC.Classesmin $fMonadBox$fApplicativeBox $fFunctorBox $fMonadId$fApplicativeId $fFunctorId lowerBound $fNumSizenot&&||doBoundsChecksdoUnsafeChecksdoInternalChecks error_msg checkErrorcheckIndex_msgcheckIndex_msg#checkLength_msgcheckLength_msg#checkSlice_msgcheckSlice_msg# Data.MaybeNothingJust DropWhileDropWhile_NextDropWhile_YieldDropWhile_Drop emptyStreamconsumeenumFromTo_smallenumFromTo_intenumFromTo_big_wordenumFromTo_big_intenumFromTo_charenumFromTo_double$fFunctorStreamtoListFB $fOrdStream $fEqStreamenlargeexchangeunsafeExchange unsafeAppend1unsafePrepend1 munstreamMaxmunstreamUnknown munstreamRMaxmunstreamRUnknown growFront enlarge_delta enlargeFrontunsafeGrowFrontunstablePartitionMax partitionMaxpartitionUnknown GHC.TypesTrueEqOrd update_streamunsafeUpdate_stream accum_streamunsafeAccum_streampartition_streamunstablePartition_streamunstablePartition_newdiscard unstreamM unstreamPrimMunstreamPrimM_IOunstreamPrimM_ST$fMVectorMVectora$fNFDataMVector$fIsListVector$fMonoidVector $fOrdVector $fEqVector$fVectorVectoraTFCo:R:MutableVector $fDataVector $fReadVector $fShowVector$fNFDataVectorGHC.ForeignPtr ForeignPtr storableSetstorableSetAsPrim mallocVectorV_6MV_6V_5MV_5V_4MV_4V_3MV_3V_2MV_2 V_Complex MV_ComplexV_BoolMV_BoolV_CharMV_CharV_Double MV_DoubleV_FloatMV_FloatV_Word64 MV_Word64V_Word32 MV_Word32V_Word16 MV_Word16V_Word8MV_Word8V_WordMV_WordV_Int64MV_Int64V_Int32MV_Int32V_Int16MV_Int16V_Int8MV_Int8V_IntMV_IntV_UnitMV_UnitfromBooltoBool$fVectorVector(,,,,,)$fMVectorMVector(,,,,,)$fUnbox(,,,,,)TFCo:R:Vector(,,,,,)TFCo:R:MVectors(,,,,,)$fVectorVector(,,,,)$fMVectorMVector(,,,,) $fUnbox(,,,,)TFCo:R:Vector(,,,,)TFCo:R:MVectors(,,,,)$fVectorVector(,,,)$fMVectorMVector(,,,) $fUnbox(,,,)TFCo:R:Vector(,,,)TFCo:R:MVectors(,,,)$fVectorVector(,,)$fMVectorMVector(,,) $fUnbox(,,)TFCo:R:Vector(,,)TFCo:R:MVectors(,,)$fVectorVector(,)$fMVectorMVector(,) $fUnbox(,)TFCo:R:Vector(,)TFCo:R:MVectors(,)$fVectorVectorComplex$fMVectorMVectorComplex$fUnboxComplexTFCo:R:VectorComplexTFCo:R:MVectorsComplex$fVectorVectorBool$fMVectorMVectorBool $fUnboxBoolTFCo:R:VectorBoolTFCo:R:MVectorsBool$fVectorVectorChar$fMVectorMVectorChar $fUnboxCharTFCo:R:VectorCharTFCo:R:MVectorsChar$fVectorVectorDouble$fMVectorMVectorDouble $fUnboxDoubleTFCo:R:VectorDoubleTFCo:R:MVectorsDouble$fVectorVectorFloat$fMVectorMVectorFloat $fUnboxFloatTFCo:R:VectorFloatTFCo:R:MVectorsFloat$fVectorVectorWord64$fMVectorMVectorWord64 $fUnboxWord64TFCo:R:VectorWord64TFCo:R:MVectorsWord64$fVectorVectorWord32$fMVectorMVectorWord32 $fUnboxWord32TFCo:R:VectorWord32TFCo:R:MVectorsWord32$fVectorVectorWord16$fMVectorMVectorWord16 $fUnboxWord16TFCo:R:VectorWord16TFCo:R:MVectorsWord16$fVectorVectorWord8$fMVectorMVectorWord8 $fUnboxWord8TFCo:R:VectorWord8TFCo:R:MVectorsWord8$fVectorVectorWord$fMVectorMVectorWord $fUnboxWordTFCo:R:VectorWordTFCo:R:MVectorsWord$fVectorVectorInt64$fMVectorMVectorInt64 $fUnboxInt64TFCo:R:VectorInt64TFCo:R:MVectorsInt64$fVectorVectorInt32$fMVectorMVectorInt32 $fUnboxInt32TFCo:R:VectorInt32TFCo:R:MVectorsInt32$fVectorVectorInt16$fMVectorMVectorInt16 $fUnboxInt16TFCo:R:VectorInt16TFCo:R:MVectorsInt16$fVectorVectorInt8$fMVectorMVectorInt8 $fUnboxInt8TFCo:R:VectorInt8TFCo:R:MVectorsInt8$fVectorVectorInt$fMVectorMVectorInt $fUnboxIntTFCo:R:VectorIntTFCo:R:MVectorsInt$fVectorVector()$fMVectorMVector() $fUnbox()TFCo:R:Vector()TFCo:R:MVectors()IO moveBackwardsmoveForwardsSmallOverlapmoveForwardsLargeOverlaploopM uninitialised$fTraversableVector$fFoldableVector$fAlternativeVector$fApplicativeVector$fMonadPlusVector $fMonadVector$fFunctorVector