!?k      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123 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{|}~                                                                                                                 ! " # $ % & ' ( ) * + , - . / 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{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij(c) Roman Leshchinskiy 2009 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimentalportableSafeWvector Box monadvectorIdentity monad vectorFDelay inlining a function until late in the game (simplifier phase 0). vectork inlined in phase 0    (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimentalportableSafe_ vector Size hintvector Exact sizevectorUpper bound on the sizevector Unknown sizevector;Subtract two sizes with clamping to 0, for drop-like thingsvectorMinimum of two size hintsvectorMaximum of two size hintsvector%Convert a size hint to an upper boundvector)Compute the minimum size from a size hintvector5Compute the maximum size from a size hint if possible   (c) Roman Leshchinskiy 2008-2011 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone>?FT-vectorCClass of mutable vectors parametrised with a primitive state token. vectorNLength of the mutable vector. This method should not be called directly, use l instead.!vectorgYield a part of the mutable vector without copying it. This method should not be called directly, use  unsafeSlice instead."vectorSCheck whether two vectors overlap. This method should not be called directly, use overlaps instead.#vector]Create a mutable vector of the given length. This method should not be called directly, use  unsafeNew instead.$vectorInitialize a vector to a standard value. This is intended to be called as part of the safe new operation (and similar operations), to properly blank the newly allocated memory if necessary.\Vectors that are necessarily initialized as part of creation may implement this as a no-op.%vectorCreate a mutable vector of the given length and fill it with an initial value. This method should not be called directly, use m instead.&vectorYYield the element at the given position. This method should not be called directly, use  unsafeRead instead.'vector[Replace the element at the given position. This method should not be called directly, use  unsafeWrite instead.(vectorReset 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 clear instead.)vectorcSet all elements of the vector to the given value. This method should not be called directly, use set instead.*vector`Copy a vector. The two vectors may not overlap. This method should not be called directly, use  unsafeCopy instead.+vectorlMove the contents of a vector. The two vectors may overlap. This method should not be called directly, use  unsafeMove instead.,vector_Grow a vector by the given number of elements. This method should not be called directly, use  unsafeGrow instead.!vectorstarting indexvectorlength of the slice*vectortargetvectorsource+vectortargetvectorsource !"#$%&'()*+, !"#$%&'()*+, (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone <>?FQTV~ -vectorgClass of immutable vectors. Every immutable vector is associated with its mutable version through the 5K 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:./012.vectorAssumed complexity: O(1)Unsafely convert a mutable vector to its immutable version without copying. The mutable vector may not be used after this operation./vectorAssumed complexity: O(1)Unsafely convert an immutable vector to its mutable version without copying. The immutable vector may not be used after this operation.0vectorAssumed complexity: O(1)Yield the length of the vector.1vectorAssumed complexity: O(1)OYield a slice of the vector without copying it. No range checks are performed.2vectorAssumed 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 2 , 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.3vectorAssumed 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 2 and basicUnsafeWrite.4vector 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 all5vector Mutable v s a0 is the mutable version of the pure vector type v a with the state token s1vectorstarting indexvectorlength -013./245(c) Roman Leshchinskiy 2009 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNoneDz 6978:;<=>?@ 6978:;<=>?@n3o2 (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone&';=>?CFQVdWBvectorMonadic streamsDvector*Result of taking a single step in a streamHvector Length of a BIvector Check if a B is emptyJvectorEmpty BKvector Singleton BLvector#Replicate a value to a given lengthMvectorYield a BO of values obtained by performing the monadic action the given number of timesOvector"Generate a stream from its indicesPvectorPrepend an elementQvectorAppend an elementRvectorConcatenate two BsSvectorFirst element of the B or error if emptyTvectorLast element of the B or error if emptyUvectorElement at the given positionVvector!Element at the given position or p if out of boundsWvectorGExtract a substream of the given length starting at the given position.XvectorAll but the last elementYvectorAll but the first elementZvector The first n elements[vectorAll but the first n elements\vectorMap a function over a B]vectorMap a monadic function over a B^vector1Execute a monadic action for each element of the B_vector Transform a B to use a different monadavectorPair each element in a B with its indexbvectorPair each element in a B; with its index, starting from the right and counting downcvectorZip two B!s with the given monadic functionsvector Check if two B s are equaltvectorLexicographically compare two Bsuvector0Drop elements which do not satisfy the predicatewvector8Drop elements which do not satisfy the monadic predicatexvector Drop repeated adjacent elements.yvector5Longest prefix of elements that satisfy the predicatezvector=Longest prefix of elements that satisfy the monadic predicate{vector>Drop the longest prefix of elements that satisfy the predicate|vectorFDrop the longest prefix of elements that satisfy the monadic predicate}vectorCheck whether the B contains an element~vector Inverse of }vectorYield q3 the first element that satisfies the predicate or p if no such element exists.vectorYield q< the first element that satisfies the monadic predicate or p if no such element exists.vectorYield qA the index of the first element that satisfies the predicate or p if no such element exists.vectorYield qI the index of the first element that satisfies the monadic predicate or p if no such element exists.vector Left foldvector!Left fold with a monadic operatorvectorSame as vectorLeft fold over a non-empty BvectorLeft fold over a non-empty B with a monadic operatorvectorSame as vector#Left fold with a strict accumulatorvector:Left fold with a strict accumulator and a monadic operatorvectorSame as vectorLeft fold over a non-empty B with a strict accumulatorvectorLeft fold over a non-empty B2 with a strict accumulator and a monadic operatorvectorSame as vector Right foldvector"Right fold with a monadic operatorvector"Right fold over a non-empty streamvector:Right fold over a non-empty stream with a monadic operatorvector Create a B of values from a B of streamable thingsvectorUnfoldvectorUnfold with a monadic functionvectorUnfold at most n" elements with a monadic functionsvectorJApply monadic function n times to value. Zeroth element is original value.vectorBApply function n times to value. Zeroth element is original value.vector Prefix scanvector#Prefix scan with a monadic operatorvector#Prefix scan with strict accumulatorvector:Prefix scan with strict accumulator and a monadic operatorvector Suffix scanvector#Suffix scan with a monadic operatorvector#Suffix scan with strict accumulatorvector;Suffix scan with strict acccumulator and a monadic operatorvectorHaskell-style scanvector*Haskell-style scan with a monadic operatorvector*Haskell-style scan with strict accumulatorvectorAHaskell-style scan with strict accumulator and a monadic operatorvectorScan over a non-empty BvectorScan over a non-empty B with a monadic operatorvectorScan over a non-empty B with a strict accumulatorvectorScan over a non-empty B2 with a strict accumulator and a monadic operatorvectorYield a B+ of the given length containing the values x, x+y, x+y+y etc.vectorEnumerate valuesWARNING:B This operation can be very inefficient. If at all possible, use  instead.vector#Enumerate values with a given step.WARNING:> This operation is very inefficient. If at all possible, use  instead.vector Convert a B to a listvectorConvert a list to a BvectorConvert the first n elements of a list to a BundleWvectorstarting indexvectorlengthuBCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~uBCDEFGHIJKPQLMNORSTUVWXYZ[\]^_`abdcefghijklmnopqrstuwxvyz{|}~R5U9 V9 }4~4 (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone&';=>?CFQVCYvectorMonadic streamsvector hint of a vector Attach a  hint to a vector Length of a vector Check if a  is emptyvectorEmpty vector Singleton vector#Replicate a value to a given lengthvectorYield a O of values obtained by performing the monadic action the given number of timesvector"Generate a stream from its indicesvectorPrepend an elementvectorAppend an elementvectorConcatenate two svectorFirst element of the  or error if emptyvectorLast element of the  or error if emptyvectorElement at the given positionvector!Element at the given position or p if out of boundsvectorGExtract a substream of the given length starting at the given position.vectorAll but the last elementvectorAll but the first elementvector The first n elementsvectorAll but the first n elementsvectorMap a function over a vectorMap a monadic function over a vector1Execute a monadic action for each element of the vector Transform a  to use a different monadvectorPair each element in a  with its indexvectorPair each element in a ; with its index, starting from the right and counting downvectorZip two !s with the given monadic functionvector Check if two  s are equalvectorLexicographically compare two svector0Drop elements which do not satisfy the predicatevector8Drop elements which do not satisfy the monadic predicatevector5Longest prefix of elements that satisfy the predicatevector=Longest prefix of elements that satisfy the monadic predicatevector>Drop the longest prefix of elements that satisfy the predicatevectorFDrop the longest prefix of elements that satisfy the monadic predicatevectorCheck whether the  contains an elementvector Inverse of vectorYield q3 the first element that satisfies the predicate or p if no such element exists.vectorYield q< the first element that satisfies the monadic predicate or p if no such element exists.vectorYield qA the index of the first element that satisfies the predicate or p if no such element exists.vectorYield qI the index of the first element that satisfies the monadic predicate or p if no such element exists.vector Left foldvector!Left fold with a monadic operatorvectorSame as vectorLeft fold over a non-empty vectorLeft fold over a non-empty  with a monadic operatorvectorSame as vector#Left fold with a strict accumulatorvector:Left fold with a strict accumulator and a monadic operatorvectorSame as vectorLeft fold over a non-empty  with a strict accumulatorvectorLeft fold over a non-empty 2 with a strict accumulator and a monadic operatorvectorSame as vector Right fold vector"Right fold with a monadic operator vector"Right fold over a non-empty stream vector:Right fold over a non-empty stream with a monadic operatorvector Create a  of values from a  of streamable thingsvectorUnfoldvectorUnfold with a monadic functionvectorUnfold at most n elementsvectorUnfold at most n" elements with a monadic functionsvectorJApply monadic function n times to value. Zeroth element is original value.vectorBApply function n times to value. Zeroth element is original value.vector Prefix scanvector#Prefix scan with a monadic operatorvector#Prefix scan with strict accumulatorvector:Prefix scan with strict accumulator and a monadic operatorvector Suffix scanvector#Suffix scan with a monadic operatorvector#Suffix scan with strict accumulatorvector;Suffix scan with strict acccumulator and a monadic operatorvectorHaskell-style scan vector*Haskell-style scan with a monadic operator!vector*Haskell-style scan with strict accumulator"vectorAHaskell-style scan with strict accumulator and a monadic operator#vectorScan over a non-empty $vectorScan over a non-empty  with a monadic operator%vectorScan over a non-empty  with a strict accumulator&vectorScan over a non-empty 2 with a strict accumulator and a monadic operator'vectorYield a + of the given length containing the values x, x+y, x+y+y etc.(vectorEnumerate valuesWARNING:B This operation can be very inefficient. If at all possible, use ' instead.)vector#Enumerate values with a given step.WARNING:> This operation is very inefficient. If at all possible, use ' instead.*vector Convert a  to a list+vectorConvert a list to a ,vectorConvert the first n elements of a list to a -vectorConvert a list to a  with the given  hint.vectorstarting indexvectorlength|      !"#$%&'()*+,-./01|      !"#$%&'()*+,-.1/059 9 44  (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone;=QV|D3vector$Alternative name for monadic streams4vectorThe type of pure streams6vector)Convert a pure stream to a monadic stream7vector hint of a 48vector Attach a  hint to a 49vector Length of a 4:vector Check if a 4 is empty;vectorEmpty 4<vector Singleton 4=vector#Replicate a value to a given length>vector"Generate a stream from its indices?vectorPrepend an element@vectorAppend an elementAvectorConcatenate two 4sBvectorFirst element of the 4 or error if emptyCvectorLast element of the 4 or error if emptyDvectorElement at the given positionEvector!Element at the given position or p if out of boundsFvectorGExtract a substream of the given length starting at the given position.GvectorAll but the last elementHvectorAll but the first elementIvector The first n elementsJvectorAll but the first n elementsKvectorMap a function over a 4NvectorPair each element in a 4 with its indexOvectorPair each element in a 4; with its index, starting from the right and counting downPvectorZip two 4s with the given functionQvector Zip three 4s with the given functionZvector0Drop elements which do not satisfy the predicate[vector5Longest prefix of elements that satisfy the predicate\vector>Drop the longest prefix of elements that satisfy the predicate]vectorCheck whether the 4 contains an element^vector Inverse of ]_vectorYield q- the first element matching the predicate or p if no such element exists.`vectorYield q; the index of the first element matching the predicate or p if no such element exists.avector Left foldbvectorLeft fold on non-empty 4scvector!Left fold with strict accumulatordvectorLeft fold on non-empty 4s with strict accumulatorevector Right foldfvectorRight fold on non-empty 4sivectorUnfoldjvectorUnfold at most n elementskvectorDApply function n-1 times to value. Zeroth element is original value.lvector Prefix scanmvector#Prefix scan with strict accumulatornvector Suffix scanovector#Suffix scan with strict accumulatorpvectorHaskell-style scanqvector*Haskell-style scan with strict accumulatorrvectorScan over a non-empty 4svectorScan over a non-empty 4 with a strict accumulatortvector Check if two 4 s are equalvvectorLexicographically compare two 4sxvector\Apply a monadic action to each element of the stream, producing a monadic stream of resultsyvector4Apply a monadic action to each element of the stream|vectorEYield a monadic stream of elements that satisfy the monadic predicate}vector Monadic fold~vector"Monadic fold over non-empty streamvector$Monadic fold with strict accumulatorvector8Monad fold over non-empty stream with strict accumulatorvectorYield a 4+ of the given length containing the values x, x+y, x+y+y etc.vectorEnumerate valuesWARNING:C This operations can be very inefficient. If at all possible, use  instead.vector#Enumerate values with a given step.WARNING:? This operations is very inefficient. If at all possible, use  instead.vector Convert a 4 to a listvector Create a 4 from a listvector Create a 4 from the first n elements of a list %fromListN n xs = fromList (take n xs)vector Create a 4 of values from a 4 of streamable thingsFvectorstarting indexvectorlength`DEFG3456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~`DEFG435789:;<?@=>ABCDEFGHIJKMLNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrs6xyz{|}~tvuwA5D9 E9 ]4^4  (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone <>?FTV"$vector?Create a new mutable vector and fill it with elements from the 4A. The vector will grow exponentially if the maximum size of the 4 is unknown.vectorCreate 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.vector?Create a new mutable vector and fill it with elements from the 4A. The vector will grow exponentially if the maximum size of the 4 is unknown.rvectorCreate 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.vector?Create a new mutable vector and fill it with elements from the 4U from right to left. The vector will grow exponentially if the maximum size of the 4 is unknown.vectorCreate 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.vectorLength of the mutable vector.vector!Check whether the vector is emptyvector6Yield a part of the mutable vector without copying it.vectorWYield a part of the mutable vector without copying it. No bounds checks are performed.vector"Check whether two vectors overlap.vector,Create a mutable vector of the given length.vectorKCreate a mutable vector of the given length. The memory is not initialized.vectormCreate a mutable vector of the given length (0 if the length is negative) and fill it with an initial value.vectorCreate 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.vector"Create a copy of a mutable vector.vectorLGrow a vector by the given number of elements. The number must be positive.svectorGrow a vector logarithmicallyvectordGrow a vector by the given number of elements. The number must be positive but this is not checked.vectorReset all elements of the vector to some undefined value, clearing all references to external objects. This is usually a noop for unboxed vectors.vector(Yield the element at the given position.vector*Replace the element at the given position.vector)Modify the element at the given position.vector)Swap the elements at the given positions.vectorDReplace the element at the give position and return the old element.vectorHYield the element at the given position. No bounds checks are performed.vectorJReplace the element at the given position. No bounds checks are performed.vectorIModify the element at the given position. No bounds checks are performed.vectorISwap the elements at the given positions. No bounds checks are performed.vectoreReplace the element at the give position and return the old element. No bounds checks are performed.vector2Set all elements of the vector to the given value.vectorNCopy a vector. The two vectors must have the same length and may not overlap.vectorJMove 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.vectorcCopy a vector. The two vectors must have the same length and may not overlap. This is not checked.vectorcMove 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.vector~Compute the next (lexicographically) permutation of given vector in-place. Returns False when input is the last permtuationvectorstarting indexvectorlength of the slicevectortargetvectorsourcevectortargetvectorsourcevectortargetvectorsourceI !"#$%&'()*+,I !"#$%&'()*+,  (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone<>?QVu (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone <>?FQTVvectorO(1) Yield the length of the vectorvectorO(1) Test whether a vector is emptyvector O(1) IndexingvectorO(1) Safe indexingvectorO(1) First elementvectorO(1) Last elementvectorO(1)( Unsafe indexing without bounds checkingvectorO(1)6 First element without checking if the vector is emptyvectorO(1)5 Last element without checking if the vector is emptyvectorO(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.vectorO(1)+ First element of a vector in a monad. See + for an explanation of why this is useful.vectorO(1)* Last element of a vector in a monad. See + for an explanation of why this is useful.vectorO(1)0 Indexing in a monad without bounds checks. See + for an explanation of why this is useful.vectorO(1)C First element in a monad without checking for empty vectors. See * for an explanation of why this is useful.vectorO(1)B Last element in a monad without checking for empty vectors. See * for an explanation of why this is useful.vectorO(1)S Yield a slice of the vector without copying it. The vector must contain at least i+n elements.vectorO(1)N Yield all but the last element without copying. The vector may not be empty.vectorO(1)O Yield all but the first element without copying. The vector may not be empty.vectorO(1) Yield the first n= elements without copying. The vector may contain less than n1 elements in which case it is returned unchanged.vectorO(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.vectorO(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.vectorO(1)P Yield a slice of the vector without copying. The vector must contain at least i+n" elements but this is not checked.vectorO(1)f Yield all but the last element without copying. The vector may not be empty but this is not checked.vectorO(1)g Yield all but the first element without copying. The vector may not be empty but this is not checked.vectorO(1) Yield the first n= elements without copying. The vector must contain at least n" elements but this is not checked.vectorO(1) Yield all but the first n= elements without copying. The vector must contain at least n" elements but this is not checked.vectorO(1) Empty vectorvectorO(1) Vector with exactly one elementvectorO(n)@ Vector of the given length with the same value in each positionvectorO(n)O Construct a vector of the given length by applying the function to each indexvectorO(n)C Apply function n times to value. Zeroth element is original value.vectorO(n)l Construct a vector by repeatedly applying the generator function to a seed. The generator function yields q' the next element and the new seed or p 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>vectorO(n)! Construct a vector with at most nb elements by repeatedly applying the generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements. -unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8>vectorO(n)t Construct a vector by repeatedly applying the monadic generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements.vectorO(n)t Construct a vector by repeatedly applying the monadic generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements.vectorO(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>vectorO(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>vectorO(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>vectorO(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>vectorO(n) Enumerate values from x to y.WARNING:B This operation can be very inefficient. If at all possible, use  instead.vectorO(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. vectorO(n) Prepend an element vectorO(n) Append an element vectorO(m+n) Concatenate two vectors vectorO(n)$ Concatenate all vectors in the list vectorO(n). Concatenate all vectors in the non-empty listvectorO(n)Y Execute the monadic action the given number of times and store the results in a vector.vectorO(n)U Construct a vector of the given length by applying the monadic action to each indexvectorO(n)K Apply monadic function n times to value. Zeroth element is original value.vector;Execute the monadic action and freeze the resulting vector. create (do { v <-  2;  v 0 'a';  v 1 'b'; return v }) = <a,b> vector<Execute the monadic action and freeze the resulting vectors.vectorO(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.vectorO(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>vectorO(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>vectorO(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,  is probably more convenient. update_ xs is ys =  xs (8 is ys) vector Same as () but without bounds checking.vectorSame as  but without bounds checking.vectorSame as  but without bounds checking.vectorO(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>vectorO(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>vectorO(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 (8 is bs) vectorSame as  but without bounds checking.vectorSame as  but without bounds checking.vectorSame as  but without bounds checking. vectorO(n) Reverse a vector!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>"vectorSame as ! but without bounds checking.#vectorApply 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') ( 3 'a') = <'x','a','a'> $vectorO(n)- Pair each element in a vector with its index%vectorO(n) Map a function over a vector&vectorO(n)< Apply a function to every element of a vector and its index'vector9Map a function over a vector and concatenate the results.(vectorO(n)V Apply the monadic action to all elements of the vector, yielding a vector of results)vectorO(n)c Apply the monadic action to every element of a vector and its index, yielding a vector of results*vectorO(n)M Apply the monadic action to all elements of a vector and ignore the results+vectorO(n)[ Apply the monadic action to every element of a vector and its index, ignoring the results,vectorO(n)f Apply the monadic action to all elements of the vector, yielding a vector of results. Equivalent to flip (.-vectorO(n)] Apply the monadic action to all elements of a vector and ignore the results. Equivalent to flip *..vector O(min(m,n))) Zip two vectors with the given function./vector*Zip three vectors with the given function.3vector O(min(m,n))H Zip two vectors with a function that also takes the elements' indices.8vector O(min(m,n)) Zip two vectors=vector O(min(m,n))K Zip the two vectors with the monadic action and yield a vector of results>vector O(min(m,n))k Zip the two vectors with a monadic action that also takes the element index and yield a vector of results?vector O(min(m,n))D Zip the two vectors with the monadic action and ignore the results@vector O(min(m,n))d Zip the two vectors with a monadic action that also takes the element index and ignore the resultsAvector O(min(m,n)) Unzip a vector of pairs.FvectorO(n)0 Drop elements that do not satisfy the predicateGvectorO(n)^ Drop elements that do not satisfy the predicate which is applied to values and their indicesHvectorO(n)! Drop repeated adjacent elements.IvectorO(n)- Drop elements when predicate returns NothingJvectorO(n)J Drop elements when predicate, applied to index and value, returns NothingKvectorO(n)8 Drop elements that do not satisfy the monadic predicateLvectorO(n)P Yield the longest prefix of elements satisfying the predicate without copying.MvectorO(n)Q Drop the longest prefix of elements that satisfy the predicate without copying.NvectorO(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.OvectorO(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 N.PvectorO(n)o Split the vector into the longest prefix of elements that satisfy the predicate and the rest without copying.QvectorO(n)v Split the vector into the longest prefix of elements that do not satisfy the predicate and the rest without copying.RvectorO(n)( Check if the vector contains an elementSvectorO(n)= Check if the vector does not contain an element (inverse of R)TvectorO(n) Yield q- the first element matching the predicate or p if no such element exists.UvectorO(n) Yield q; the index of the first element matching the predicate or p if no such element exists.VvectorO(n)L Yield the indices of elements satisfying the predicate in ascending order.WvectorO(n) Yield q; the index of the first occurence of the given element or pO if the vector does not contain the element. This is a specialised version of U.XvectorO(n)p Yield the indices of all occurences of the given element in ascending order. This is a specialised version of V.YvectorO(n) Left foldZvectorO(n) Left fold on non-empty vectors[vectorO(n)" Left fold with strict accumulator\vectorO(n)7 Left fold on non-empty vectors with strict accumulator]vectorO(n) Right fold^vectorO(n) Right fold on non-empty vectors_vectorO(n)% Right fold with a strict accumulator`vectorO(n)8 Right fold on non-empty vectors with strict accumulatoravectorO(n); Left fold (function applied to each element and its index)bvectorO(n)T Left fold with strict accumulator (function applied to each element and its index)cvectorO(n)< Right fold (function applied to each element and its index)dvectorO(n)U Right fold with strict accumulator (function applied to each element and its index)evectorO(n)- Check if all elements satisfy the predicate.fvectorO(n). Check if any element satisfies the predicate.gvectorO(n) Check if all elements are thvectorO(n) Check if any element is tivectorO(n) Compute the sum of the elementsjvectorO(n)$ Compute the produce of the elementskvectorO(n)G Yield the maximum element of the vector. The vector may not be empty.lvectorO(n)r Yield the maximum element of the vector according to the given comparison function. The vector may not be empty.mvectorO(n)G Yield the minimum element of the vector. The vector may not be empty.nvectorO(n)r Yield the minimum element of the vector according to the given comparison function. The vector may not be empty.ovectorO(n)T Yield the index of the maximum element of the vector. The vector may not be empty.pvectorO(n) Yield the index of the maximum element of the vector according to the given comparison function. The vector may not be empty.qvectorO(n)T Yield the index of the minimum element of the vector. The vector may not be empty.rvectorO(n) Yield the index of the minimum element of the vector according to the given comparison function. The vector may not be empty.svectorO(n) Monadic foldtvectorO(n)< Monadic fold (action applied to each element and its index)uvectorO(n)$ Monadic fold over non-empty vectorsvvectorO(n)% Monadic fold with strict accumulatorwvectorO(n)U Monadic fold with strict accumulator (action applied to each element and its index)xvectorO(n)< Monadic fold over non-empty vectors with strict accumulatoryvectorO(n)& Monadic fold that discards the resultzvectorO(n)V Monadic fold that discards the result (action applied to each element and its index){vectorO(n)= Monadic fold over non-empty vectors that discards the result|vectorO(n)> Monadic fold with strict accumulator that discards the result}vectorO(n)n Monadic fold with strict accumulator that discards the result (action applied to each element and its index)~vectorO(n)T Monad fold over non-empty vectors with strict accumulator that discards the resultvector,Evaluate each action and collect the resultsvector,Evaluate each action and discard the resultsvectorO(n) Prescan prescanl f z =  .  f z  Example: $prescanl (+) 0 <1,2,3,4> = <0,1,3,6>vectorO(n) Prescan with strict accumulatorvectorO(n) Scan postscanl f z =  .  f z  Example: &postscanl (+) 0 <1,2,3,4> = <1,3,6,10>vectorO(n) Scan with strict accumulatorvectorO(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>vectorO(n)+ Haskell-style scan with strict accumulatorvectorO(n)" Scan over a vector with its indexvectorO(n)- Scan over a vector (strictly) with its indexvectorO(n) Scan over a non-empty vector Jscanl f <x1,...,xn> = <y1,...,yn> where y1 = x1 yi = f y(i-1) xivectorO(n)7 Scan over a non-empty vector with a strict accumulatorvectorO(n) Right-to-left prescan prescanr f z =   .  (flip f) z .   vectorO(n). Right-to-left prescan with strict accumulatorvectorO(n) Right-to-left scanvectorO(n)+ Right-to-left scan with strict accumulatorvectorO(n)! Right-to-left Haskell-style scanvectorO(n)9 Right-to-left Haskell-style scan with strict accumulatorvectorO(n)0 Right-to-left scan over a vector with its indexvectorO(n); Right-to-left scan over a vector (strictly) with its indexvectorO(n)+ Right-to-left scan over a non-empty vectorvectorO(n)F Right-to-left scan over a non-empty vector with a strict accumulatorvectorO(n) Convert a vector to a listvectorO(n) Convert a list to a vectorvectorO(n) Convert the first n elements of a list to a vector fromListN n xs =  ( n xs) vectorO(n) Convert different vector typesvectorO(1) Unsafe convert a mutable vector to an immutable one without copying. The mutable vector may not be used after this operation.vectorO(n)/ Yield an immutable copy of the mutable vector.vectorO(1) Unsafely convert an immutable vector to a mutable one without copying. The immutable vector may not be used after this operation.vectorO(n). Yield a mutable copy of the immutable vector.vectorO(n)Y Copy an immutable vector into a mutable one. The two vectors must have the same length.vectorO(n)n Copy an immutable vector into a mutable one. The two vectors must have the same length. This is not checked.vectorO(1) Convert a vector to a 4vectorO(n) Construct a vector from a 4vectorO(1) Convert a vector to a 4, proceeding from right to leftvectorO(n) Construct a vector from a 4, proceeding from right to leftvector.Construct a vector from a monadic initialiser.vectorSConvert a vector to an initialiser which, when run, produces a copy of the vector.vectorO(n)% Check if two vectors are equal. All -" instances are also instances of uh and it is usually more appropriate to use those. This function is primarily intended for implementing u! instances for new vector types.vectorO(n)vectorO(n), Compare two vectors lexicographically. All -" instances are also instances of vh and it is usually more appropriate to use those. This function is primarily intended for implementing v! instances for new vector types.vectorO(n)vectorGeneric definition of vectorGeneric definition of vectorNote: uses wvectorGeneric definion of  that views a - as a list. vectori starting indexvectorn lengthvectori starting indexvectorn lengthvectorinitial vector (of length m)vector%list of index/value pairs (of length n)vectorinitial vector (of length m)vector'vector of index/value pairs (of length n)vectorinitial vector (of length m)vectorindex vector (of length n1)vectorvalue vector (of length n2)vectoraccumulating function fvectorinitial vector (of length m)vector%list of index/value pairs (of length n)vectoraccumulating function fvectorinitial vector (of length m)vector'vector of index/value pairs (of length n)vectoraccumulating function fvectorinitial vector (of length m)vectorindex vector (of length n1)vectorvalue vector (of length n2)!vectorxs value vectorvectoris index vector (of length n)-013./245      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~-013./245      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnqropstvwuxyz|}{~9 9  5R4S4  (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone 1;=>?FT-vector7Mutable boxed vectors keyed on the monad they live in (x or ST s).vectorLength of the mutable vector.vector!Check whether the vector is emptyvector6Yield a part of the mutable vector without copying it.vectorWYield a part of the mutable vector without copying it. No bounds checks are performed.vector"Check whether two vectors overlap.vector,Create a mutable vector of the given length.vectorKCreate a mutable vector of the given length. The memory is not initialized.vectormCreate a mutable vector of the given length (0 if the length is negative) and fill it with an initial value.vectorCreate 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.vector"Create a copy of a mutable vector.vectorLGrow a vector by the given number of elements. The number must be positive.vectordGrow a vector by the given number of elements. The number must be positive but this is not checked.vectorReset all elements of the vector to some undefined value, clearing all references to external objects. This is usually a noop for unboxed vectors.vector(Yield the element at the given position.vector*Replace the element at the given position.vector)Modify the element at the given position.vector)Swap the elements at the given positions.vectorHYield the element at the given position. No bounds checks are performed.vectorJReplace the element at the given position. No bounds checks are performed.vectorIModify the element at the given position. No bounds checks are performed.vectorISwap the elements at the given positions. No bounds checks are performed.vector2Set all elements of the vector to the given value.vectorNCopy a vector. The two vectors must have the same length and may not overlap.vectorcCopy a vector. The two vectors must have the same length and may not overlap. This is not checked.vectorJMove 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.vectorcMove 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.vector~Compute the next (lexicographically) permutation of given vector in-place. Returns False when input is the last permtuationvectorstarting indexvectorlength of the slicevectortargetvectorsourcevectortargetvectorsource((  (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone 1;=>?FQTVPvector,Boxed vectors, supporting efficient slicing.vectorO(1) Yield the length of the vectorvectorO(1) Test whether a vector is emptyvector O(1) IndexingvectorO(1) Safe indexingvectorO(1) First elementvectorO(1) Last elementvectorO(1)( Unsafe indexing without bounds checkingvectorO(1)6 First element without checking if the vector is emptyvectorO(1)5 Last element without checking if the vector is emptyvectorO(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.vectorO(1)+ First element of a vector in a monad. See + for an explanation of why this is useful.vectorO(1)* Last element of a vector in a monad. See + for an explanation of why this is useful.vectorO(1)0 Indexing in a monad without bounds checks. See + for an explanation of why this is useful.vectorO(1)C First element in a monad without checking for empty vectors. See * for an explanation of why this is useful.vectorO(1)B Last element in a monad without checking for empty vectors. See * for an explanation of why this is useful.vectorO(1)S Yield a slice of the vector without copying it. The vector must contain at least i+n elements.vectorO(1)N Yield all but the last element without copying. The vector may not be empty.vectorO(1)O Yield all but the first element without copying. The vector may not be empty.vectorO(1) Yield at the first n= elements without copying. The vector may contain less than n1 elements in which case it is returned unchanged.vectorO(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.vectorO(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.vectorO(1)P Yield a slice of the vector without copying. The vector must contain at least i+n" elements but this is not checked.vectorO(1)f Yield all but the last element without copying. The vector may not be empty but this is not checked.vectorO(1)g Yield all but the first element without copying. The vector may not be empty but this is not checked.vectorO(1) Yield the first n= elements without copying. The vector must contain at least n" elements but this is not checked.vectorO(1) Yield all but the first n= elements without copying. The vector must contain at least n" elements but this is not checked.vectorO(1) Empty vectorvectorO(1) Vector with exactly one elementvectorO(n)@ Vector of the given length with the same value in each positionvectorO(n)O Construct a vector of the given length by applying the function to each indexvectorO(n)C Apply function n times to value. Zeroth element is original value.vectorO(n)l Construct a vector by repeatedly applying the generator function to a seed. The generator function yields q' the next element and the new seed or p 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>vectorO(n)! Construct a vector with at most nb elements by repeatedly applying the generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements. -unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8>vectorO(n)t Construct a vector by repeatedly applying the monadic generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements.vectorO(n)t Construct a vector by repeatedly applying the monadic generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements.vectorO(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>vectorO(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>vectorO(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>vectorO(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>vectorO(n) Enumerate values from x to y.WARNING:B This operation can be very inefficient. If at all possible, use  instead.vectorO(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.vectorO(n) Prepend an elementvectorO(n) Append an elementvectorO(m+n) Concatenate two vectorsvectorO(n)$ Concatenate all vectors in the listvectorO(n)Y Execute the monadic action the given number of times and store the results in a vector.vectorO(n)U Construct a vector of the given length by applying the monadic action to each index vectorO(n)K Apply monadic function n times to value. Zeroth element is original value. vector;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>  vector<Execute the monadic action and freeze the resulting vectors. vectorO(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. vectorO(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>vectorO(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>vectorO(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 (1 is ys) vector Same as ( ) but without bounds checking.vectorSame as  but without bounds checking.vectorSame as  but without bounds checking.vectorO(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>vectorO(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>vectorO(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 (1 is bs) vectorSame as  but without bounds checking.vectorSame as  but without bounds checking.vectorSame as  but without bounds checking.vectorO(n) Reverse a vectorvectorO(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>vectorSame as  but without bounds checking.vectorApply 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'> vectorO(n)- Pair each element in a vector with its indexvectorO(n) Map a function over a vectorvectorO(n)< Apply a function to every element of a vector and its index vector9Map a function over a vector and concatenate the results.!vectorO(n)V Apply the monadic action to all elements of the vector, yielding a vector of results"vectorO(n)c Apply the monadic action to every element of a vector and its index, yielding a vector of results#vectorO(n)M Apply the monadic action to all elements of a vector and ignore the results$vectorO(n)[ Apply the monadic action to every element of a vector and its index, ignoring the results%vectorO(n)f Apply the monadic action to all elements of the vector, yielding a vector of results. Equivalent to flip !.&vectorO(n)] Apply the monadic action to all elements of a vector and ignore the results. Equivalent to flip #.'vector O(min(m,n))) Zip two vectors with the given function.(vector*Zip three vectors with the given function.,vector O(min(m,n))H Zip two vectors with a function that also takes the elements' indices.-vector<Zip three vectors and their indices with the given function.1vector&Elementwise pairing of array elements.2vector3zip together three vectors into a vector of triples6vector O(min(m,n)) Unzip a vector of pairs.;vector O(min(m,n))K Zip the two vectors with the monadic action and yield a vector of results<vector O(min(m,n))k Zip the two vectors with a monadic action that also takes the element index and yield a vector of results=vector O(min(m,n))D Zip the two vectors with the monadic action and ignore the results>vector O(min(m,n))d Zip the two vectors with a monadic action that also takes the element index and ignore the results?vectorO(n)0 Drop elements that do not satisfy the predicate@vectorO(n)^ Drop elements that do not satisfy the predicate which is applied to values and their indicesAvectorO(n)! Drop repeated adjacent elements.BvectorO(n)- Drop elements when predicate returns NothingCvectorO(n)J Drop elements when predicate, applied to index and value, returns NothingDvectorO(n)8 Drop elements that do not satisfy the monadic predicateEvectorO(n)P Yield the longest prefix of elements satisfying the predicate without copying.FvectorO(n)Q Drop the longest prefix of elements that satisfy the predicate without copying.GvectorO(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 H.HvectorO(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 G.IvectorO(n)o Split the vector into the longest prefix of elements that satisfy the predicate and the rest without copying.JvectorO(n)v Split the vector into the longest prefix of elements that do not satisfy the predicate and the rest without copying.KvectorO(n)( Check if the vector contains an elementLvectorO(n)= Check if the vector does not contain an element (inverse of K)MvectorO(n) Yield q- the first element matching the predicate or p if no such element exists.NvectorO(n) Yield q; the index of the first element matching the predicate or p if no such element exists.OvectorO(n)L Yield the indices of elements satisfying the predicate in ascending order.PvectorO(n) Yield q; the index of the first occurence of the given element or pO if the vector does not contain the element. This is a specialised version of N.QvectorO(n)p Yield the indices of all occurences of the given element in ascending order. This is a specialised version of O.RvectorO(n) Left foldSvectorO(n) Left fold on non-empty vectorsTvectorO(n)" Left fold with strict accumulatorUvectorO(n)7 Left fold on non-empty vectors with strict accumulatorVvectorO(n) Right foldWvectorO(n) Right fold on non-empty vectorsXvectorO(n)% Right fold with a strict accumulatorYvectorO(n)8 Right fold on non-empty vectors with strict accumulatorZvectorO(n); Left fold (function applied to each element and its index)[vectorO(n)T Left fold with strict accumulator (function applied to each element and its index)\vectorO(n)< Right fold (function applied to each element and its index)]vectorO(n)U Right fold with strict accumulator (function applied to each element and its index)^vectorO(n)- Check if all elements satisfy the predicate._vectorO(n). Check if any element satisfies the predicate.`vectorO(n) Check if all elements are tavectorO(n) Check if any element is tbvectorO(n) Compute the sum of the elementscvectorO(n)$ Compute the produce of the elementsdvectorO(n)G Yield the maximum element of the vector. The vector may not be empty.evectorO(n)r Yield the maximum element of the vector according to the given comparison function. The vector may not be empty.fvectorO(n)G Yield the minimum element of the vector. The vector may not be empty.gvectorO(n)r Yield the minimum element of the vector according to the given comparison function. The vector may not be empty.hvectorO(n)T Yield the index of the maximum element of the vector. The vector may not be empty.ivectorO(n) Yield the index of the maximum element of the vector according to the given comparison function. The vector may not be empty.jvectorO(n)T Yield the index of the minimum element of the vector. The vector may not be empty.kvectorO(n) Yield the index of the minimum element of the vector according to the given comparison function. The vector may not be empty.lvectorO(n) Monadic foldmvectorO(n)< Monadic fold (action applied to each element and its index)nvectorO(n)$ Monadic fold over non-empty vectorsovectorO(n)% Monadic fold with strict accumulatorpvectorO(n)U Monadic fold with strict accumulator (action applied to each element and its index)qvectorO(n)< Monadic fold over non-empty vectors with strict accumulatorrvectorO(n)& Monadic fold that discards the resultsvectorO(n)V Monadic fold that discards the result (action applied to each element and its index)tvectorO(n)= Monadic fold over non-empty vectors that discards the resultuvectorO(n)> Monadic fold with strict accumulator that discards the resultvvectorO(n)n Monadic fold with strict accumulator that discards the result (action applied to each element and its index)wvectorO(n)V Monadic fold over non-empty vectors with strict accumulator that discards the resultxvector,Evaluate each action and collect the resultsyvector,Evaluate each action and discard the resultszvectorO(n) Prescan prescanl f z =  . ~ f z  Example: $prescanl (+) 0 <1,2,3,4> = <0,1,3,6>{vectorO(n) Prescan with strict accumulator|vectorO(n) Scan postscanl f z =  . ~ f z  Example: &postscanl (+) 0 <1,2,3,4> = <1,3,6,10>}vectorO(n) Scan with strict accumulator~vectorO(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>vectorO(n)+ Haskell-style scan with strict accumulatorvectorO(n)" Scan over a vector with its indexvectorO(n)- Scan over a vector (strictly) with its indexvectorO(n) Scan over a non-empty vector Jscanl f <x1,...,xn> = <y1,...,yn> where y1 = x1 yi = f y(i-1) xivectorO(n)7 Scan over a non-empty vector with a strict accumulatorvectorO(n) Right-to-left prescan prescanr f z =  . z (flip f) z .  vectorO(n). Right-to-left prescan with strict accumulatorvectorO(n) Right-to-left scanvectorO(n)+ Right-to-left scan with strict accumulatorvectorO(n)! Right-to-left Haskell-style scanvectorO(n)9 Right-to-left Haskell-style scan with strict accumulatorvectorO(n)0 Right-to-left scan over a vector with its indexvectorO(n); Right-to-left scan over a vector (strictly) with its indexvectorO(n)+ Right-to-left scan over a non-empty vectorvectorO(n)F Right-to-left scan over a non-empty vector with a strict accumulatorvectorO(n) Convert a vector to a listvectorO(n) Convert a list to a vectorvectorO(n) Convert the first n elements of a list to a vector fromListN n xs =  ( n xs) vectorO(1) Unsafe convert a mutable vector to an immutable one without copying. The mutable vector may not be used after this operation.vectorO(1) Unsafely convert an immutable vector to a mutable one without copying. The immutable vector may not be used after this operation.vectorO(n). Yield a mutable copy of the immutable vector.vectorO(n)/ Yield an immutable copy of the mutable vector.vectorO(n)n Copy an immutable vector into a mutable one. The two vectors must have the same length. This is not checked.vectorO(n)Y Copy an immutable vector into a mutable one. The two vectors must have the same length.vectori starting indexvectorn lengthvectori starting indexvectorn length vectorinitial vector (of length m)vector%list of index/value pairs (of length n)vectorinitial vector (of length m)vector'vector of index/value pairs (of length n)vectorinitial vector (of length m)vectorindex vector (of length n1)vectorvalue vector (of length n2)vectoraccumulating function fvectorinitial vector (of length m)vector%list of index/value pairs (of length n)vectoraccumulating function fvectorinitial vector (of length m)vector'vector of index/value pairs (of length n)vectoraccumulating function fvectorinitial vector (of length m)vectorindex vector (of length n1)vectorvalue vector (of length n2)      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./012345;<=>6789:?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgjkhilmopnqrsuvtwxyz{|}~5K4L4 (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone1;=>?Vvector#Mutable vectors of primitive types.vector-offset, length, underlying mutable byte arrayvectorLength of the mutable vector.vector!Check whether the vector is emptyvector6Yield a part of the mutable vector without copying it.vectorWYield a part of the mutable vector without copying it. No bounds checks are performed.vector"Check whether two vectors overlap.vector,Create a mutable vector of the given length.vectorKCreate a mutable vector of the given length. The memory is not initialized.vectormCreate a mutable vector of the given length (0 if the length is negative) and fill it with an initial value.vectorCreate 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.vector"Create a copy of a mutable vector.vectorLGrow a vector by the given number of elements. The number must be positive.vectordGrow a vector by the given number of elements. The number must be positive but this is not checked.vectorReset all elements of the vector to some undefined value, clearing all references to external objects. This is usually a noop for unboxed vectors.vector(Yield the element at the given position.vector*Replace the element at the given position.vector)Modify the element at the given position.vector)Swap the elements at the given positions.vectorHYield the element at the given position. No bounds checks are performed.vectorJReplace the element at the given position. No bounds checks are performed.vectorIModify the element at the given position. No bounds checks are performed.vectorISwap the elements at the given positions. No bounds checks are performed.vector2Set all elements of the vector to the given value.vectorNCopy a vector. The two vectors must have the same length and may not overlap.vectorcCopy a vector. The two vectors must have the same length and may not overlap. This is not checked.vectorJMove 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.vectorcMove 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.vector~Compute the next (lexicographically) permutation of given vector in-place. Returns False when input is the last permtuationvectorstarting indexvectorlength of the slicevectortargetvectorsourcevectortargetvectorsourcevectortargetvectorsource)) (c) Roman Leshchinskiy 2008-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone 1;=>?FQTVvector"Unboxed vectors of primitive typesvector%offset, length, underlying byte arrayvectorO(1) Yield the length of the vectorvectorO(1) Test whether a vector is emptyvector O(1) IndexingvectorO(1) Safe indexingvectorO(1) First elementvectorO(1) Last elementvectorO(1)( Unsafe indexing without bounds checkingvectorO(1)6 First element without checking if the vector is emptyvectorO(1)5 Last element without checking if the vector is emptyvectorO(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.vectorO(1)+ First element of a vector in a monad. See + for an explanation of why this is useful.vectorO(1)* Last element of a vector in a monad. See + for an explanation of why this is useful.vectorO(1)0 Indexing in a monad without bounds checks. See + for an explanation of why this is useful.vectorO(1)C First element in a monad without checking for empty vectors. See * for an explanation of why this is useful.vectorO(1)B Last element in a monad without checking for empty vectors. See * for an explanation of why this is useful.vectorO(1)S Yield a slice of the vector without copying it. The vector must contain at least i+n elements.vectorO(1)N Yield all but the last element without copying. The vector may not be empty.vectorO(1)O Yield all but the first element without copying. The vector may not be empty.vectorO(1) Yield at the first n= elements without copying. The vector may contain less than n1 elements in which case it is returned unchanged.vectorO(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.vectorO(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.vectorO(1)P Yield a slice of the vector without copying. The vector must contain at least i+n" elements but this is not checked.vectorO(1)f Yield all but the last element without copying. The vector may not be empty but this is not checked.vectorO(1)g Yield all but the first element without copying. The vector may not be empty but this is not checked.vectorO(1) Yield the first n= elements without copying. The vector must contain at least n" elements but this is not checked.vectorO(1) Yield all but the first n= elements without copying. The vector must contain at least n" elements but this is not checked.vectorO(1) Empty vectorvectorO(1) Vector with exactly one elementvectorO(n)@ Vector of the given length with the same value in each positionvectorO(n)O Construct a vector of the given length by applying the function to each indexvectorO(n)C Apply function n times to value. Zeroth element is original value.vectorO(n)l Construct a vector by repeatedly applying the generator function to a seed. The generator function yields q' the next element and the new seed or p 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>vectorO(n)! Construct a vector with at most nb elements by repeatedly applying the generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements. -unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8>vectorO(n)t Construct a vector by repeatedly applying the monadic generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements.vectorO(n)t Construct a vector by repeatedly applying the monadic generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements.vectorO(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>vectorO(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>vectorO(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>vectorO(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>vectorO(n) Enumerate values from x to y.WARNING:B This operation can be very inefficient. If at all possible, use  instead.vectorO(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.vectorO(n) Prepend an elementvectorO(n) Append an elementvectorO(m+n) Concatenate two vectorsvectorO(n)$ Concatenate all vectors in the listvectorO(n)Y Execute the monadic action the given number of times and store the results in a vector.vectorO(n)U Construct a vector of the given length by applying the monadic action to each index vectorO(n)K Apply monadic function n times to value. Zeroth element is original value. vector;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>  vector<Execute the monadic action and freeze the resulting vectors. vectorO(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. vectorO(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>vectorO(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>vector Same as ( ) but without bounds checking.vectorSame as  but without bounds checking.vectorO(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>vectorO(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>vectorSame as  but without bounds checking.vectorSame as  but without bounds checking.vectorO(n) Reverse a vectorvectorO(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>vectorSame as  but without bounds checking.vectorApply 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'> vectorO(n) Map a function over a vectorvectorO(n)< Apply a function to every element of a vector and its indexvector9Map a function over a vector and concatenate the results.vectorO(n)V Apply the monadic action to all elements of the vector, yielding a vector of resultsvectorO(n)M Apply the monadic action to all elements of a vector and ignore the resultsvectorO(n)f Apply the monadic action to all elements of the vector, yielding a vector of results. Equivalent to flip .vectorO(n)] Apply the monadic action to all elements of a vector and ignore the results. Equivalent to flip . vector O(min(m,n))) Zip two vectors with the given function.!vector*Zip three vectors with the given function.%vector O(min(m,n))H Zip two vectors with a function that also takes the elements' indices.&vector<Zip three vectors and their indices with the given function.*vector O(min(m,n))K Zip the two vectors with the monadic action and yield a vector of results+vector O(min(m,n))D Zip the two vectors with the monadic action and ignore the results,vectorO(n)0 Drop elements that do not satisfy the predicate-vectorO(n)^ Drop elements that do not satisfy the predicate which is applied to values and their indices.vectorO(n)! Drop repeated adjacent elements./vectorO(n)- Drop elements when predicate returns Nothing0vectorO(n)J Drop elements when predicate, applied to index and value, returns Nothing1vectorO(n)8 Drop elements that do not satisfy the monadic predicate2vectorO(n)P Yield the longest prefix of elements satisfying the predicate without copying.3vectorO(n)Q Drop the longest prefix of elements that satisfy the predicate without copying.4vectorO(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 5.5vectorO(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 4.6vectorO(n)o Split the vector into the longest prefix of elements that satisfy the predicate and the rest without copying.7vectorO(n)v Split the vector into the longest prefix of elements that do not satisfy the predicate and the rest without copying.8vectorO(n)( Check if the vector contains an element9vectorO(n)= Check if the vector does not contain an element (inverse of 8):vectorO(n) Yield q- the first element matching the predicate or p if no such element exists.;vectorO(n) Yield q; the index of the first element matching the predicate or p if no such element exists.<vectorO(n)L Yield the indices of elements satisfying the predicate in ascending order.=vectorO(n) Yield q; the index of the first occurence of the given element or pO if the vector does not contain the element. This is a specialised version of ;.>vectorO(n)p Yield the indices of all occurences of the given element in ascending order. This is a specialised version of <.?vectorO(n) Left fold@vectorO(n) Left fold on non-empty vectorsAvectorO(n)" Left fold with strict accumulatorBvectorO(n)7 Left fold on non-empty vectors with strict accumulatorCvectorO(n) Right foldDvectorO(n) Right fold on non-empty vectorsEvectorO(n)% Right fold with a strict accumulatorFvectorO(n)8 Right fold on non-empty vectors with strict accumulatorGvectorO(n); Left fold (function applied to each element and its index)HvectorO(n)T Left fold with strict accumulator (function applied to each element and its index)IvectorO(n)< Right fold (function applied to each element and its index)JvectorO(n)U Right fold with strict accumulator (function applied to each element and its index)KvectorO(n)- Check if all elements satisfy the predicate.LvectorO(n). Check if any element satisfies the predicate.MvectorO(n) Compute the sum of the elementsNvectorO(n)$ Compute the produce of the elementsOvectorO(n)G Yield the maximum element of the vector. The vector may not be empty.PvectorO(n)r Yield the maximum element of the vector according to the given comparison function. The vector may not be empty.QvectorO(n)G Yield the minimum element of the vector. The vector may not be empty.RvectorO(n)r Yield the minimum element of the vector according to the given comparison function. The vector may not be empty.SvectorO(n)T Yield the index of the maximum element of the vector. The vector may not be empty.TvectorO(n) Yield the index of the maximum element of the vector according to the given comparison function. The vector may not be empty.UvectorO(n)T Yield the index of the minimum element of the vector. The vector may not be empty.VvectorO(n) Yield the index of the minimum element of the vector according to the given comparison function. The vector may not be empty.WvectorO(n) Monadic foldXvectorO(n)$ Monadic fold over non-empty vectorsYvectorO(n)% Monadic fold with strict accumulatorZvectorO(n)< Monadic fold over non-empty vectors with strict accumulator[vectorO(n)& Monadic fold that discards the result\vectorO(n)= Monadic fold over non-empty vectors that discards the result]vectorO(n)> Monadic fold with strict accumulator that discards the result^vectorO(n)V Monadic fold over non-empty vectors with strict accumulator that discards the result_vectorO(n) Prescan prescanl f z =  . c f z  Example: $prescanl (+) 0 <1,2,3,4> = <0,1,3,6>`vectorO(n) Prescan with strict accumulatoravectorO(n) Scan postscanl f z =  . c f z  Example: &postscanl (+) 0 <1,2,3,4> = <1,3,6,10>bvectorO(n) Scan with strict accumulatorcvectorO(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>dvectorO(n)+ Haskell-style scan with strict accumulatorevectorO(n) Scan over a non-empty vector Jscanl f <x1,...,xn> = <y1,...,yn> where y1 = x1 yi = f y(i-1) xifvectorO(n)7 Scan over a non-empty vector with a strict accumulatorgvectorO(n) Right-to-left prescan prescanr f z =  . _ (flip f) z .  hvectorO(n). Right-to-left prescan with strict accumulatorivectorO(n) Right-to-left scanjvectorO(n)+ Right-to-left scan with strict accumulatorkvectorO(n)! Right-to-left Haskell-style scanlvectorO(n)9 Right-to-left Haskell-style scan with strict accumulatormvectorO(n)+ Right-to-left scan over a non-empty vectornvectorO(n)F Right-to-left scan over a non-empty vector with a strict accumulatorovectorO(n) Convert a vector to a listpvectorO(n) Convert a list to a vectorqvectorO(n) Convert the first n elements of a list to a vector fromListN n xs = p ( n xs) rvectorO(1) Unsafe convert a mutable vector to an immutable one without copying. The mutable vector may not be used after this operation.svectorO(1) Unsafely convert an immutable vector to a mutable one without copying. The immutable vector may not be used after this operation.tvectorO(n). Yield a mutable copy of the immutable vector.uvectorO(n)/ Yield an immutable copy of the mutable vector.vvectorO(n)n Copy an immutable vector into a mutable one. The two vectors must have the same length. This is not checked.wvectorO(n)Y Copy an immutable vector into a mutable one. The two vectors must have the same length.vectori starting indexvectorn lengthvectori starting indexvectorn length vectorinitial vector (of length m)vector%list of index/value pairs (of length n)vectorinitial vector (of length m)vectorindex vector (of length n1)vectorvalue vector (of length n2)vectoraccumulating function fvectorinitial vector (of length m)vector%list of index/value pairs (of length n)vectoraccumulating function fvectorinitial vector (of length m)vectorindex vector (of length n1)vectorvalue vector (of length n2)      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvw      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRUVSTWYXZ[]\^_`abcdefghijklmnopqutwrsv58494 (c) Roman Leshchinskiy 2009-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone (c) Roman Leshchinskiy 2009-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone 1;=>?DV!vectorMutable -based vectorsvectorLength of the mutable vector.vector!Check whether the vector is emptyvector6Yield a part of the mutable vector without copying it.vectorWYield a part of the mutable vector without copying it. No bounds checks are performed.vector"Check whether two vectors overlap.vector,Create a mutable vector of the given length.vectorKCreate a mutable vector of the given length. The memory is not initialized.vectormCreate a mutable vector of the given length (0 if the length is negative) and fill it with an initial value.vectorCreate 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.vector"Create a copy of a mutable vector.vectorLGrow a vector by the given number of elements. The number must be positive.vectordGrow a vector by the given number of elements. The number must be positive but this is not checked.vectorReset all elements of the vector to some undefined value, clearing all references to external objects. This is usually a noop for unboxed vectors.vector(Yield the element at the given position.vector*Replace the element at the given position.vector)Modify the element at the given position.vector)Swap the elements at the given positions.vectorHYield the element at the given position. No bounds checks are performed.vectorJReplace the element at the given position. No bounds checks are performed.vectorIModify the element at the given position. No bounds checks are performed.vectorISwap the elements at the given positions. No bounds checks are performed.vector2Set all elements of the vector to the given value.vectorNCopy a vector. The two vectors must have the same length and may not overlap.vectorcCopy a vector. The two vectors must have the same length and may not overlap. This is not checked.vectorJMove 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.vectorcMove 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.vectorO(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.vectorCreate a mutable vector from a y with an offset and a length.Modifying data through the yT afterwards is unsafe if the vector could have been frozen before the modification.0If your offset is 0 it is more efficient to use .vectorO(1) Create a mutable vector from a y 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 yT afterwards is unsafe if the vector could have been frozen before the modification.vectorYield the underlying yV together with the offset to the data and its length. Modifying the data through the yD is unsafe if the vector could have frozen before the modification.vectorO(1) Yield the underlying y together with its length.CYou can assume the pointer points directly to the data (no offset).Modifying the data through the yD is unsafe if the vector could have frozen before the modification.vectorPass 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.vectorstarting indexvectorlength of the slicevectortargetvectorsourcevectortargetvectorsourcevectortargetvectorsourcevectorpointervectoroffsetvectorlengthvectorpointervectorlength.. (c) Roman Leshchinskiy 2009-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone 1;=>?FQTVSvector-based vectorsvectorO(1) Yield the length of the vectorvectorO(1) Test whether a vector is emptyvector O(1) IndexingvectorO(1) Safe indexingvectorO(1) First elementvectorO(1) Last elementvectorO(1)( Unsafe indexing without bounds checkingvectorO(1)6 First element without checking if the vector is emptyvectorO(1)5 Last element without checking if the vector is emptyvectorO(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.vectorO(1)+ First element of a vector in a monad. See + for an explanation of why this is useful.vectorO(1)* Last element of a vector in a monad. See + for an explanation of why this is useful.vectorO(1)0 Indexing in a monad without bounds checks. See + for an explanation of why this is useful.vectorO(1)C First element in a monad without checking for empty vectors. See * for an explanation of why this is useful.vectorO(1)B Last element in a monad without checking for empty vectors. See * for an explanation of why this is useful.vectorO(1)S Yield a slice of the vector without copying it. The vector must contain at least i+n elements.vectorO(1)N Yield all but the last element without copying. The vector may not be empty.vectorO(1)O Yield all but the first element without copying. The vector may not be empty.vectorO(1) Yield at the first n= elements without copying. The vector may contain less than n1 elements in which case it is returned unchanged.vectorO(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.vectorO(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.vectorO(1)P Yield a slice of the vector without copying. The vector must contain at least i+n" elements but this is not checked.vectorO(1)f Yield all but the last element without copying. The vector may not be empty but this is not checked.vectorO(1)g Yield all but the first element without copying. The vector may not be empty but this is not checked.vectorO(1) Yield the first n= elements without copying. The vector must contain at least n" elements but this is not checked.vectorO(1) Yield all but the first n= elements without copying. The vector must contain at least n" elements but this is not checked.vectorO(1) Empty vectorvectorO(1) Vector with exactly one elementvectorO(n)@ Vector of the given length with the same value in each positionvectorO(n)O Construct a vector of the given length by applying the function to each indexvectorO(n)C Apply function n times to value. Zeroth element is original value.vectorO(n)l Construct a vector by repeatedly applying the generator function to a seed. The generator function yields q' the next element and the new seed or p 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>vectorO(n)! Construct a vector with at most nb elements by repeatedly applying the generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements. -unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8>vectorO(n)t Construct a vector by repeatedly applying the monadic generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements.vectorO(n)t Construct a vector by repeatedly applying the monadic generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements.vectorO(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>vectorO(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>vectorO(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>vectorO(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>vectorO(n) Enumerate values from x to y.WARNING:B This operation can be very inefficient. If at all possible, use  instead.vectorO(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.vectorO(n) Prepend an elementvectorO(n) Append an elementvectorO(m+n) Concatenate two vectorsvectorO(n)$ Concatenate all vectors in the listvectorO(n)Y Execute the monadic action the given number of times and store the results in a vector.vectorO(n)U Construct a vector of the given length by applying the monadic action to each indexvectorO(n)K Apply monadic function n times to value. Zeroth element is original value.vector;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> vector<Execute the monadic action and freeze the resulting vectors.vectorO(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.vectorO(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>vectorO(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>vector Same as () but without bounds checking.vectorSame as  but without bounds checking.vectorO(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>vectorO(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>vectorSame as  but without bounds checking.vectorSame as  but without bounds checking.vectorO(n) Reverse a vectorvectorO(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>vectorSame as  but without bounds checking.vectorApply 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'> vectorO(n) Map a function over a vectorvectorO(n)< Apply a function to every element of a vector and its indexvector9Map a function over a vector and concatenate the results.vectorO(n)V Apply the monadic action to all elements of the vector, yielding a vector of resultsvectorO(n)M Apply the monadic action to all elements of a vector and ignore the resultsvectorO(n)f Apply the monadic action to all elements of the vector, yielding a vector of results. Equivalent to flip .vectorO(n)] Apply the monadic action to all elements of a vector and ignore the results. Equivalent to flip .vector O(min(m,n))) Zip two vectors with the given function.vector*Zip three vectors with the given function.vector O(min(m,n))H Zip two vectors with a function that also takes the elements' indices.vector<Zip three vectors and their indices with the given function.vector O(min(m,n))K Zip the two vectors with the monadic action and yield a vector of resultsvector O(min(m,n))D Zip the two vectors with the monadic action and ignore the resultsvectorO(n)0 Drop elements that do not satisfy the predicatevectorO(n)^ Drop elements that do not satisfy the predicate which is applied to values and their indices vectorO(n)! Drop repeated adjacent elements. vectorO(n)- Drop elements when predicate returns Nothing vectorO(n)J Drop elements when predicate, applied to index and value, returns Nothing vectorO(n)8 Drop elements that do not satisfy the monadic predicate vectorO(n)P Yield the longest prefix of elements satisfying the predicate without copying.vectorO(n)Q Drop the longest prefix of elements that satisfy the predicate without copying.vectorO(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 .vectorO(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 .vectorO(n)o Split the vector into the longest prefix of elements that satisfy the predicate and the rest without copying.vectorO(n)v Split the vector into the longest prefix of elements that do not satisfy the predicate and the rest without copying.vectorO(n)( Check if the vector contains an elementvectorO(n)= Check if the vector does not contain an element (inverse of )vectorO(n) Yield q- the first element matching the predicate or p if no such element exists.vectorO(n) Yield q; the index of the first element matching the predicate or p if no such element exists.vectorO(n)L Yield the indices of elements satisfying the predicate in ascending order.vectorO(n) Yield q; the index of the first occurence of the given element or pO if the vector does not contain the element. This is a specialised version of .vectorO(n)p Yield the indices of all occurences of the given element in ascending order. This is a specialised version of .vectorO(n) Left foldvectorO(n) Left fold on non-empty vectorsvectorO(n)" Left fold with strict accumulatorvectorO(n)7 Left fold on non-empty vectors with strict accumulatorvectorO(n) Right foldvectorO(n) Right fold on non-empty vectors vectorO(n)% Right fold with a strict accumulator!vectorO(n)8 Right fold on non-empty vectors with strict accumulator"vectorO(n); Left fold (function applied to each element and its index)#vectorO(n)T Left fold with strict accumulator (function applied to each element and its index)$vectorO(n)< Right fold (function applied to each element and its index)%vectorO(n)U Right fold with strict accumulator (function applied to each element and its index)&vectorO(n)- Check if all elements satisfy the predicate.'vectorO(n). Check if any element satisfies the predicate.(vectorO(n) Check if all elements are t)vectorO(n) Check if any element is t*vectorO(n) Compute the sum of the elements+vectorO(n)$ Compute the produce of the elements,vectorO(n)G Yield the maximum element of the vector. The vector may not be empty.-vectorO(n)r Yield the maximum element of the vector according to the given comparison function. The vector may not be empty..vectorO(n)G Yield the minimum element of the vector. The vector may not be empty./vectorO(n)r Yield the minimum element of the vector according to the given comparison function. The vector may not be empty.0vectorO(n)T Yield the index of the maximum element of the vector. The vector may not be empty.1vectorO(n) Yield the index of the maximum element of the vector according to the given comparison function. The vector may not be empty.2vectorO(n)T Yield the index of the minimum element of the vector. The vector may not be empty.3vectorO(n) Yield the index of the minimum element of the vector according to the given comparison function. The vector may not be empty.4vectorO(n) Monadic fold5vectorO(n)$ Monadic fold over non-empty vectors6vectorO(n)% Monadic fold with strict accumulator7vectorO(n)< Monadic fold over non-empty vectors with strict accumulator8vectorO(n)& Monadic fold that discards the result9vectorO(n)= Monadic fold over non-empty vectors that discards the result:vectorO(n)> Monadic fold with strict accumulator that discards the result;vectorO(n)V Monadic fold over non-empty vectors with strict accumulator that discards the result<vectorO(n) Prescan prescanl f z =  . @ f z  Example: $prescanl (+) 0 <1,2,3,4> = <0,1,3,6>=vectorO(n) Prescan with strict accumulator>vectorO(n) Scan postscanl f z =  . @ f z  Example: &postscanl (+) 0 <1,2,3,4> = <1,3,6,10>?vectorO(n) Scan with strict accumulator@vectorO(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>AvectorO(n)+ Haskell-style scan with strict accumulatorBvectorO(n) Scan over a non-empty vector Jscanl f <x1,...,xn> = <y1,...,yn> where y1 = x1 yi = f y(i-1) xiCvectorO(n)7 Scan over a non-empty vector with a strict accumulatorDvectorO(n) Right-to-left prescan prescanr f z =  . < (flip f) z .  EvectorO(n). Right-to-left prescan with strict accumulatorFvectorO(n) Right-to-left scanGvectorO(n)+ Right-to-left scan with strict accumulatorHvectorO(n)! Right-to-left Haskell-style scanIvectorO(n)9 Right-to-left Haskell-style scan with strict accumulatorJvectorO(n)+ Right-to-left scan over a non-empty vectorKvectorO(n)F Right-to-left scan over a non-empty vector with a strict accumulatorLvectorO(n) Convert a vector to a listMvectorO(n) Convert a list to a vectorNvectorO(n) Convert the first n elements of a list to a vector fromListN n xs = M ( n xs) OvectorO(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.PvectorO(1) Unsafe convert a mutable vector to an immutable one without copying. The mutable vector may not be used after this operation.QvectorO(1) Unsafely convert an immutable vector to a mutable one without copying. The immutable vector may not be used after this operation.RvectorO(n). Yield a mutable copy of the immutable vector.SvectorO(n)/ Yield an immutable copy of the mutable vector.TvectorO(n)n Copy an immutable vector into a mutable one. The two vectors must have the same length. This is not checked.UvectorO(n)Y Copy an immutable vector into a mutable one. The two vectors must have the same length.VvectorO(1) Create a vector from a y with an offset and a length.)The data may not be modified through the y afterwards.0If your offset is 0 it is more efficient to use W.WvectorO(1) Create a vector from a y and a length.HIt is assumed the pointer points directly to the data (no offset). Use V" if you need to specify an offset.)The data may not be modified through the y afterwards.XvectorO(1) Yield the underlying y` together with the offset to the data and its length. The data may not be modified through the y.YvectorO(1) Yield the underlying y together with its length.CYou can assume the pointer points directly to the data (no offset).)The data may not be modified through the y.ZvectorePass a pointer to the vector's data to the IO action. The data may not be modified through the 'Ptr.vectori starting indexvectorn lengthvectori starting indexvectorn lengthvectorinitial vector (of length m)vector%list of index/value pairs (of length n)vectorinitial vector (of length m)vectorindex vector (of length n1)vectorvalue vector (of length n2)vectoraccumulating function fvectorinitial vector (of length m)vector%list of index/value pairs (of length n)vectoraccumulating function fvectorinitial vector (of length m)vectorindex vector (of length n1)vectorvalue vector (of length n2)VvectorpointervectoroffsetvectorlengthWvectorpointervectorlength      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ      !"#$%&'()*+,-./230146578:9;<=>?@ABCDEFGHIJKLMNOSRUPQTVWXYZ544 (c) Roman Leshchinskiy 2009-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone 01<>?FT/efghz{|}~i~}|{zyxwvutsrqponmlkj (c) Roman Leshchinskiy 2009-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNoneFQTVXvectorO(1) Yield the length of the vectorvectorO(1) Test whether a vector is emptyvector O(1) IndexingvectorO(1) Safe indexingvectorO(1) First elementvectorO(1) Last elementvectorO(1)( Unsafe indexing without bounds checkingvectorO(1)6 First element without checking if the vector is emptyvectorO(1)5 Last element without checking if the vector is emptyvectorO(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.vectorO(1)+ First element of a vector in a monad. See + for an explanation of why this is useful.vectorO(1)* Last element of a vector in a monad. See + for an explanation of why this is useful.vectorO(1)0 Indexing in a monad without bounds checks. See + for an explanation of why this is useful.vectorO(1)C First element in a monad without checking for empty vectors. See * for an explanation of why this is useful.vectorO(1)B Last element in a monad without checking for empty vectors. See * for an explanation of why this is useful.vectorO(1)S Yield a slice of the vector without copying it. The vector must contain at least i+n elements.vectorO(1)N Yield all but the last element without copying. The vector may not be empty.vectorO(1)O Yield all but the first element without copying. The vector may not be empty.vectorO(1) Yield at the first n= elements without copying. The vector may contain less than n1 elements in which case it is returned unchanged.vectorO(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.vectorO(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.vectorO(1)P Yield a slice of the vector without copying. The vector must contain at least i+n" elements but this is not checked.vectorO(1)f Yield all but the last element without copying. The vector may not be empty but this is not checked.vectorO(1)g Yield all but the first element without copying. The vector may not be empty but this is not checked.vectorO(1) Yield the first n= elements without copying. The vector must contain at least n" elements but this is not checked.vectorO(1) Yield all but the first n= elements without copying. The vector must contain at least n" elements but this is not checked.vectorO(1) Empty vectorvectorO(1) Vector with exactly one elementvectorO(n)@ Vector of the given length with the same value in each positionvectorO(n)O Construct a vector of the given length by applying the function to each indexvectorO(n)C Apply function n times to value. Zeroth element is original value.vectorO(n)l Construct a vector by repeatedly applying the generator function to a seed. The generator function yields q' the next element and the new seed or p 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>vectorO(n)! Construct a vector with at most nb elements by repeatedly applying the generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements. -unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8>vectorO(n)t Construct a vector by repeatedly applying the monadic generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements.vectorO(n)t Construct a vector by repeatedly applying the monadic generator function to a seed. The generator function yields q' the next element and the new seed or p if there are no more elements.vectorO(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>vectorO(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>vectorO(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>vectorO(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>vectorO(n) Enumerate values from x to y.WARNING:B This operation can be very inefficient. If at all possible, use  instead.vectorO(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.vectorO(n) Prepend an elementvectorO(n) Append an elementvectorO(m+n) Concatenate two vectorsvectorO(n)$ Concatenate all vectors in the listvectorO(n)Y Execute the monadic action the given number of times and store the results in a vector.vectorO(n)U Construct a vector of the given length by applying the monadic action to each indexvectorO(n)K Apply monadic function n times to value. Zeroth element is original value.vector;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> vector<Execute the monadic action and freeze the resulting vectors.vectorO(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.vectorO(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>vectorO(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>vectorO(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) vector Same as () but without bounds checking.vectorSame as  but without bounds checking.vectorSame as  but without bounds checking.vectorO(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>vectorO(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>vectorO(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) vectorSame as  but without bounds checking.vectorSame as  but without bounds checking.vectorSame as  but without bounds checking.vectorO(n) Reverse a vectorvectorO(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>vectorSame as  but without bounds checking.vectorApply 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'> vectorO(n)- Pair each element in a vector with its indexvectorO(n) Map a function over a vectorvectorO(n)< Apply a function to every element of a vector and its indexvector9Map a function over a vector and concatenate the results.vectorO(n)V Apply the monadic action to all elements of the vector, yielding a vector of resultsvectorO(n)c Apply the monadic action to every element of a vector and its index, yielding a vector of resultsvectorO(n)M Apply the monadic action to all elements of a vector and ignore the resultsvectorO(n)[ Apply the monadic action to every element of a vector and its index, ignoring the resultsvectorO(n)f Apply the monadic action to all elements of the vector, yielding a vector of results. Equivalent to flip .vectorO(n)] Apply the monadic action to all elements of a vector and ignore the results. Equivalent to flip .vector O(min(m,n))) Zip two vectors with the given function.vector*Zip three vectors with the given function.vector O(min(m,n))H Zip two vectors with a function that also takes the elements' indices.vector<Zip three vectors and their indices with the given function.vector O(min(m,n))K Zip the two vectors with the monadic action and yield a vector of resultsvector O(min(m,n))k Zip the two vectors with a monadic action that also takes the element index and yield a vector of resultsvector O(min(m,n))D Zip the two vectors with the monadic action and ignore the resultsvector O(min(m,n))d Zip the two vectors with a monadic action that also takes the element index and ignore the resultsvectorO(n)0 Drop elements that do not satisfy the predicatevectorO(n)! Drop repeated adjacent elements.vectorO(n)^ Drop elements that do not satisfy the predicate which is applied to values and their indicesvectorO(n)- Drop elements when predicate returns NothingvectorO(n)J Drop elements when predicate, applied to index and value, returns NothingvectorO(n)8 Drop elements that do not satisfy the monadic predicatevectorO(n)P Yield the longest prefix of elements satisfying the predicate without copying.vectorO(n)Q Drop the longest prefix of elements that satisfy the predicate without copying.vectorO(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 .vectorO(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 .vectorO(n)o Split the vector into the longest prefix of elements that satisfy the predicate and the rest without copying.vectorO(n)v Split the vector into the longest prefix of elements that do not satisfy the predicate and the rest without copying.vectorO(n)( Check if the vector contains an elementvectorO(n)= Check if the vector does not contain an element (inverse of )vectorO(n) Yield q- the first element matching the predicate or p if no such element exists.vectorO(n) Yield q; the index of the first element matching the predicate or p if no such element exists.vectorO(n)L Yield the indices of elements satisfying the predicate in ascending order.vectorO(n) Yield q; the index of the first occurence of the given element or pO if the vector does not contain the element. This is a specialised version of .vectorO(n)p Yield the indices of all occurences of the given element in ascending order. This is a specialised version of .vectorO(n) Left foldvectorO(n) Left fold on non-empty vectorsvectorO(n)" Left fold with strict accumulatorvectorO(n)7 Left fold on non-empty vectors with strict accumulatorvectorO(n) Right foldvectorO(n) Right fold on non-empty vectorsvectorO(n)% Right fold with a strict accumulatorvectorO(n)8 Right fold on non-empty vectors with strict accumulatorvectorO(n); Left fold (function applied to each element and its index)vectorO(n)T Left fold with strict accumulator (function applied to each element and its index)vectorO(n)< Right fold (function applied to each element and its index)vectorO(n)U Right fold with strict accumulator (function applied to each element and its index)vectorO(n)- Check if all elements satisfy the predicate.vectorO(n). Check if any element satisfies the predicate.vectorO(n) Check if all elements are tvectorO(n) Check if any element is tvectorO(n) Compute the sum of the elementsvectorO(n)$ Compute the produce of the elementsvectorO(n)G Yield the maximum element of the vector. The vector may not be empty.vectorO(n)r Yield the maximum element of the vector according to the given comparison function. The vector may not be empty.vectorO(n)G Yield the minimum element of the vector. The vector may not be empty.vectorO(n)r Yield the minimum element of the vector according to the given comparison function. The vector may not be empty.vectorO(n)T Yield the index of the maximum element of the vector. The vector may not be empty.vectorO(n) Yield the index of the maximum element of the vector according to the given comparison function. The vector may not be empty.vectorO(n)T Yield the index of the minimum element of the vector. The vector may not be empty.vectorO(n) Yield the index of the minimum element of the vector according to the given comparison function. The vector may not be empty.vectorO(n) Monadic foldvectorO(n)< Monadic fold (action applied to each element and its index) vectorO(n)$ Monadic fold over non-empty vectors vectorO(n)% Monadic fold with strict accumulator vectorO(n)U Monadic fold with strict accumulator (action applied to each element and its index) vectorO(n)< Monadic fold over non-empty vectors with strict accumulator vectorO(n)& Monadic fold that discards the resultvectorO(n)V Monadic fold that discards the result (action applied to each element and its index)vectorO(n)= Monadic fold over non-empty vectors that discards the resultvectorO(n)> Monadic fold with strict accumulator that discards the resultvectorO(n)n Monadic fold with strict accumulator that discards the result (action applied to each element and its index)vectorO(n)V Monadic fold over non-empty vectors with strict accumulator that discards the resultvectorO(n) Prescan prescanl f z =  .  f z  Example: $prescanl (+) 0 <1,2,3,4> = <0,1,3,6>vectorO(n) Prescan with strict accumulatorvectorO(n) Scan postscanl f z =  .  f z  Example: &postscanl (+) 0 <1,2,3,4> = <1,3,6,10>vectorO(n) Scan with strict accumulatorvectorO(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>vectorO(n)+ Haskell-style scan with strict accumulatorvectorO(n) Scan over a non-empty vector Jscanl f <x1,...,xn> = <y1,...,yn> where y1 = x1 yi = f y(i-1) xivectorO(n)7 Scan over a non-empty vector with a strict accumulatorvectorO(n) Right-to-left prescan prescanr f z =  .  (flip f) z .  vectorO(n). Right-to-left prescan with strict accumulatorvectorO(n) Right-to-left scanvectorO(n)+ Right-to-left scan with strict accumulatorvectorO(n)! Right-to-left Haskell-style scan vectorO(n)9 Right-to-left Haskell-style scan with strict accumulator!vectorO(n)+ Right-to-left scan over a non-empty vector"vectorO(n)F Right-to-left scan over a non-empty vector with a strict accumulator#vectorO(n) Convert a vector to a list$vectorO(n) Convert a list to a vector%vectorO(n) Convert the first n elements of a list to a vector fromListN n xs = $ ( n xs) &vectorO(1) Unsafe convert a mutable vector to an immutable one without copying. The mutable vector may not be used after this operation.'vectorO(1) Unsafely convert an immutable vector to a mutable one without copying. The immutable vector may not be used after this operation.(vectorO(n). Yield a mutable copy of the immutable vector.)vectorO(n)/ Yield an immutable copy of the mutable vector.*vectorO(n)n Copy an immutable vector into a mutable one. The two vectors must have the same length. This is not checked.+vectorO(n)Y Copy an immutable vector into a mutable one. The two vectors must have the same length.,vectorO(1) Zip 2 vectors-vectorO(1) Unzip 2 vectors.vectorO(1) Zip 3 vectors/vectorO(1) Unzip 3 vectors0vectorO(1) Zip 4 vectors1vectorO(1) Unzip 4 vectors2vectorO(1) Zip 5 vectors3vectorO(1) Unzip 5 vectors4vectorO(1) Zip 6 vectors5vectorO(1) Unzip 6 vectorsvectori starting indexvectorn lengthvectori starting indexvectorn lengthvectorinitial vector (of length m)vector%list of index/value pairs (of length n)vectorinitial vector (of length m)vector'vector of index/value pairs (of length n)vectorinitial vector (of length m)vectorindex vector (of length n1)vectorvalue vector (of length n2)vectoraccumulating function fvectorinitial vector (of length m)vector%list of index/value pairs (of length n)vectoraccumulating function fvectorinitial vector (of length m)vector'vector of index/value pairs (of length n)vectoraccumulating function fvectorinitial vector (of length m)vectorindex vector (of length n1)vectorvalue vector (of length n2)ehi~}|{zyxwvutsrqponmlkj      !"#$%&'()*+,-./012345hi~}|{zyxwvutsrqponmlkje,.024-/135      !"#$%)(+&'*544 (c) Roman Leshchinskiy 2009-2010 BSD-style'Roman Leshchinskiy <rl@cse.unsw.edu.au> experimental non-portableNone<%=vectorLength of the mutable vector.>vector!Check whether the vector is empty?vector6Yield a part of the mutable vector without copying it.EvectorWYield a part of the mutable vector without copying it. No bounds checks are performed.Jvector"Check whether two vectors overlap.Kvector,Create a mutable vector of the given length.LvectorKCreate a mutable vector of the given length. The memory is not initialized.MvectormCreate a mutable vector of the given length (0 if the length is negative) and fill it with an initial value.NvectorCreate 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.Ovector"Create a copy of a mutable vector.PvectorLGrow a vector by the given number of elements. The number must be positive.QvectordGrow a vector by the given number of elements. The number must be positive but this is not checked.RvectorReset all elements of the vector to some undefined value, clearing all references to external objects. This is usually a noop for unboxed vectors.Svector(Yield the element at the given position.Tvector*Replace the element at the given position.Uvector)Modify the element at the given position.Vvector)Swap the elements at the given positions.WvectorHYield the element at the given position. No bounds checks are performed.XvectorJReplace the element at the given position. No bounds checks are performed.YvectorIModify the element at the given position. No bounds checks are performed.ZvectorISwap the elements at the given positions. No bounds checks are performed.[vector2Set all elements of the vector to the given value.\vectorNCopy a vector. The two vectors must have the same length and may not overlap.]vectorcCopy a vector. The two vectors must have the same length and may not overlap. This is not checked.^vectorJMove 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._vectorcMove 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.`vector~Compute the next (lexicographically) permutation of given vector in-place. Returns False when input is the last permtuationavectorO(1) Zip 2 vectorsbvectorO(1) Unzip 2 vectorscvectorO(1) Zip 3 vectorsdvectorO(1) Unzip 3 vectorsevectorO(1) Zip 4 vectorsfvectorO(1) Unzip 4 vectorsgvectorO(1) Zip 5 vectorshvectorO(1) Unzip 5 vectorsivectorO(1) Zip 6 vectorsjvectorO(1) Unzip 6 vectorsEvectorstarting indexvectorlength of the slice\vectortargetvectorsource]vectortargetvectorsource_vectortargetvectorsourceGefgi~}|{zyxwvutsrqponmlkj=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijGi~}|{zyxwvutsrqponmlkjgfe=>?CD@ABEHIFGJKLMNOPQRacegibdfhjSTUVWXYZ`[\^]_ !"##$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL=>MGNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~abcdefghijklmnopqrstuvwxyz{|}~   a b c d e g i j k l m n o p q r s t u y z { v w | } a b p s t q r e f                                    p q r s t ab!olm"#$%&'()*pqrstcdeg+,-ijk./fh0123456789:;zu<v=w>?@ABCDE|F}GHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~   < < a b p s t q r e f                  J a b ! o l m " # $ % & ' ( ) * p q r s t c d e g + , - i j k . f h  0 1 2  3 4  5  6 7  8 9  : ;  z u < v = w > ? @ A B C D E H I J K L | F } G 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 { | ~                           <<abpstqref    JJab!olm"#$%&'()*pqrstcdeg+,-ijk.fh01234579:;u<vw?@ABCDE|}MNOPQRSTUVWXYZ[\]^_`abcdefiklnstuvwx{|~<<abpstqref    Jab!olm"#$%&'()*pqrstcdeg+,-ijk.fh01234579:;u<vw?@ABCDE|}MNOPQRSTUVWXYZ[\]^_`abcdefiklnstuvwx{|~J<ab!olm"#$%&'()*pqrstcdeg+,-ijk.fh0123456789:;zu<v=w>?@ABCDE|F}GMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnstuvwx{|~HIJKLabpstqref    HIJKL a e      &vector-0.12.0.1-GGZqQZyzchy8YFPCF67wxL!Data.Vector.Fusion.Stream.MonadicData.Vector.Storable.MutableData.Vector.Fusion.UtilData.Vector.Fusion.Bundle.Size Data.Vector.Generic.Mutable.BaseData.Vector.GenericData.Vector.Internal.Check!Data.Vector.Fusion.Bundle.MonadicData.Vector.Fusion.BundleData.Vector.Generic.MutableData.Vector.Generic.NewData.Vector.Mutable Data.VectorData.Vector.Primitive.MutableData.Vector.PrimitiveData.Vector.Storable.InternalData.Vector.StorableData.Vector.UnboxedData.Vector.Unboxed.MutableData.Vector.Generic.BasePrelude showsPrec Text.ReadreadPrec Data.DatagfoldlData.Vector.Unboxed.Baseghc-prim GHC.TypesSPECSPEC2baseForeign.StorableStorableBoxunBoxIdunId delay_inline delayed_min $fMonadId$fApplicativeId $fFunctorId $fMonadBox$fApplicativeBox $fFunctorBoxSizeExactMaxUnknownclampedSubtractsmallerlargertoMax lowerBound upperBound $fNumSize$fEqSize $fShowSizeMVector basicLengthbasicUnsafeSlice basicOverlapsbasicUnsafeNewbasicInitializebasicUnsafeReplicatebasicUnsafeReadbasicUnsafeWrite basicClearbasicSetbasicUnsafeCopybasicUnsafeMovebasicUnsafeGrowVectorbasicUnsafeFreezebasicUnsafeThawbasicUnsafeIndexMelemseqMutableChecksBoundsUnsafeInternaldoCheckserror internalErrorcheck checkIndex checkLength checkSlice $fEqChecksStreamStepYieldSkipDonelengthnullempty singleton replicate replicateMgenerate generateMconssnoc++headlast!!!?sliceinittailtakedropmapmapMmapM_transunboxindexedindexedRzipWithM zipWithM_ zipWith3M zipWith4M zipWith5M zipWith6MzipWithzipWith3zipWith4zipWith5zipWith6zipzip3zip4zip5zip6eqBycmpByfiltermapMaybefilterMuniq 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 fromListN $fFunctorStep$fFunctorStreamBundlesElemssChunkssVectorsSizeChunk fromStreamchunkselementssizesizedunsafeFromList fromVector fromVectors concatVectorsreVector$fFunctorBundleMBundleinplacelifteqcmp $fOrd1Bundle $fEq1Bundle $fOrdBundle $fEqBundlemstreamfill transformmstreamRfillR transformRunstream munstream vunstream unstreamR munstreamRsplitAt unsafeSlice unsafeInit unsafeTail unsafeTake unsafeDropoverlapsnew unsafeNewclonegrow growFront unsafeGrowunsafeGrowFrontclearreadwritemodifyswapexchange unsafeRead unsafeWrite unsafeModify unsafeSwapunsafeExchangesetcopymove unsafeCopy unsafeMoveaccumupdate unsafeAccum unsafeUpdatereverseunstablePartitionunstablePartitionBundlepartitionBundlenextPermutationNewcreaterunrunPrimapplymodifyWithBundle! unsafeIndex unsafeHead unsafeLastindexMheadMlastM unsafeIndexM unsafeHeadM unsafeLastM constructN constructrN enumFromNconcatconcatNEcreateTforce//update_ unsafeUpd unsafeUpdate_ accumulate accumulate_unsafeAccumulateunsafeAccumulate_ backpermuteunsafeBackpermuteimapimapMimapM_forMforM_izipWith izipWith3 izipWith4 izipWith5 izipWith6 izipWithM izipWithM_unzipunzip3unzip4unzip5unzip6ifilter imapMaybe partitionspanbreak findIndices elemIndex elemIndicesfoldr'foldr1'ifoldlifoldl'ifoldrifoldr'allanysumproductmaximum maximumByminimum minimumBymaxIndex maxIndexByminIndex minIndexByifoldMifoldM'foldM_ifoldM_fold1M_foldM'_ifoldM'_fold1M'_sequence sequence_iscanliscanl'prescanr prescanr' postscanr postscanr'scanrscanr'iscanriscanr'scanr1scanr1'convert unsafeFreezefreeze unsafeThawthawstreamstreamR liftShowsPrec liftReadsPrecmkTypedataCastSTVectorIOVector$fMVectorMVectora$fTraversableVector$fFoldableVector$fAlternativeVector$fApplicativeVector$fMonadZipVector$fMonadPlusVector $fMonadVector$fFunctorVector$fMonoidVector$fSemigroupVector $fOrd1Vector $fEq1Vector $fOrdVector $fEqVector$fVectorVectora $fDataVector$fIsListVector $fRead1Vector $fShow1Vector $fReadVector $fShowVector$fNFDataVector(primitive-0.6.3.0-DaZpcxwJp2TGn8ITSgfI4CData.Primitive.TypesPrim$fNFDataMVectorgetPtrsetPtrupdPtr unsafeCastunsafeFromForeignPtrunsafeFromForeignPtr0unsafeToForeignPtrunsafeToForeignPtr0 unsafeWithUnboxMV_6MV_5MV_4MV_3MV_2 MV_ComplexMV_BoolMV_Char MV_DoubleMV_Float MV_Word64 MV_Word32 MV_Word16MV_Word8MV_WordMV_Int64MV_Int32MV_Int16MV_Int8MV_IntMV_Unit GHC.Classesmin Data.FoldableGHC.List&&||GHC.BaseNothingJust vmunstreamenlargeTrueEqOrdText.ParserCombinators.ReadPReadSIOGHC.ForeignPtr ForeignPtrV_UnitV_IntV_Int8V_Int16V_Int32V_Int64V_WordV_Word8V_Word16V_Word32V_Word64V_FloatV_DoubleV_CharV_Bool V_ComplexV_2V_3V_4V_5V_6