`      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                                                                   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | }~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>Noneportable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au> Safe-Inferred Box monad Identity monad GDelay inlining a function until late in the game (simplifier phase 0).  inlined in phase 0      portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au> Safe-Inferred  Size hint  Unknown size Upper bound on the size  Exact size Minimum of two size hints Maximum of two size hints &Convert a size hint to an upper bound *Compute the minimum size from a size hint 6Compute the maximum size from a size hint if possible     non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>None   non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>NoneV Monadic streams "+Result of taking a single step in a stream ) Length of a   * Check if a   is empty +Empty   , Singleton   -$Replicate a value to a given length .Yield a  9 of values obtained by performing the monadic action the  given number of times 0#Generate a stream from its indices 1Prepend an element 2Append an element 3Concatenate two  s 4First element of the   or error if empty 5Last element of the   or error if empty 6Element at the given position 7!Element at the given position or  if out of bounds 8HExtract a substream of the given length starting at the given position. 9All but the last element :All but the first element ; The first n elements <All but the first n elements =Map a function over a   >Map a monadic function over a   ?1Execute a monadic action for each element of the   @ Transform a   to use a different monad BPair each element in a   with its index CPair each element in a  ) with its index, starting from the right  and counting down DZip two  "s with the given monadic function T Check if two   s are equal ULexicographically compare two  s V1Drop elements which do not satisfy the predicate W9Drop elements which do not satisfy the monadic predicate X6Longest prefix of elements that satisfy the predicate Y>Longest prefix of elements that satisfy the monadic predicate Z?Drop the longest prefix of elements that satisfy the predicate [GDrop the longest prefix of elements that satisfy the monadic predicate \Check whether the   contains an element ] Inverse of \ ^Yield 3 the first element that satisfies the predicate or   if no such element exists. _Yield ; the first element that satisfies the monadic predicate or   if no such element exists. `Yield = the index of the first element that satisfies the predicate  or  if no such element exists. aYield ; the index of the first element that satisfies the monadic  predicate or  if no such element exists. b Left fold c"Left fold with a monadic operator dSame as c eLeft fold over a non-empty   fLeft fold over a non-empty   with a monadic operator gSame as f h$Left fold with a strict accumulator i;Left fold with a strict accumulator and a monadic operator jSame as i kLeft fold over a non-empty   with a strict accumulator lLeft fold over a non-empty  ! with a strict accumulator and a  monadic operator mSame as l n Right fold o#Right fold with a monadic operator p#Right fold over a non-empty stream q;Right fold over a non-empty stream with a monadic operator v Create a   of values from a   of streamable things wUnfold xUnfold with a monadic function zUnfold at most n# elements with a monadic functions {KApply monadic function n times to value. Zeroth element is original value. |CApply function n times to value. Zeroth element is original value. } Prefix scan ~$Prefix scan with a monadic operator $Prefix scan with strict accumulator ;Prefix scan with strict accumulator and a monadic operator  Suffix scan $Suffix scan with a monadic operator $Suffix scan with strict accumulator <Suffix scan with strict acccumulator and a monadic operator Haskell-style scan +Haskell-style scan with a monadic operator +Haskell-style scan with strict accumulator BHaskell-style scan with strict accumulator and a monadic operator Scan over a non-empty   Scan over a non-empty   with a monadic operator Scan over a non-empty   with a strict accumulator Scan over a non-empty  ) with a strict accumulator and a monadic  operator Yield a  + of the given length containing the values x, x+y,  x+y+y etc. Enumerate values WARNING:A This operation can be very inefficient. If at all possible, use   instead. $Enumerate values with a given step. WARNING:= This operation is very inefficient. If at all possible, use   instead.  Convert a   to a list Convert a list to a   Convert the first n elements of a list to a Bundle  !"#$%&'()*+,-./012345678starting index length 9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~s !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~s !"%$#&(')*+,12-./03456789:;<=>?@AtvBCEDFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcefdghikljmnopqrsuwxyz|{}~y !"%$#&(')*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>None DClass of mutable vectors parametrised with a primitive state token. 8Length of the mutable vector. This method should not be  called directly, use  instead. CYield a part of the mutable vector without copying it. This method $ should not be called directly, use  unsafeSlice instead. GCreate a mutable vector of the given length. This method should not be  called directly, use  unsafeNew instead. @Create a mutable vector of the given length and fill it with an ? initial value. This method should not be called directly, use   instead. CYield the element at the given position. This method should not be  called directly, use  unsafeRead instead. EReplace the element at the given position. This method should not be  called directly, use  unsafeWrite instead. GReset all elements of the vector to some undefined value, clearing all D references to external objects. This is usually a noop for unboxed 9 vectors. This method should not be called directly, use clear instead. FSet all elements of the vector to the given value. This method should  not be called directly, use set instead. GCopy a vector. The two vectors may not overlap. This method should not  be called directly, use  unsafeCopy instead. HMove the contents of a vector. The two vectors may overlap. This method $ should not be called directly, use  unsafeMove instead. IGrow a vector by the given number of elements. This method should not be  called directly, use  unsafeGrow instead. starting index length of the slice target source target source   non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>None JClass of immutable vectors. Every immutable vector is associated with its  mutable version through the $ type family. Methods of this class ' should not be used directly. Instead, Data.Vector.Generic and other 8 Data.Vector modules provide safe and fusible wrappers. !Minimum complete implementation:           Assumed complexity: O(1) ;Unsafely convert a mutable vector to its immutable version ; without copying. The mutable vector may not be used after  this operation. Assumed complexity: O(1) DUnsafely convert an immutable vector to its mutable version without E copying. The immutable vector may not be used after this operation. Assumed complexity: O(1)  Yield the length of the vector. Assumed complexity: O(1) DYield a slice of the vector without copying it. No range checks are  performed. Assumed complexity: O(1) HYield the element at the given position in a monad. No range checks are  performed. JThe monad allows us to be strict in the vector if we want. Suppose we had   unsafeIndex :: v a -> Int -> a /instead. Now, if we wanted to copy a vector, we'd do something like  < copy mv v ... = ... unsafeWrite mv i (unsafeIndex v i) ... JFor lazy vectors, the indexing would not be evaluated which means that we K would retain a reference to the original vector in each element we write.  This is not what we want! With  , we can do  3 copy mv v ... = ... case basicUnsafeIndexM v i of 7 Box x -> unsafeWrite mv i x ... Hwhich does not have this problem because indexing (but not the returned % element!) is evaluated immediately. Assumed complexity: O(n) GCopy an immutable vector into a mutable one. The two vectors must have * the same length but this is not checked.  Instances of 5 should redefine this method if they wish to support $ an efficient block copy operation. %Default definition: copying basic on  and  basicUnsafeWrite.  Evaluate a2 as far as storing it in a vector would and yield b.  The v a@ argument only fixes the type and is not touched. The method is H 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 0 although this might result in suboptimal code.  4 elemseq v x y = (singleton x `asTypeOf` v) `seq` y Default defintion: a is not evaluated at all  Mutable v s a0 is the mutable version of the pure vector type v a with  the state token s starting index length   non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>NoneYMonadic streams   hint of a   Attach a   hint to a   Length of a   Check if a  is empty Empty   Singleton  $Replicate a value to a given length Yield a 9 of values obtained by performing the monadic action the  given number of times #Generate a stream from its indices Prepend an element Append an element Concatenate two s First element of the  or error if empty Last element of the  or error if empty Element at the given position !Element at the given position or  if out of bounds HExtract a substream of the given length starting at the given position. All but the last element All but the first element  The first n elements All but the first n elements Map a function over a  Map a monadic function over a  1Execute a monadic action for each element of the   Transform a  to use a different monad Pair each element in a  with its index Pair each element in a ) with its index, starting from the right  and counting down Zip two "s with the given monadic function  Check if two  s are equal Lexicographically compare two s 1Drop elements which do not satisfy the predicate 9Drop elements which do not satisfy the monadic predicate 6Longest prefix of elements that satisfy the predicate >Longest prefix of elements that satisfy the monadic predicate ?Drop the longest prefix of elements that satisfy the predicate GDrop the longest prefix of elements that satisfy the monadic predicate Check whether the  contains an element  Inverse of  Yield 3 the first element that satisfies the predicate or   if no such element exists. Yield ; the first element that satisfies the monadic predicate or   if no such element exists. Yield = the index of the first element that satisfies the predicate  or  if no such element exists. Yield ; the index of the first element that satisfies the monadic  predicate or  if no such element exists.  Left fold "Left fold with a monadic operator Same as  Left fold over a non-empty  Left fold over a non-empty  with a monadic operator Same as  $Left fold with a strict accumulator ;Left fold with a strict accumulator and a monadic operator Same as  Left fold over a non-empty  with a strict accumulator Left fold over a non-empty ! with a strict accumulator and a  monadic operator Same as   Right fold #Right fold with a monadic operator #Right fold over a non-empty stream ;Right fold over a non-empty stream with a monadic operator  Create a  of values from a  of streamable things Unfold Unfold with a monadic function Unfold at most n elements Unfold at most n# elements with a monadic functions KApply monadic function n times to value. Zeroth element is original value.  CApply function n times to value. Zeroth element is original value.   Prefix scan  $Prefix scan with a monadic operator  $Prefix scan with strict accumulator  ;Prefix scan with strict accumulator and a monadic operator  Suffix scan $Suffix scan with a monadic operator $Suffix scan with strict accumulator <Suffix scan with strict acccumulator and a monadic operator Haskell-style scan +Haskell-style scan with a monadic operator +Haskell-style scan with strict accumulator BHaskell-style scan with strict accumulator and a monadic operator Scan over a non-empty  Scan over a non-empty  with a monadic operator Scan over a non-empty  with a strict accumulator Scan over a non-empty ) with a strict accumulator and a monadic  operator Yield a + of the given length containing the values x, x+y,  x+y+y etc. Enumerate values WARNING:A This operation can be very inefficient. If at all possible, use   instead. $Enumerate values with a given step. WARNING:= This operation is very inefficient. If at all possible, use   instead.  Convert a  to a list Convert a list to a  Convert the first n elements of a list to a   Convert a list to a  with the given   hint. starting index length       !"#$|      !"#$|      !$"#~      !"#$  non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>NoneD%%Alternative name for monadic streams &The type of pure streams (*Convert a pure stream to a monadic stream )  hint of a & * Attach a   hint to a & + Length of a & , Check if a & is empty -Empty & . Singleton & /$Replicate a value to a given length 0#Generate a stream from its indices 1Prepend an element 2Append an element 3Concatenate two &s 4First element of the & or error if empty 5Last element of the & or error if empty 6Element at the given position 7!Element at the given position or  if out of bounds 8HExtract a substream of the given length starting at the given position. 9All but the last element :All but the first element ; The first n elements <All but the first n elements =Map a function over a & @Pair each element in a & with its index APair each element in a &) with its index, starting from the right  and counting down BZip two &s with the given function C Zip three &s with the given function L1Drop elements which do not satisfy the predicate M6Longest prefix of elements that satisfy the predicate N?Drop the longest prefix of elements that satisfy the predicate OCheck whether the & contains an element P Inverse of O QYield - the first element matching the predicate or  if no  such element exists. RYield : the index of the first element matching the predicate or   if no such element exists. S Left fold TLeft fold on non-empty &s U"Left fold with strict accumulator VLeft fold on non-empty &s with strict accumulator W Right fold XRight fold on non-empty &s [Unfold \Unfold at most n elements ]EApply function n-1 times to value. Zeroth element is original value. ^ Prefix scan _$Prefix scan with strict accumulator ` Suffix scan a$Suffix scan with strict accumulator bHaskell-style scan c+Haskell-style scan with strict accumulator dScan over a non-empty & eScan over a non-empty & with a strict accumulator f Check if two & s are equal gLexicographically compare two &s hJApply a monadic action to each element of the stream, producing a monadic  stream of results i5Apply a monadic action to each element of the stream lFYield a monadic stream of elements that satisfy the monadic predicate m Monadic fold n#Monadic fold over non-empty stream o%Monadic fold with strict accumulator p9Monad fold over non-empty stream with strict accumulator qYield a &+ of the given length containing the values x, x+y,  x+y+y etc. rEnumerate values WARNING:B This operations can be very inefficient. If at all possible, use  q instead. s$Enumerate values with a given step. WARNING:> This operations is very inefficient. If at all possible, use  q instead. t Convert a & to a list u Create a & from a list v Create a & from the first n elements of a list ' fromListN n xs = fromList (take n xs) | Create a & of values from a & of streamable things [%&'()*+,-./012345678starting index length 9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|^"#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|^"%$#&%')*+,-.12/03456789:;<=?|>@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdeqrstuvw(xyz{hijklmnopfg[%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|  non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>None ?Create a new mutable vector and fill it with elements from the &. ? The vector will grow exponentially if the maximum size of the & is  unknown. GCreate a new mutable vector and fill it with elements from the monadic N stream. The vector will grow exponentially if the maximum size of the stream  is unknown. ?Create a new mutable vector and fill it with elements from the &. ? The vector will grow exponentially if the maximum size of the & is  unknown. GCreate a new mutable vector and fill it with elements from the monadic N stream. The vector will grow exponentially if the maximum size of the stream  is unknown. ?Create a new mutable vector and fill it with elements from the & L from right to left. The vector will grow exponentially if the maximum size  of the & is unknown. GCreate a new mutable vector and fill it with elements from the monadic N stream from right to left. The vector will grow exponentially if the maximum  size of the stream is unknown. Length of the mutable vector. "Check whether the vector is empty 7Yield a part of the mutable vector without copying it. HYield a part of the mutable vector without copying it. No bounds checks  are performed. -Create a mutable vector of the given length. HCreate a mutable vector of the given length. The length is not checked. JCreate a mutable vector of the given length (0 if the length is negative) $ and fill it with an initial value. JCreate a mutable vector of the given length (0 if the length is negative) N and fill it with values produced by repeatedly executing the monadic action. #Create a copy of a mutable vector. BGrow a vector by the given number of elements. The number must be  positive. Grow a vector logarithmically BGrow a vector by the given number of elements. The number must be # positive but this is not checked. GReset all elements of the vector to some undefined value, clearing all N references to external objects. This is usually a noop for unboxed vectors. )Yield the element at the given position. +Replace the element at the given position. *Swap the elements at the given positions. EReplace the element at the give position and return the old element. IYield the element at the given position. No bounds checks are performed. KReplace the element at the given position. No bounds checks are performed. JSwap the elements at the given positions. No bounds checks are performed. HReplace the element at the give position and return the old element. No  bounds checks are performed. 3Set all elements of the vector to the given value. ECopy a vector. The two vectors must have the same length and may not  overlap. BMove the contents of a vector. The two vectors must have the same  length. :If the vectors do not overlap, then this is equivalent to . B Otherwise, the copying is performed as if the source vector were G copied to a temporary vector and then the temporary vector was copied  to the target vector. ECopy a vector. The two vectors must have the same length and may not  overlap. This is not checked. BMove 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 . B Otherwise, the copying is performed as if the source vector were G copied to a temporary vector and then the temporary vector was copied  to the target vector. G}~starting index length of the slice target source target source A}~A}~G}~  non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>None  non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>NoneO(1)! Yield the length of the vector. O(1) Test whether a vector if empty O(1) Indexing O(1) Safe indexing O(1) First element O(1) Last element O(1)) Unsafe indexing without bounds checking O(1)7 First element without checking if the vector is empty O(1)6 Last element without checking if the vector is empty O(1) Indexing in a monad. GThe monad allows operations to be strict in the vector when necessary. 2 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 0, copying can be implemented like this instead:   copy mv v = ... do # x <- indexM v i  write mv i x Here, no references to v$ are retained because indexing (but not the ! elements) is evaluated eagerly. O(1)+ First element of a vector in a monad. See  for an $ explanation of why this is useful. O(1)* Last element of a vector in a monad. See  for an $ explanation of why this is useful. O(1)0 Indexing in a monad without bounds checks. See  for an $ explanation of why this is useful. O(1)> First element in a monad without checking for empty vectors.  See + for an explanation of why this is useful. O(1)= Last element in a monad without checking for empty vectors.  See + for an explanation of why this is useful. O(1)A Yield a slice of the vector without copying it. The vector must  contain at least i+n elements. O(1)D Yield all but the last element without copying. The vector may not  be empty. O(1)E Yield all but the first element without copying. The vector may not  be empty. O(1) Yield the first n* elements without copying. The vector may  contain less than n2 elements in which case it is returned unchanged. O(1) Yield all but the first n* elements without copying. The vector may  contain less than n5 elements in which case an empty vector is returned. O(1) Yield the first n5 elements paired with the remainder without copying.  Note that  n v is equivalent to ( n v,  n v)  but slightly more efficient. O(1)> Yield a slice of the vector without copying. The vector must  contain at least i+n# elements but this is not checked. O(1)D Yield all but the last element without copying. The vector may not # be empty but this is not checked. O(1)E Yield all but the first element without copying. The vector may not # be empty but this is not checked. O(1) Yield the first n+ elements without copying. The vector must  contain at least n# elements but this is not checked. O(1) Yield all but the first n& elements without copying. The vector  must contain at least n# elements but this is not checked. O(1) Empty vector O(1)! Vector with exactly one element O(n)A Vector of the given length with the same value in each position O(n)D Construct a vector of the given length by applying the function to  each index O(n)D Apply function n times to value. Zeroth element is original value. O(n)B Construct a vector by repeatedly applying the generator function * to a seed. The generator function yields  the next element and the  new seed or  if there are no more elements. = unfoldr (\n -> if n == 0 then Nothing else Just (n,n-1)) 10  = <10,9,8,7,6,5,4,3,2,1> O(n)! Construct a vector with at most n by repeatedly applying the A generator function to the a seed. The generator function yields  the " next element and the new seed or  if there are no more elements. / unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8> O(n) Construct a vector with n% elements by repeatedly applying the C generator function to the already constructed part of the vector. F constructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in f <a,b,c> O(n) Construct a vector with n elements from right to left by L repeatedly applying the generator function to the already constructed part  of the vector. F constructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in f <c,b,a> O(n): Yield a vector of the given length containing the values x, x+1 4 etc. This operation is usually more efficient than .  enumFromN 5 3 = <5,6,7> O(n): Yield a vector of the given length containing the values x, x+y,  x+y+y5 etc. This operations is usually more efficient than . - enumFromStepN 1 0.1 5 = <1,1.1,1.2,1.3,1.4> O(n) Enumerate values from x to y. WARNING:A This operation can be very inefficient. If at all possible, use   instead. O(n) Enumerate values from x to y with a specific step z. WARNING:A This operation can be very inefficient. If at all possible, use   instead. O(n) Prepend an element O(n) Append an element O(m+n) Concatenate two vectors O(n)% Concatenate all vectors in the list O(n)D Execute the monadic action the given number of times and store the  results in a vector. O(n)@ Construct a vector of the given length by applying the monadic  action to each index <Execute the monadic action and freeze the resulting vector.   create (do { v <-  2;  v 0 'a';  v 1 'b'; return v }) = <a,b> O(n)A Yield the argument but force it not to retain any extra memory,  possibly by copying it. AThis is especially useful when dealing with slices. For example:  ! force (slice 0 2 <huge vector>) KHere, the slice retains a reference to the huge vector. Forcing it creates J a copy of just the elements that belong to the slice and allows the huge ! vector to be garbage collected. O(m+n) For each pair (i,a)# from the list, replace the vector  element at position i by a. . <5,9,2,7> // [(2,1),(0,3),(2,8)] = <3,9,8,7> O(m+n) For each pair (i,a) from the vector of index/ value pairs, ( replace the vector element at position i by a. 2 update <5,9,2,7> <(2,1),(0,3),(2,8)> = <3,9,8,7> O(m+min(n1,n2)) For each index i from the index vector and the  corresponding value a3 from the value vector, replace the element of the  initial vector at position i by a.  0 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 ( is ys)  Same as () but without bounds checking. Same as  but without bounds checking. Same as  but without bounds checking. O(m+n) For each pair (i,b)+ from the list, replace the vector element  a at position i by f a b. A accum (+) <5,9,2> [(2,4),(1,6),(0,3),(1,7)] = <5+3, 9+6+7, 2+4> O(m+n) For each pair (i,b). from the vector of pairs, replace the vector  element a at position i by f a b. F accumulate (+) <5,9,2> <(2,4),(1,6),(0,3),(1,7)> = <5+3, 9+6+7, 2+4> O(m+min(n1,n2)) For each index i from the index vector and the  corresponding value b from the the value vector, . replace the element of the initial vector at  position i by f a b.  A accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4> )This function is useful for instances of  that cannot store pairs.  Otherwise,  is probably more convenient:   accumulate_ f as is bs =  f as ( is bs) Same as  but without bounds checking. Same as  but without bounds checking. Same as  but without bounds checking. O(n) Reverse a vector O(n)5 Yield the vector obtained by replacing each element i of the  index vector by xsi. This is equivalent to  (xs) is but is  often much more efficient. 5 backpermute <a,b,c,d> <0,3,2,3,1,0> = <a,d,c,d,b,a> Same as  but without bounds checking. AApply a destructive operation to a vector. The operation will be I 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'> O(n). Pair each element in a vector with its index O(n) Map a function over a vector O(n)= Apply a function to every element of a vector and its index :Map a function over a vector and concatenate the results. O(n)D Apply the monadic action to all elements of the vector, yielding a  vector of results  O(n)E Apply the monadic action to all elements of a vector and ignore the  results  O(n)D Apply the monadic action to all elements of the vector, yielding a ! vector of results. Equvalent to flip .  O(n)E Apply the monadic action to all elements of a vector and ignore the  results. Equivalent to flip  .   O(min(m,n))* Zip two vectors with the given function.  +Zip three vectors with the given function.  O(min(m,n))5 Zip two vectors with a function that also takes the  elements' indices.  O(min(m,n)) Zip two vectors  O(min(m,n))9 Zip the two vectors with the monadic action and yield a  vector of results  O(min(m,n))< Zip the two vectors with the monadic action and ignore the  results  O(min(m,n)) Unzip a vector of pairs. "O(n)1 Drop elements that do not satisfy the predicate #O(n)E Drop elements that do not satisfy the predicate which is applied to  values and their indices $O(n)9 Drop elements that do not satisfy the monadic predicate %O(n)? Yield the longest prefix of elements satisfying the predicate  without copying. &O(n)@ Drop the longest prefix of elements that satisfy the predicate  without copying. 'O(n)? Split the vector in two parts, the first one containing those F elements that satisfy the predicate and the second one those that don't. The H relative order of the elements is preserved at the cost of a sometimes ! reduced performance compared to (. (O(n)? Split the vector in two parts, the first one containing those F elements that satisfy the predicate and the second one those that don't. G The order of the elements is not preserved but the operation is often  faster than '. )O(n)C Split the vector into the longest prefix of elements that satisfy - the predicate and the rest without copying. *O(n)B Split the vector into the longest prefix of elements that do not 5 satisfy the predicate and the rest without copying. +O(n)) Check if the vector contains an element ,O(n)= Check if the vector does not contain an element (inverse of +) -O(n) Yield - the first element matching the predicate or   if no such element exists. .O(n) Yield 7 the index of the first element matching the predicate  or  if no such element exists. /O(n)E Yield the indices of elements satisfying the predicate in ascending  order. 0O(n) Yield : the index of the first occurence of the given element or  C if the vector does not contain the element. This is a specialised  version of .. 1O(n)= Yield the indices of all occurences of the given element in 3 ascending order. This is a specialised version of /. 2O(n) Left fold 3O(n) Left fold on non-empty vectors 4O(n)# Left fold with strict accumulator 5O(n)8 Left fold on non-empty vectors with strict accumulator 6O(n) Right fold 7O(n)! Right fold on non-empty vectors 8O(n)& Right fold with a strict accumulator 9O(n)9 Right fold on non-empty vectors with strict accumulator :O(n)< Left fold (function applied to each element and its index) ;O(n)E Left fold with strict accumulator (function applied to each element  and its index) <O(n)= Right fold (function applied to each element and its index) =O(n)> Right fold with strict accumulator (function applied to each  element and its index) >O(n). Check if all elements satisfy the predicate. ?O(n)/ Check if any element satisfies the predicate. @O(n) Check if all elements are  AO(n) Check if any element is  BO(n)! Compute the sum of the elements CO(n)% Compute the produce of the elements DO(n)@ Yield the maximum element of the vector. The vector may not be  empty. EO(n)@ Yield the maximum element of the vector according to the given 3 comparison function. The vector may not be empty. FO(n)@ Yield the minimum element of the vector. The vector may not be  empty. GO(n)@ Yield the minimum element of the vector according to the given 3 comparison function. The vector may not be empty. HO(n)B Yield the index of the maximum element of the vector. The vector  may not be empty. IO(n)C Yield the index of the maximum element of the vector according to = the given comparison function. The vector may not be empty. JO(n)B Yield the index of the minimum element of the vector. The vector  may not be empty. KO(n)C Yield the index of the minimum element of the vector according to = the given comparison function. The vector may not be empty. LO(n) Monadic fold MO(n)% Monadic fold over non-empty vectors NO(n)& Monadic fold with strict accumulator OO(n)= Monadic fold over non-empty vectors with strict accumulator PO(n)' Monadic fold that discards the result QO(n)> Monadic fold over non-empty vectors that discards the result RO(n)? Monadic fold with strict accumulator that discards the result SO(n); Monad fold over non-empty vectors with strict accumulator  that discards the result T-Evaluate each action and collect the results U-Evaluate each action and discard the results VO(n) Prescan    prescanl f z =  . Z f z  Example: prescanl (+) 0 <1,2,3,4> = <0,1,3,6> WO(n)! Prescan with strict accumulator XO(n) Scan    postscanl f z =  . Z f z  Example: postscanl (+) 0 <1,2,3,4> = <1,3,6,10> YO(n) Scan with strict accumulator ZO(n) Haskell-style scan  ) scanl f z <x1,...,xn> = <y1,...,y(n+1)>  where y1 = z  yi = f y(i-1) x(i-1)  Example:  scanl (+) 0 <1,2,3,4> = < 0,1,3,6,10> [O(n), Haskell-style scan with strict accumulator \O(n) Scan over a non-empty vector # scanl f <x1,...,xn> = <y1,...,yn>  where y1 = x1  yi = f y(i-1) xi ]O(n)8 Scan over a non-empty vector with a strict accumulator ^O(n) Right-to-left prescan   prescanr f z =  . V (flip f) z .  _O(n)/ Right-to-left prescan with strict accumulator `O(n) Right-to-left scan aO(n), Right-to-left scan with strict accumulator bO(n)" Right-to-left Haskell-style scan cO(n): Right-to-left Haskell-style scan with strict accumulator dO(n), Right-to-left scan over a non-empty vector eO(n): Right-to-left scan over a non-empty vector with a strict  accumulator fO(n) Convert a vector to a list gO(n) Convert a list to a vector hO(n) Convert the first n elements of a list to a vector   fromListN n xs = g ( n xs) iO(n) Convert different vector types jO(1)= Unsafe convert a mutable vector to an immutable one without C copying. The mutable vector may not be used after this operation. kO(n)0 Yield an immutable copy of the mutable vector. lO(1)? Unsafely convert an immutable vector to a mutable one without E copying. The immutable vector may not be used after this operation. mO(n)/ Yield a mutable copy of the immutable vector. nO(n)C Copy an immutable vector into a mutable one. The two vectors must  have the same length. oO(n)C Copy an immutable vector into a mutable one. The two vectors must , have the same length. This is not checked. pO(1) Convert a vector to a & qO(n) Construct a vector from a & rO(1) Convert a vector to a & , proceeding from right to left sO(n) Construct a vector from a & , proceeding from right to left t/Construct a vector from a monadic initialiser. uGConvert a vector to an initialiser which, when run, produces a copy of  the vector. vO(n)% Check if two vectors are equal. All  instances are also  instances of 7 and it is usually more appropriate to use those. This 1 function is primarily intended for implementing  instances for new  vector types. wO(n), Compare two vectors lexicographically. All  instances are  also instances of 7 and it is usually more appropriate to use those. This 1 function is primarily intended for implementing  instances for new  vector types. xGeneric definition of  yGeneric definition of  zGeneric definion of  that views a  as a  list. i starting index n length i starting index n length initial vector (of length m)  list of index/value pairs (of length n) initial vector (of length m) vector of index/value pairs (of length n) initial vector (of length m) index vector (of length n1) value vector (of length n2) accumulating function f initial vector (of length m)  list of index/value pairs (of length n) accumulating function f initial vector (of length m) vector of index/value pairs (of length n) accumulating function f initial vector (of length m) index vector (of length n1) value vector (of length n2) xs value vector is index vector (of length n)       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGJKHILNMOPRQSTUVWXYZ[\]^_`abcdefghikmnjlopqrstuvwxyz|{      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{| non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>None$Mutable vectors of primitive types. Length of the mutable vector. "Check whether the vector is empty 7Yield a part of the mutable vector without copying it. HYield a part of the mutable vector without copying it. No bounds checks  are performed. -Create a mutable vector of the given length. HCreate a mutable vector of the given length. The length is not checked. JCreate a mutable vector of the given length (0 if the length is negative) $ and fill it with an initial value. JCreate a mutable vector of the given length (0 if the length is negative) N and fill it with values produced by repeatedly executing the monadic action. #Create a copy of a mutable vector. BGrow a vector by the given number of elements. The number must be  positive. BGrow a vector by the given number of elements. The number must be # positive but this is not checked. GReset all elements of the vector to some undefined value, clearing all N references to external objects. This is usually a noop for unboxed vectors. )Yield the element at the given position. +Replace the element at the given position. *Swap the elements at the given positions. IYield the element at the given position. No bounds checks are performed. KReplace the element at the given position. No bounds checks are performed. JSwap the elements at the given positions. No bounds checks are performed. 3Set all elements of the vector to the given value. ECopy a vector. The two vectors must have the same length and may not  overlap. ECopy a vector. The two vectors must have the same length and may not  overlap. This is not checked. BMove the contents of a vector. The two vectors must have the same  length. :If the vectors do not overlap, then this is equivalent to . B Otherwise, the copying is performed as if the source vector were G copied to a temporary vector and then the temporary vector was copied  to the target vector. BMove 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 . B Otherwise, the copying is performed as if the source vector were G copied to a temporary vector and then the temporary vector was copied  to the target vector. '}~starting index length of the slice target source target source &}~&~}&}~ non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>None#Unboxed vectors of primitive types O(1)! Yield the length of the vector. O(1) Test whether a vector if empty O(1) Indexing O(1) Safe indexing O(1) First element O(1) Last element O(1)) Unsafe indexing without bounds checking O(1)7 First element without checking if the vector is empty O(1)6 Last element without checking if the vector is empty O(1) Indexing in a monad. GThe monad allows operations to be strict in the vector when necessary. 2 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 0, copying can be implemented like this instead:   copy mv v = ... do # x <- indexM v i  write mv i x Here, no references to v$ are retained because indexing (but not the ! elements) is evaluated eagerly. O(1)+ First element of a vector in a monad. See  for an $ explanation of why this is useful. O(1)* Last element of a vector in a monad. See  for an $ explanation of why this is useful. O(1)0 Indexing in a monad without bounds checks. See  for an $ explanation of why this is useful. O(1)> First element in a monad without checking for empty vectors.  See + for an explanation of why this is useful. O(1)= Last element in a monad without checking for empty vectors.  See + for an explanation of why this is useful. O(1)A Yield a slice of the vector without copying it. The vector must  contain at least i+n elements. O(1)D Yield all but the last element without copying. The vector may not  be empty. O(1)E Yield all but the first element without copying. The vector may not  be empty. O(1) Yield at the first n* elements without copying. The vector may  contain less than n2 elements in which case it is returned unchanged. O(1) Yield all but the first n* elements without copying. The vector may  contain less than n5 elements in which case an empty vector is returned. O(1) Yield the first n5 elements paired with the remainder without copying.  Note that  n v is equivalent to ( n v,  n v)  but slightly more efficient. O(1)> Yield a slice of the vector without copying. The vector must  contain at least i+n# elements but this is not checked. O(1)D Yield all but the last element without copying. The vector may not # be empty but this is not checked. O(1)E Yield all but the first element without copying. The vector may not # be empty but this is not checked. O(1) Yield the first n+ elements without copying. The vector must  contain at least n# elements but this is not checked. O(1) Yield all but the first n& elements without copying. The vector  must contain at least n# elements but this is not checked. O(1) Empty vector O(1)! Vector with exactly one element O(n)A Vector of the given length with the same value in each position O(n)D Construct a vector of the given length by applying the function to  each index O(n)D Apply function n times to value. Zeroth element is original value. O(n)B Construct a vector by repeatedly applying the generator function * to a seed. The generator function yields  the next element and the  new seed or  if there are no more elements. = unfoldr (\n -> if n == 0 then Nothing else Just (n,n-1)) 10  = <10,9,8,7,6,5,4,3,2,1> O(n)! Construct a vector with at most n by repeatedly applying the A generator function to the a seed. The generator function yields  the " next element and the new seed or  if there are no more elements. / unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8> O(n) Construct a vector with n% elements by repeatedly applying the C generator function to the already constructed part of the vector. F constructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in f <a,b,c> O(n) Construct a vector with n elements from right to left by L repeatedly applying the generator function to the already constructed part  of the vector. F constructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in f <c,b,a> O(n): Yield a vector of the given length containing the values x, x+1 4 etc. This operation is usually more efficient than .  enumFromN 5 3 = <5,6,7> O(n): Yield a vector of the given length containing the values x, x+y,  x+y+y5 etc. This operations is usually more efficient than . - enumFromStepN 1 0.1 5 = <1,1.1,1.2,1.3,1.4> O(n) Enumerate values from x to y. WARNING:A This operation can be very inefficient. If at all possible, use   instead. O(n) Enumerate values from x to y with a specific step z. WARNING:A This operation can be very inefficient. If at all possible, use   instead. O(n) Prepend an element O(n) Append an element O(m+n) Concatenate two vectors O(n)% Concatenate all vectors in the list O(n)D Execute the monadic action the given number of times and store the  results in a vector. O(n)@ Construct a vector of the given length by applying the monadic  action to each index <Execute the monadic action and freeze the resulting vector.   create (do { v <- new 2; write v 0 'a' ; write v 1 'b'; return v }) = <a,b> O(n)A Yield the argument but force it not to retain any extra memory,  possibly by copying it. AThis is especially useful when dealing with slices. For example:  ! force (slice 0 2 <huge vector>) KHere, the slice retains a reference to the huge vector. Forcing it creates J a copy of just the elements that belong to the slice and allows the huge ! vector to be garbage collected. O(m+n) For each pair (i,a)# from the list, replace the vector  element at position i by a. . <5,9,2,7> // [(2,1),(0,3),(2,8)] = <3,9,8,7> O(m+min(n1,n2)) For each index i from the index vector and the  corresponding value a3 from the value vector, replace the element of the  initial vector at position i by a. 0 update_ <5,9,2,7> <2,0,2> <1,3,8> = <3,9,8,7>  Same as () but without bounds checking. Same as  but without bounds checking. O(m+n) For each pair (i,b)+ from the list, replace the vector element  a at position i by f a b. A accum (+) <5,9,2> [(2,4),(1,6),(0,3),(1,7)] = <5+3, 9+6+7, 2+4> O(m+min(n1,n2)) For each index i from the index vector and the  corresponding value b from the the value vector, . replace the element of the initial vector at  position i by f a b. A accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4> Same as  but without bounds checking. Same as  but without bounds checking. O(n) Reverse a vector O(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. 5 backpermute <a,b,c,d> <0,3,2,3,1,0> = <a,d,c,d,b,a> Same as  but without bounds checking. AApply a destructive operation to a vector. The operation will be I performed in place if it is safe to do so and will modify a copy of the  vector otherwise.   modify (\v -> write v 0 'x') ( 3 'a') = <'x','a','a'> O(n) Map a function over a vector O(n)= Apply a function to every element of a vector and its index :Map a function over a vector and concatenate the results. O(n)D Apply the monadic action to all elements of the vector, yielding a  vector of results O(n)E Apply the monadic action to all elements of a vector and ignore the  results O(n)D Apply the monadic action to all elements of the vector, yielding a ! vector of results. Equvalent to flip . O(n)E Apply the monadic action to all elements of a vector and ignore the  results. Equivalent to flip .  O(min(m,n))* Zip two vectors with the given function. +Zip three vectors with the given function.  O(min(m,n))5 Zip two vectors with a function that also takes the  elements' indices. =Zip three vectors and their indices with the given function.  O(min(m,n))9 Zip the two vectors with the monadic action and yield a  vector of results  O(min(m,n))< Zip the two vectors with the monadic action and ignore the  results O(n)1 Drop elements that do not satisfy the predicate O(n)E Drop elements that do not satisfy the predicate which is applied to  values and their indices O(n)9 Drop elements that do not satisfy the monadic predicate O(n)? Yield the longest prefix of elements satisfying the predicate  without copying. O(n)@ Drop the longest prefix of elements that satisfy the predicate  without copying. O(n)? Split the vector in two parts, the first one containing those F elements that satisfy the predicate and the second one those that don't. The H relative order of the elements is preserved at the cost of a sometimes ! reduced performance compared to . O(n)? Split the vector in two parts, the first one containing those F elements that satisfy the predicate and the second one those that don't. G The order of the elements is not preserved but the operation is often  faster than . O(n)C Split the vector into the longest prefix of elements that satisfy - the predicate and the rest without copying. O(n)B Split the vector into the longest prefix of elements that do not 5 satisfy the predicate and the rest without copying. O(n)) Check if the vector contains an element O(n)= Check if the vector does not contain an element (inverse of ) O(n) Yield - the first element matching the predicate or   if no such element exists. O(n) Yield 7 the index of the first element matching the predicate  or  if no such element exists. O(n)E Yield the indices of elements satisfying the predicate in ascending  order. O(n) Yield : the index of the first occurence of the given element or  C if the vector does not contain the element. This is a specialised  version of . O(n)= Yield the indices of all occurences of the given element in 3 ascending order. This is a specialised version of . O(n) Left fold O(n) Left fold on non-empty vectors O(n)# Left fold with strict accumulator O(n)8 Left fold on non-empty vectors with strict accumulator O(n) Right fold O(n)! Right fold on non-empty vectors O(n)& Right fold with a strict accumulator O(n)9 Right fold on non-empty vectors with strict accumulator  O(n)< Left fold (function applied to each element and its index)  O(n)E Left fold with strict accumulator (function applied to each element  and its index)  O(n)= Right fold (function applied to each element and its index)  O(n)> Right fold with strict accumulator (function applied to each  element and its index)  O(n). Check if all elements satisfy the predicate. O(n)/ Check if any element satisfies the predicate. O(n)! Compute the sum of the elements O(n)% Compute the produce of the elements O(n)@ Yield the maximum element of the vector. The vector may not be  empty. O(n)@ Yield the maximum element of the vector according to the given 3 comparison function. The vector may not be empty. O(n)@ Yield the minimum element of the vector. The vector may not be  empty. O(n)@ Yield the minimum element of the vector according to the given 3 comparison function. The vector may not be empty. O(n)B Yield the index of the maximum element of the vector. The vector  may not be empty. O(n)C Yield the index of the maximum element of the vector according to = the given comparison function. The vector may not be empty. O(n)B Yield the index of the minimum element of the vector. The vector  may not be empty. O(n)C Yield the index of the minimum element of the vector according to = the given comparison function. The vector may not be empty. O(n) Monadic fold O(n)% Monadic fold over non-empty vectors O(n)& Monadic fold with strict accumulator O(n)= Monadic fold over non-empty vectors with strict accumulator O(n)' Monadic fold that discards the result O(n)> Monadic fold over non-empty vectors that discards the result O(n)? Monadic fold with strict accumulator that discards the result  O(n)= Monadic fold over non-empty vectors with strict accumulator  that discards the result !O(n) Prescan    prescanl f z =  . % f z  Example: prescanl (+) 0 <1,2,3,4> = <0,1,3,6> "O(n)! Prescan with strict accumulator #O(n) Scan    postscanl f z =  . % f z  Example: postscanl (+) 0 <1,2,3,4> = <1,3,6,10> $O(n) Scan with strict accumulator %O(n) Haskell-style scan  ) scanl f z <x1,...,xn> = <y1,...,y(n+1)>  where y1 = z  yi = f y(i-1) x(i-1)  Example:  scanl (+) 0 <1,2,3,4> = < 0,1,3,6,10> &O(n), Haskell-style scan with strict accumulator 'O(n) Scan over a non-empty vector # scanl f <x1,...,xn> = <y1,...,yn>  where y1 = x1  yi = f y(i-1) xi (O(n)8 Scan over a non-empty vector with a strict accumulator )O(n) Right-to-left prescan   prescanr f z =  . ! (flip f) z .  *O(n)/ Right-to-left prescan with strict accumulator +O(n) Right-to-left scan ,O(n), Right-to-left scan with strict accumulator -O(n)" Right-to-left Haskell-style scan .O(n): Right-to-left Haskell-style scan with strict accumulator /O(n), Right-to-left scan over a non-empty vector 0O(n): Right-to-left scan over a non-empty vector with a strict  accumulator 1O(n) Convert a vector to a list 2O(n) Convert a list to a vector 3O(n) Convert the first n elements of a list to a vector   fromListN n xs = 2 ( n xs) 4O(1)= Unsafe convert a mutable vector to an immutable one without C copying. The mutable vector may not be used after this operation. 5O(1)? Unsafely convert an immutable vector to a mutable one without E copying. The immutable vector may not be used after this operation. 6O(n)/ Yield a mutable copy of the immutable vector. 7O(n)0 Yield an immutable copy of the mutable vector. 8O(n)C Copy an immutable vector into a mutable one. The two vectors must , have the same length. This is not checked. 9O(n)C Copy an immutable vector into a mutable one. The two vectors must  have the same length. i starting index n length i starting index n length initial vector (of length m)  list of index/value pairs (of length n) initial vector (of length m) index vector (of length n1) value vector (of length n2) accumulating function f initial vector (of length m)  list of index/value pairs (of length n) accumulating function f initial vector (of length m) index vector (of length n1) value vector (of length n2)       !"#$%&'()*+,-./0123456789     i      !"#$%&'()*+,-./0123456789      !"#$%&'()*+,-./0123i769458      !"#$%&'()*+,-./0123456789      non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>None<Mutable -based vectors >Length of the mutable vector. ?"Check whether the vector is empty @7Yield a part of the mutable vector without copying it. FHYield a part of the mutable vector without copying it. No bounds checks  are performed. L-Create a mutable vector of the given length. MHCreate a mutable vector of the given length. The length is not checked. NJCreate a mutable vector of the given length (0 if the length is negative) $ and fill it with an initial value. OJCreate a mutable vector of the given length (0 if the length is negative) N and fill it with values produced by repeatedly executing the monadic action. P#Create a copy of a mutable vector. QBGrow a vector by the given number of elements. The number must be  positive. RBGrow a vector by the given number of elements. The number must be # positive but this is not checked. SGReset all elements of the vector to some undefined value, clearing all N references to external objects. This is usually a noop for unboxed vectors. T)Yield the element at the given position. U+Replace the element at the given position. V*Swap the elements at the given positions. WIYield the element at the given position. No bounds checks are performed. XKReplace the element at the given position. No bounds checks are performed. YJSwap the elements at the given positions. No bounds checks are performed. Z3Set all elements of the vector to the given value. [ECopy a vector. The two vectors must have the same length and may not  overlap. \ECopy a vector. The two vectors must have the same length and may not  overlap. This is not checked. ]BMove the contents of a vector. The two vectors must have the same  length. :If the vectors do not overlap, then this is equivalent to [. B Otherwise, the copying is performed as if the source vector were G copied to a temporary vector and then the temporary vector was copied  to the target vector. ^BMove 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 \. B Otherwise, the copying is performed as if the source vector were G copied to a temporary vector and then the temporary vector was copied  to the target vector. _O(1)B Unsafely cast a mutable vector from one element type to another. L The operation just changes the type of the underlying pointer and does not  modify the elements. CThe resulting vector contains as many elements as can fit into the  underlying memory block. `Create a mutable vector from a  with an offset and a length. Modifying data through the $ afterwards is unsafe if the vector 1 could have been frozen before the modification. 0If your offset is 0 it is more efficient to use a. aO(1) Create a mutable vector from a  and a length. CIt is assumed the pointer points directly to the data (no offset).  Use `# if you need to specify an offset. Modifying data through the $ afterwards is unsafe if the vector 1 could have been frozen before the modification. bYield the underlying & together with the offset to the data 0 and its length. Modifying the data through the  is A unsafe if the vector could have frozen before the modification. cO(1) Yield the underlying  together with its length. DYou can assume the pointer points directly to the data (no offset). Modifying the data through the  is unsafe if the vector could & have frozen before the modification. dPass a pointer to the vector'(s data to the IO action. Modifying data K through the pointer is unsafe if the vector could have been frozen before  the modification. 0:;<=>?@ABCDEFstarting index length of the slice GHIJKLMNOPQRSTUVWXYZ[\target source ]^target source _`pointer offset length apointer length bcd,:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd,<=;:>?@DEABCFIJGHKLMNOPQRSTUVWXYZ[]\^_`abcd/:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>Nonee-based vectors fO(1)! Yield the length of the vector. gO(1) Test whether a vector if empty hO(1) Indexing iO(1) Safe indexing jO(1) First element kO(1) Last element lO(1)) Unsafe indexing without bounds checking mO(1)7 First element without checking if the vector is empty nO(1)6 Last element without checking if the vector is empty oO(1) Indexing in a monad. GThe monad allows operations to be strict in the vector when necessary. 2 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 o0, copying can be implemented like this instead:   copy mv v = ... do # x <- indexM v i  write mv i x Here, no references to v$ are retained because indexing (but not the ! elements) is evaluated eagerly. pO(1)+ First element of a vector in a monad. See o for an $ explanation of why this is useful. qO(1)* Last element of a vector in a monad. See o for an $ explanation of why this is useful. rO(1)0 Indexing in a monad without bounds checks. See o for an $ explanation of why this is useful. sO(1)> First element in a monad without checking for empty vectors.  See o+ for an explanation of why this is useful. tO(1)= Last element in a monad without checking for empty vectors.  See o+ for an explanation of why this is useful. uO(1)A Yield a slice of the vector without copying it. The vector must  contain at least i+n elements. vO(1)D Yield all but the last element without copying. The vector may not  be empty. wO(1)E Yield all but the first element without copying. The vector may not  be empty. xO(1) Yield at the first n* elements without copying. The vector may  contain less than n2 elements in which case it is returned unchanged. yO(1) Yield all but the first n* elements without copying. The vector may  contain less than n5 elements in which case an empty vector is returned. zO(1) Yield the first n5 elements paired with the remainder without copying.  Note that z n v is equivalent to (x n v, y n v)  but slightly more efficient. {O(1)> Yield a slice of the vector without copying. The vector must  contain at least i+n# elements but this is not checked. |O(1)D Yield all but the last element without copying. The vector may not # be empty but this is not checked. }O(1)E Yield all but the first element without copying. The vector may not # be empty but this is not checked. ~O(1) Yield the first n+ elements without copying. The vector must  contain at least n# elements but this is not checked. O(1) Yield all but the first n& elements without copying. The vector  must contain at least n# elements but this is not checked. O(1) Empty vector O(1)! Vector with exactly one element O(n)A Vector of the given length with the same value in each position O(n)D Construct a vector of the given length by applying the function to  each index O(n)D Apply function n times to value. Zeroth element is original value. O(n)B Construct a vector by repeatedly applying the generator function * to a seed. The generator function yields  the next element and the  new seed or  if there are no more elements. = unfoldr (\n -> if n == 0 then Nothing else Just (n,n-1)) 10  = <10,9,8,7,6,5,4,3,2,1> O(n)! Construct a vector with at most n by repeatedly applying the A generator function to the a seed. The generator function yields  the " next element and the new seed or  if there are no more elements. / unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8> O(n) Construct a vector with n% elements by repeatedly applying the C generator function to the already constructed part of the vector. F constructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in f <a,b,c> O(n) Construct a vector with n elements from right to left by L repeatedly applying the generator function to the already constructed part  of the vector. F constructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in f <c,b,a> O(n): Yield a vector of the given length containing the values x, x+1 4 etc. This operation is usually more efficient than .  enumFromN 5 3 = <5,6,7> O(n): Yield a vector of the given length containing the values x, x+y,  x+y+y5 etc. This operations is usually more efficient than . - enumFromStepN 1 0.1 5 = <1,1.1,1.2,1.3,1.4> O(n) Enumerate values from x to y. WARNING:A This operation can be very inefficient. If at all possible, use   instead. O(n) Enumerate values from x to y with a specific step z. WARNING:A This operation can be very inefficient. If at all possible, use   instead. O(n) Prepend an element O(n) Append an element O(m+n) Concatenate two vectors O(n)% Concatenate all vectors in the list O(n)D Execute the monadic action the given number of times and store the  results in a vector. O(n)@ Construct a vector of the given length by applying the monadic  action to each index <Execute the monadic action and freeze the resulting vector.   create (do { v <- new 2; write v 0 'a' ; write v 1 'b'; return v }) = <a,b> O(n)A Yield the argument but force it not to retain any extra memory,  possibly by copying it. AThis is especially useful when dealing with slices. For example:  ! force (slice 0 2 <huge vector>) KHere, the slice retains a reference to the huge vector. Forcing it creates J a copy of just the elements that belong to the slice and allows the huge ! vector to be garbage collected. O(m+n) For each pair (i,a)# from the list, replace the vector  element at position i by a. . <5,9,2,7> // [(2,1),(0,3),(2,8)] = <3,9,8,7> O(m+min(n1,n2)) For each index i from the index vector and the  corresponding value a3 from the value vector, replace the element of the  initial vector at position i by a. 0 update_ <5,9,2,7> <2,0,2> <1,3,8> = <3,9,8,7>  Same as () but without bounds checking. Same as  but without bounds checking. O(m+n) For each pair (i,b)+ from the list, replace the vector element  a at position i by f a b. A accum (+) <5,9,2> [(2,4),(1,6),(0,3),(1,7)] = <5+3, 9+6+7, 2+4> O(m+min(n1,n2)) For each index i from the index vector and the  corresponding value b from the the value vector, . replace the element of the initial vector at  position i by f a b. A accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4> Same as  but without bounds checking. Same as  but without bounds checking. O(n) Reverse a vector O(n)5 Yield the vector obtained by replacing each element i of the  index vector by xshi. This is equivalent to  (xsh) is but is  often much more efficient. 5 backpermute <a,b,c,d> <0,3,2,3,1,0> = <a,d,c,d,b,a> Same as  but without bounds checking. AApply a destructive operation to a vector. The operation will be I performed in place if it is safe to do so and will modify a copy of the  vector otherwise.   modify (\v -> write v 0 'x') ( 3 'a') = <'x','a','a'> O(n) Map a function over a vector O(n)= Apply a function to every element of a vector and its index :Map a function over a vector and concatenate the results. O(n)D Apply the monadic action to all elements of the vector, yielding a  vector of results O(n)E Apply the monadic action to all elements of a vector and ignore the  results O(n)D Apply the monadic action to all elements of the vector, yielding a ! vector of results. Equvalent to flip . O(n)E Apply the monadic action to all elements of a vector and ignore the  results. Equivalent to flip .  O(min(m,n))* Zip two vectors with the given function. +Zip three vectors with the given function.  O(min(m,n))5 Zip two vectors with a function that also takes the  elements' indices. =Zip three vectors and their indices with the given function.  O(min(m,n))9 Zip the two vectors with the monadic action and yield a  vector of results  O(min(m,n))< Zip the two vectors with the monadic action and ignore the  results O(n)1 Drop elements that do not satisfy the predicate O(n)E Drop elements that do not satisfy the predicate which is applied to  values and their indices O(n)9 Drop elements that do not satisfy the monadic predicate O(n)? Yield the longest prefix of elements satisfying the predicate  without copying. O(n)@ Drop the longest prefix of elements that satisfy the predicate  without copying. O(n)? Split the vector in two parts, the first one containing those F elements that satisfy the predicate and the second one those that don't. The H relative order of the elements is preserved at the cost of a sometimes ! reduced performance compared to . O(n)? Split the vector in two parts, the first one containing those F elements that satisfy the predicate and the second one those that don't. G The order of the elements is not preserved but the operation is often  faster than . O(n)C Split the vector into the longest prefix of elements that satisfy - the predicate and the rest without copying. O(n)B Split the vector into the longest prefix of elements that do not 5 satisfy the predicate and the rest without copying. O(n)) Check if the vector contains an element O(n)= Check if the vector does not contain an element (inverse of ) O(n) Yield - the first element matching the predicate or   if no such element exists. O(n) Yield 7 the index of the first element matching the predicate  or  if no such element exists. O(n)E Yield the indices of elements satisfying the predicate in ascending  order. O(n) Yield : the index of the first occurence of the given element or  C if the vector does not contain the element. This is a specialised  version of . O(n)= Yield the indices of all occurences of the given element in 3 ascending order. This is a specialised version of . O(n) Left fold O(n) Left fold on non-empty vectors O(n)# Left fold with strict accumulator O(n)8 Left fold on non-empty vectors with strict accumulator O(n) Right fold O(n)! Right fold on non-empty vectors O(n)& Right fold with a strict accumulator O(n)9 Right fold on non-empty vectors with strict accumulator O(n)< Left fold (function applied to each element and its index) O(n)E Left fold with strict accumulator (function applied to each element  and its index) O(n)= Right fold (function applied to each element and its index) O(n)> Right fold with strict accumulator (function applied to each  element and its index) O(n). Check if all elements satisfy the predicate. O(n)/ Check if any element satisfies the predicate. O(n) Check if all elements are  O(n) Check if any element is  O(n)! Compute the sum of the elements O(n)% Compute the produce of the elements O(n)@ Yield the maximum element of the vector. The vector may not be  empty. O(n)@ Yield the maximum element of the vector according to the given 3 comparison function. The vector may not be empty. O(n)@ Yield the minimum element of the vector. The vector may not be  empty. O(n)@ Yield the minimum element of the vector according to the given 3 comparison function. The vector may not be empty. O(n)B Yield the index of the maximum element of the vector. The vector  may not be empty. O(n)C Yield the index of the maximum element of the vector according to = the given comparison function. The vector may not be empty. O(n)B Yield the index of the minimum element of the vector. The vector  may not be empty. O(n)C Yield the index of the minimum element of the vector according to = the given comparison function. The vector may not be empty. O(n) Monadic fold O(n)% Monadic fold over non-empty vectors O(n)& Monadic fold with strict accumulator O(n)= Monadic fold over non-empty vectors with strict accumulator O(n)' Monadic fold that discards the result O(n)> Monadic fold over non-empty vectors that discards the result O(n)? Monadic fold with strict accumulator that discards the result O(n)= Monadic fold over non-empty vectors with strict accumulator  that discards the result O(n) Prescan    prescanl f z = v .  f z  Example: prescanl (+) 0 <1,2,3,4> = <0,1,3,6> O(n)! Prescan with strict accumulator O(n) Scan    postscanl f z = w .  f z  Example: postscanl (+) 0 <1,2,3,4> = <1,3,6,10> O(n) Scan with strict accumulator O(n) Haskell-style scan  ) scanl f z <x1,...,xn> = <y1,...,y(n+1)>  where y1 = z  yi = f y(i-1) x(i-1)  Example:  scanl (+) 0 <1,2,3,4> = < 0,1,3,6,10> O(n), Haskell-style scan with strict accumulator O(n) Scan over a non-empty vector # scanl f <x1,...,xn> = <y1,...,yn>  where y1 = x1  yi = f y(i-1) xi O(n)8 Scan over a non-empty vector with a strict accumulator O(n) Right-to-left prescan   prescanr f z =  .  (flip f) z .  O(n)/ Right-to-left prescan with strict accumulator O(n) Right-to-left scan O(n), Right-to-left scan with strict accumulator O(n)" Right-to-left Haskell-style scan O(n): Right-to-left Haskell-style scan with strict accumulator O(n), Right-to-left scan over a non-empty vector O(n): Right-to-left scan over a non-empty vector with a strict  accumulator O(n) Convert a vector to a list O(n) Convert a list to a vector O(n) Convert the first n elements of a list to a vector   fromListN n xs =  (x n xs) O(1): Unsafely cast a vector from one element type to another. L The operation just changes the type of the underlying pointer and does not  modify the elements. CThe resulting vector contains as many elements as can fit into the  underlying memory block. O(1)= Unsafe convert a mutable vector to an immutable one without C copying. The mutable vector may not be used after this operation. O(1)? Unsafely convert an immutable vector to a mutable one without E copying. The immutable vector may not be used after this operation. O(n)/ Yield a mutable copy of the immutable vector. O(n)0 Yield an immutable copy of the mutable vector. O(n)C Copy an immutable vector into a mutable one. The two vectors must , have the same length. This is not checked. O(n)C Copy an immutable vector into a mutable one. The two vectors must  have the same length. O(1) Create a vector from a  with an offset and a length. )The data may not be modified through the  afterwards. 0If your offset is 0 it is more efficient to use . O(1) Create a vector from a  and a length. CIt is assumed the pointer points directly to the data (no offset).  Use # if you need to specify an offset. )The data may not be modified through the  afterwards. O(1) Yield the underlying ! together with the offset to the ? data and its length. The data may not be modified through the . O(1) Yield the underlying  together with its length. DYou can assume the pointer points directly to the data (no offset). )The data may not be modified through the . Pass a pointer to the vector'-s data to the IO action. The data may not be  modified through the 'Ptr. efghijklmnopqrstui starting index n length vwxyz{i starting index n length |}~initial vector (of length m)  list of index/value pairs (of length n) initial vector (of length m) index vector (of length n1) value vector (of length n2) accumulating function f initial vector (of length m)  list of index/value pairs (of length n) accumulating function f initial vector (of length m) index vector (of length n1) value vector (of length n2) pointer offset length pointer length i<=efghijklmnopqrstuvwxyz{|}~e<=fghijklmnopqrstuvwxyz{|}~iefghijklmnopqrstuvwxyz{|}~ non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>NoneL  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc/ defghijklmnopqrstuvwxyz{|}~L  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>None O(1)! Yield the length of the vector.  O(1) Test whether a vector if empty  O(1) Indexing  O(1) Safe indexing O(1) First element O(1) Last element O(1)) Unsafe indexing without bounds checking O(1)7 First element without checking if the vector is empty O(1)6 Last element without checking if the vector is empty O(1) Indexing in a monad. GThe monad allows operations to be strict in the vector when necessary. 2 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 0, copying can be implemented like this instead:   copy mv v = ... do # x <- indexM v i  write mv i x Here, no references to v$ are retained because indexing (but not the ! elements) is evaluated eagerly. O(1)+ First element of a vector in a monad. See  for an $ explanation of why this is useful. O(1)* Last element of a vector in a monad. See  for an $ explanation of why this is useful. O(1)0 Indexing in a monad without bounds checks. See  for an $ explanation of why this is useful. O(1)> First element in a monad without checking for empty vectors.  See + for an explanation of why this is useful. O(1)= Last element in a monad without checking for empty vectors.  See + for an explanation of why this is useful. O(1)A Yield a slice of the vector without copying it. The vector must  contain at least i+n elements. O(1)D Yield all but the last element without copying. The vector may not  be empty. O(1)E Yield all but the first element without copying. The vector may not  be empty. O(1) Yield at the first n* elements without copying. The vector may  contain less than n2 elements in which case it is returned unchanged. O(1) Yield all but the first n* elements without copying. The vector may  contain less than n5 elements in which case an empty vector is returned. O(1) Yield the first n5 elements paired with the remainder without copying.  Note that  n v is equivalent to ( n v,  n v)  but slightly more efficient. O(1)> Yield a slice of the vector without copying. The vector must  contain at least i+n# elements but this is not checked.  O(1)D Yield all but the last element without copying. The vector may not # be empty but this is not checked. !O(1)E Yield all but the first element without copying. The vector may not # be empty but this is not checked. "O(1) Yield the first n+ elements without copying. The vector must  contain at least n# elements but this is not checked. #O(1) Yield all but the first n& elements without copying. The vector  must contain at least n# elements but this is not checked. $O(1) Empty vector %O(1)! Vector with exactly one element &O(n)A Vector of the given length with the same value in each position 'O(n)D Construct a vector of the given length by applying the function to  each index (O(n)D Apply function n times to value. Zeroth element is original value. )O(n)B Construct a vector by repeatedly applying the generator function * to a seed. The generator function yields  the next element and the  new seed or  if there are no more elements. = unfoldr (\n -> if n == 0 then Nothing else Just (n,n-1)) 10  = <10,9,8,7,6,5,4,3,2,1> *O(n)! Construct a vector with at most n by repeatedly applying the A generator function to the a seed. The generator function yields  the " next element and the new seed or  if there are no more elements. / unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8> +O(n) Construct a vector with n% elements by repeatedly applying the C generator function to the already constructed part of the vector. F constructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in f <a,b,c> ,O(n) Construct a vector with n elements from right to left by L repeatedly applying the generator function to the already constructed part  of the vector. F constructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in f <c,b,a> -O(n): Yield a vector of the given length containing the values x, x+1 4 etc. This operation is usually more efficient than /.  enumFromN 5 3 = <5,6,7> .O(n): Yield a vector of the given length containing the values x, x+y,  x+y+y5 etc. This operations is usually more efficient than 0. - enumFromStepN 1 0.1 5 = <1,1.1,1.2,1.3,1.4> /O(n) Enumerate values from x to y. WARNING:A This operation can be very inefficient. If at all possible, use  - instead. 0O(n) Enumerate values from x to y with a specific step z. WARNING:A This operation can be very inefficient. If at all possible, use  . instead. 1O(n) Prepend an element 2O(n) Append an element 3O(m+n) Concatenate two vectors 4O(n)% Concatenate all vectors in the list 5O(n)D Execute the monadic action the given number of times and store the  results in a vector. 6O(n)@ Construct a vector of the given length by applying the monadic  action to each index 7<Execute the monadic action and freeze the resulting vector.   create (do { v <- new 2; write v 0 'a' ; write v 1 'b'; return v }) = <a,b> 8O(n)A Yield the argument but force it not to retain any extra memory,  possibly by copying it. AThis is especially useful when dealing with slices. For example:  ! force (slice 0 2 <huge vector>) KHere, the slice retains a reference to the huge vector. Forcing it creates J a copy of just the elements that belong to the slice and allows the huge ! vector to be garbage collected. 9O(m+n) For each pair (i,a)# from the list, replace the vector  element at position i by a. . <5,9,2,7> // [(2,1),(0,3),(2,8)] = <3,9,8,7> :O(m+n) For each pair (i,a) from the vector of index/ value pairs, ( replace the vector element at position i by a. 2 update <5,9,2,7> <(2,1),(0,3),(2,8)> = <3,9,8,7> ;O(m+min(n1,n2)) For each index i from the index vector and the  corresponding value a3 from the value vector, replace the element of the  initial vector at position i by a.  0 update_ <5,9,2,7> <2,0,2> <1,3,8> = <3,9,8,7>  The function :5 provides the same functionality and is usually more  convenient.   update_ xs is ys = : xs ( is ys) < Same as (9) but without bounds checking. =Same as : but without bounds checking. >Same as ; but without bounds checking. ?O(m+n) For each pair (i,b)+ from the list, replace the vector element  a at position i by f a b. A accum (+) <5,9,2> [(2,4),(1,6),(0,3),(1,7)] = <5+3, 9+6+7, 2+4> @O(m+n) For each pair (i,b). from the vector of pairs, replace the vector  element a at position i by f a b. F accumulate (+) <5,9,2> <(2,4),(1,6),(0,3),(1,7)> = <5+3, 9+6+7, 2+4> AO(m+min(n1,n2)) For each index i from the index vector and the  corresponding value b from the the value vector, . replace the element of the initial vector at  position i by f a b.  A accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4>  The function @5 provides the same functionality and is usually more  convenient.   accumulate_ f as is bs = @ f as ( is bs) BSame as ? but without bounds checking. CSame as @ but without bounds checking. DSame as A but without bounds checking. EO(n) Reverse a vector FO(n)5 Yield the vector obtained by replacing each element i of the  index vector by xs i. This is equivalent to J (xs ) is but is  often much more efficient. 5 backpermute <a,b,c,d> <0,3,2,3,1,0> = <a,d,c,d,b,a> GSame as F but without bounds checking. HAApply a destructive operation to a vector. The operation will be I 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'> IO(n). Pair each element in a vector with its index JO(n) Map a function over a vector KO(n)= Apply a function to every element of a vector and its index L:Map a function over a vector and concatenate the results. MO(n)D Apply the monadic action to all elements of the vector, yielding a  vector of results NO(n)E Apply the monadic action to all elements of a vector and ignore the  results OO(n)D Apply the monadic action to all elements of the vector, yielding a ! vector of results. Equvalent to flip M. PO(n)E Apply the monadic action to all elements of a vector and ignore the  results. Equivalent to flip N. Q O(min(m,n))* Zip two vectors with the given function. R+Zip three vectors with the given function. V O(min(m,n))5 Zip two vectors with a function that also takes the  elements' indices. W=Zip three vectors and their indices with the given function. [ O(min(m,n))9 Zip the two vectors with the monadic action and yield a  vector of results \ O(min(m,n))< Zip the two vectors with the monadic action and ignore the  results ]O(n)1 Drop elements that do not satisfy the predicate ^O(n)E Drop elements that do not satisfy the predicate which is applied to  values and their indices _O(n)9 Drop elements that do not satisfy the monadic predicate `O(n)? Yield the longest prefix of elements satisfying the predicate  without copying. aO(n)@ Drop the longest prefix of elements that satisfy the predicate  without copying. bO(n)? Split the vector in two parts, the first one containing those F elements that satisfy the predicate and the second one those that don't. The H relative order of the elements is preserved at the cost of a sometimes ! reduced performance compared to c. cO(n)? Split the vector in two parts, the first one containing those F elements that satisfy the predicate and the second one those that don't. G The order of the elements is not preserved but the operation is often  faster than b. dO(n)C Split the vector into the longest prefix of elements that satisfy - the predicate and the rest without copying. eO(n)B Split the vector into the longest prefix of elements that do not 5 satisfy the predicate and the rest without copying. fO(n)) Check if the vector contains an element gO(n)= Check if the vector does not contain an element (inverse of f) hO(n) Yield - the first element matching the predicate or   if no such element exists. iO(n) Yield 7 the index of the first element matching the predicate  or  if no such element exists. jO(n)E Yield the indices of elements satisfying the predicate in ascending  order. kO(n) Yield : the index of the first occurence of the given element or  C if the vector does not contain the element. This is a specialised  version of i. lO(n)= Yield the indices of all occurences of the given element in 3 ascending order. This is a specialised version of j. mO(n) Left fold nO(n) Left fold on non-empty vectors oO(n)# Left fold with strict accumulator pO(n)8 Left fold on non-empty vectors with strict accumulator qO(n) Right fold rO(n)! Right fold on non-empty vectors sO(n)& Right fold with a strict accumulator tO(n)9 Right fold on non-empty vectors with strict accumulator uO(n)< Left fold (function applied to each element and its index) vO(n)E Left fold with strict accumulator (function applied to each element  and its index) wO(n)= Right fold (function applied to each element and its index) xO(n)> Right fold with strict accumulator (function applied to each  element and its index) yO(n). Check if all elements satisfy the predicate. zO(n)/ Check if any element satisfies the predicate. {O(n) Check if all elements are  |O(n) Check if any element is  }O(n)! Compute the sum of the elements ~O(n)% Compute the produce of the elements O(n)@ Yield the maximum element of the vector. The vector may not be  empty. O(n)@ Yield the maximum element of the vector according to the given 3 comparison function. The vector may not be empty. O(n)@ Yield the minimum element of the vector. The vector may not be  empty. O(n)@ Yield the minimum element of the vector according to the given 3 comparison function. The vector may not be empty. O(n)B Yield the index of the maximum element of the vector. The vector  may not be empty. O(n)C Yield the index of the maximum element of the vector according to = the given comparison function. The vector may not be empty. O(n)B Yield the index of the minimum element of the vector. The vector  may not be empty. O(n)C Yield the index of the minimum element of the vector according to = the given comparison function. The vector may not be empty. O(n) Monadic fold O(n)% Monadic fold over non-empty vectors O(n)& Monadic fold with strict accumulator O(n)= Monadic fold over non-empty vectors with strict accumulator O(n)' Monadic fold that discards the result O(n)> Monadic fold over non-empty vectors that discards the result O(n)? Monadic fold with strict accumulator that discards the result O(n)= Monadic fold over non-empty vectors with strict accumulator  that discards the result O(n) Prescan    prescanl f z =  .  f z  Example: prescanl (+) 0 <1,2,3,4> = <0,1,3,6> O(n)! Prescan with strict accumulator O(n) Scan    postscanl f z =  .  f z  Example: postscanl (+) 0 <1,2,3,4> = <1,3,6,10> O(n) Scan with strict accumulator O(n) Haskell-style scan  ) scanl f z <x1,...,xn> = <y1,...,y(n+1)>  where y1 = z  yi = f y(i-1) x(i-1)  Example:  scanl (+) 0 <1,2,3,4> = < 0,1,3,6,10> O(n), Haskell-style scan with strict accumulator O(n) Scan over a non-empty vector # scanl f <x1,...,xn> = <y1,...,yn>  where y1 = x1  yi = f y(i-1) xi O(n)8 Scan over a non-empty vector with a strict accumulator O(n) Right-to-left prescan   prescanr f z = E .  (flip f) z . E O(n)/ Right-to-left prescan with strict accumulator O(n) Right-to-left scan O(n), Right-to-left scan with strict accumulator O(n)" Right-to-left Haskell-style scan O(n): Right-to-left Haskell-style scan with strict accumulator O(n), Right-to-left scan over a non-empty vector O(n): Right-to-left scan over a non-empty vector with a strict  accumulator O(n) Convert a vector to a list O(n) Convert a list to a vector O(n) Convert the first n elements of a list to a vector   fromListN n xs =  ( n xs) O(1)= Unsafe convert a mutable vector to an immutable one without C copying. The mutable vector may not be used after this operation. O(1)? Unsafely convert an immutable vector to a mutable one without E copying. The immutable vector may not be used after this operation. O(n)/ Yield a mutable copy of the immutable vector. O(n)0 Yield an immutable copy of the mutable vector. O(n)C Copy an immutable vector into a mutable one. The two vectors must , have the same length. This is not checked. O(n)C Copy an immutable vector into a mutable one. The two vectors must  have the same length. O(1) Zip 2 vectors O(1) Unzip 2 vectors O(1) Zip 3 vectors O(1) Unzip 3 vectors O(1) Zip 4 vectors O(1) Unzip 4 vectors O(1) Zip 5 vectors O(1) Unzip 5 vectors O(1) Zip 6 vectors O(1) Unzip 6 vectors     i starting index n length i starting index n length  !"#$%&'()*+,-./0123456789initial vector (of length m)  list of index/value pairs (of length n) :initial vector (of length m) vector of index/value pairs (of length n) ;initial vector (of length m) index vector (of length n1) value vector (of length n2) <=>?accumulating function f initial vector (of length m)  list of index/value pairs (of length n) @accumulating function f initial vector (of length m) vector of index/value pairs (of length n) Aaccumulating function f initial vector (of length m) index vector (of length n1) value vector (of length n2) BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~i egikmoqsuwy{}     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'(567)*+,-./0123489:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~i     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>None!Length of the mutable vector. "Check whether the vector is empty 7Yield a part of the mutable vector without copying it. HYield a part of the mutable vector without copying it. No bounds checks  are performed. -Create a mutable vector of the given length. HCreate a mutable vector of the given length. The length is not checked. JCreate a mutable vector of the given length (0 if the length is negative) $ and fill it with an initial value. JCreate a mutable vector of the given length (0 if the length is negative) N and fill it with values produced by repeatedly executing the monadic action. #Create a copy of a mutable vector. BGrow a vector by the given number of elements. The number must be  positive. BGrow a vector by the given number of elements. The number must be # positive but this is not checked. GReset all elements of the vector to some undefined value, clearing all N references to external objects. This is usually a noop for unboxed vectors. )Yield the element at the given position. +Replace the element at the given position. *Swap the elements at the given positions. IYield the element at the given position. No bounds checks are performed. KReplace the element at the given position. No bounds checks are performed. JSwap the elements at the given positions. No bounds checks are performed. 3Set all elements of the vector to the given value. ECopy a vector. The two vectors must have the same length and may not  overlap. ECopy a vector. The two vectors must have the same length and may not  overlap. This is not checked. BMove the contents of a vector. The two vectors must have the same  length. :If the vectors do not overlap, then this is equivalent to . B Otherwise, the copying is performed as if the source vector were G copied to a temporary vector and then the temporary vector was copied  to the target vector. BMove 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 . B Otherwise, the copying is performed as if the source vector were G copied to a temporary vector and then the temporary vector was copied  to the target vector. O(1) Zip 2 vectors O(1) Unzip 2 vectors O(1) Zip 3 vectors O(1) Unzip 3 vectors O(1) Zip 4 vectors O(1) Unzip 4 vectors O(1) Zip 5 vectors O(1) Unzip 5 vectors O(1) Zip 6 vectors O(1) Unzip 6 vectors +starting index length of the slice target source target source D egikmoqsuwy{}/ + non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>None7Mutable boxed vectors keyed on the monad they live in ( or ST s). Length of the mutable vector. "Check whether the vector is empty 7Yield a part of the mutable vector without copying it. HYield a part of the mutable vector without copying it. No bounds checks  are performed. -Create a mutable vector of the given length. HCreate a mutable vector of the given length. The length is not checked. JCreate a mutable vector of the given length (0 if the length is negative) $ and fill it with an initial value. JCreate a mutable vector of the given length (0 if the length is negative) N and fill it with values produced by repeatedly executing the monadic action. #Create a copy of a mutable vector. BGrow a vector by the given number of elements. The number must be  positive. BGrow a vector by the given number of elements. The number must be # positive but this is not checked. GReset all elements of the vector to some undefined value, clearing all N references to external objects. This is usually a noop for unboxed vectors. )Yield the element at the given position. +Replace the element at the given position. *Swap the elements at the given positions. IYield the element at the given position. No bounds checks are performed. KReplace the element at the given position. No bounds checks are performed. JSwap the elements at the given positions. No bounds checks are performed. 3Set all elements of the vector to the given value. ECopy a vector. The two vectors must have the same length and may not  overlap. ECopy a vector. The two vectors must have the same length and may not  overlap. This is not checked. BMove the contents of a vector. The two vectors must have the same  length. :If the vectors do not overlap, then this is equivalent to . B Otherwise, the copying is performed as if the source vector were G copied to a temporary vector and then the temporary vector was copied  to the target vector. BMove 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 . B Otherwise, the copying is performed as if the source vector were G copied to a temporary vector and then the temporary vector was copied  to the target vector. +starting index length of the slice target source target source %%* non-portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>None-Boxed vectors, supporting efficient slicing. O(1)! Yield the length of the vector. O(1) Test whether a vector if empty O(1) Indexing O(1) Safe indexing O(1) First element O(1) Last element  O(1)) Unsafe indexing without bounds checking  O(1)7 First element without checking if the vector is empty  O(1)6 Last element without checking if the vector is empty  O(1) Indexing in a monad. GThe monad allows operations to be strict in the vector when necessary. 2 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  0, copying can be implemented like this instead:   copy mv v = ... do # x <- indexM v i  write mv i x Here, no references to v$ are retained because indexing (but not the ! elements) is evaluated eagerly.  O(1)+ First element of a vector in a monad. See   for an $ explanation of why this is useful. O(1)* Last element of a vector in a monad. See   for an $ explanation of why this is useful. O(1)0 Indexing in a monad without bounds checks. See   for an $ explanation of why this is useful. O(1)> First element in a monad without checking for empty vectors.  See  + for an explanation of why this is useful. O(1)= Last element in a monad without checking for empty vectors.  See  + for an explanation of why this is useful. O(1)A Yield a slice of the vector without copying it. The vector must  contain at least i+n elements. O(1)D Yield all but the last element without copying. The vector may not  be empty. O(1)E Yield all but the first element without copying. The vector may not  be empty. O(1) Yield at the first n* elements without copying. The vector may  contain less than n2 elements in which case it is returned unchanged. O(1) Yield all but the first n* elements without copying. The vector may  contain less than n5 elements in which case an empty vector is returned. O(1) Yield the first n5 elements paired with the remainder without copying.  Note that  n v is equivalent to ( n v,  n v)  but slightly more efficient. O(1)> Yield a slice of the vector without copying. The vector must  contain at least i+n# elements but this is not checked. O(1)D Yield all but the last element without copying. The vector may not # be empty but this is not checked. O(1)E Yield all but the first element without copying. The vector may not # be empty but this is not checked. O(1) Yield the first n+ elements without copying. The vector must  contain at least n# elements but this is not checked. O(1) Yield all but the first n& elements without copying. The vector  must contain at least n# elements but this is not checked. O(1) Empty vector O(1)! Vector with exactly one element O(n)A Vector of the given length with the same value in each position  O(n)D Construct a vector of the given length by applying the function to  each index !O(n)D Apply function n times to value. Zeroth element is original value. "O(n)B Construct a vector by repeatedly applying the generator function * to a seed. The generator function yields  the next element and the  new seed or  if there are no more elements. = unfoldr (\n -> if n == 0 then Nothing else Just (n,n-1)) 10  = <10,9,8,7,6,5,4,3,2,1> #O(n)! Construct a vector with at most n by repeatedly applying the A generator function to the a seed. The generator function yields  the " next element and the new seed or  if there are no more elements. / unfoldrN 3 (\n -> Just (n,n-1)) 10 = <10,9,8> $O(n) Construct a vector with n% elements by repeatedly applying the C generator function to the already constructed part of the vector. F constructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in f <a,b,c> %O(n) Construct a vector with n elements from right to left by L repeatedly applying the generator function to the already constructed part  of the vector. F constructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in f <c,b,a> &O(n): Yield a vector of the given length containing the values x, x+1 4 etc. This operation is usually more efficient than (.  enumFromN 5 3 = <5,6,7> 'O(n): Yield a vector of the given length containing the values x, x+y,  x+y+y5 etc. This operations is usually more efficient than ). - enumFromStepN 1 0.1 5 = <1,1.1,1.2,1.3,1.4> (O(n) Enumerate values from x to y. WARNING:A This operation can be very inefficient. If at all possible, use  & instead. )O(n) Enumerate values from x to y with a specific step z. WARNING:A This operation can be very inefficient. If at all possible, use  ' instead. *O(n) Prepend an element +O(n) Append an element ,O(m+n) Concatenate two vectors -O(n)% Concatenate all vectors in the list .O(n)D Execute the monadic action the given number of times and store the  results in a vector. /O(n)@ Construct a vector of the given length by applying the monadic  action to each index 0<Execute the monadic action and freeze the resulting vector.   create (do { v <- new 2; write v 0 'a' ; write v 1 'b'; return v }) = <a,b> 1O(n)A Yield the argument but force it not to retain any extra memory,  possibly by copying it. AThis is especially useful when dealing with slices. For example:  ! force (slice 0 2 <huge vector>) KHere, the slice retains a reference to the huge vector. Forcing it creates J a copy of just the elements that belong to the slice and allows the huge ! vector to be garbage collected. 2O(m+n) For each pair (i,a)# 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> 3O(m+n) For each pair (i,a) from the vector of index/ value pairs, ( replace the vector element at position i by a. 2 update <5,9,2,7> <(2,1),(0,3),(2,8)> = <3,9,8,7> 4O(m+min(n1,n2)) For each index i from the index vector and the  corresponding value a3 from the value vector, replace the element of the  initial vector at position i by a.  0 update_ <5,9,2,7> <2,0,2> <1,3,8> = <3,9,8,7>  The function 35 provides the same functionality and is usually more  convenient.   update_ xs is ys = 3 xs (T is ys) 5 Same as (2) but without bounds checking. 6Same as 3 but without bounds checking. 7Same as 4 but without bounds checking. 8O(m+n) For each pair (i,b)+ from the list, replace the vector element  a at position i by f a b. A accum (+) <5,9,2> [(2,4),(1,6),(0,3),(1,7)] = <5+3, 9+6+7, 2+4> 9O(m+n) For each pair (i,b). from the vector of pairs, replace the vector  element a at position i by f a b. F accumulate (+) <5,9,2> <(2,4),(1,6),(0,3),(1,7)> = <5+3, 9+6+7, 2+4> :O(m+min(n1,n2)) For each index i from the index vector and the  corresponding value b from the the value vector, . replace the element of the initial vector at  position i by f a b.  A accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4>  The function 95 provides the same functionality and is usually more  convenient.   accumulate_ f as is bs = 9 f as (T is bs) ;Same as 8 but without bounds checking. <Same as 9 but without bounds checking. =Same as : but without bounds checking. >O(n) Reverse a vector ?O(n)5 Yield the vector obtained by replacing each element i of the  index vector by xsi. This is equivalent to C (xs) is but is  often much more efficient. 5 backpermute <a,b,c,d> <0,3,2,3,1,0> = <a,d,c,d,b,a> @Same as ? but without bounds checking. AAApply a destructive operation to a vector. The operation will be I 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'> BO(n). Pair each element in a vector with its index CO(n) Map a function over a vector DO(n)= Apply a function to every element of a vector and its index E:Map a function over a vector and concatenate the results. FO(n)D Apply the monadic action to all elements of the vector, yielding a  vector of results GO(n)E Apply the monadic action to all elements of a vector and ignore the  results HO(n)D Apply the monadic action to all elements of the vector, yielding a ! vector of results. Equvalent to flip F. IO(n)E Apply the monadic action to all elements of a vector and ignore the  results. Equivalent to flip G. J O(min(m,n))* Zip two vectors with the given function. K+Zip three vectors with the given function. O O(min(m,n))5 Zip two vectors with a function that also takes the  elements' indices. P=Zip three vectors and their indices with the given function. T(Elementwise pairing of array elements. U4zip together three vectors into a vector of triples Y O(min(m,n)) Unzip a vector of pairs. ^ O(min(m,n))9 Zip the two vectors with the monadic action and yield a  vector of results _ O(min(m,n))< Zip the two vectors with the monadic action and ignore the  results `O(n)1 Drop elements that do not satisfy the predicate aO(n)E Drop elements that do not satisfy the predicate which is applied to  values and their indices bO(n)9 Drop elements that do not satisfy the monadic predicate cO(n)? Yield the longest prefix of elements satisfying the predicate  without copying. dO(n)@ Drop the longest prefix of elements that satisfy the predicate  without copying. eO(n)? Split the vector in two parts, the first one containing those F elements that satisfy the predicate and the second one those that don't. The H relative order of the elements is preserved at the cost of a sometimes ! reduced performance compared to f. fO(n)? Split the vector in two parts, the first one containing those F elements that satisfy the predicate and the second one those that don't. G The order of the elements is not preserved but the operation is often  faster than e. gO(n)C Split the vector into the longest prefix of elements that satisfy - the predicate and the rest without copying. hO(n)B Split the vector into the longest prefix of elements that do not 5 satisfy the predicate and the rest without copying. iO(n)) Check if the vector contains an element jO(n)= Check if the vector does not contain an element (inverse of i) kO(n) Yield - the first element matching the predicate or   if no such element exists. lO(n) Yield 7 the index of the first element matching the predicate  or  if no such element exists. mO(n)E Yield the indices of elements satisfying the predicate in ascending  order. nO(n) Yield : the index of the first occurence of the given element or  C if the vector does not contain the element. This is a specialised  version of l. oO(n)= Yield the indices of all occurences of the given element in 3 ascending order. This is a specialised version of m. pO(n) Left fold qO(n) Left fold on non-empty vectors rO(n)# Left fold with strict accumulator sO(n)8 Left fold on non-empty vectors with strict accumulator tO(n) Right fold uO(n)! Right fold on non-empty vectors vO(n)& Right fold with a strict accumulator wO(n)9 Right fold on non-empty vectors with strict accumulator xO(n)< Left fold (function applied to each element and its index) yO(n)E Left fold with strict accumulator (function applied to each element  and its index) zO(n)= Right fold (function applied to each element and its index) {O(n)> Right fold with strict accumulator (function applied to each  element and its index) |O(n). Check if all elements satisfy the predicate. }O(n)/ Check if any element satisfies the predicate. ~O(n) Check if all elements are  O(n) Check if any element is  O(n)! Compute the sum of the elements O(n)% Compute the produce of the elements O(n)@ Yield the maximum element of the vector. The vector may not be  empty. O(n)@ Yield the maximum element of the vector according to the given 3 comparison function. The vector may not be empty. O(n)@ Yield the minimum element of the vector. The vector may not be  empty. O(n)@ Yield the minimum element of the vector according to the given 3 comparison function. The vector may not be empty. O(n)B Yield the index of the maximum element of the vector. The vector  may not be empty. O(n)C Yield the index of the maximum element of the vector according to = the given comparison function. The vector may not be empty. O(n)B Yield the index of the minimum element of the vector. The vector  may not be empty. O(n)C Yield the index of the minimum element of the vector according to = the given comparison function. The vector may not be empty. O(n) Monadic fold O(n)% Monadic fold over non-empty vectors O(n)& Monadic fold with strict accumulator O(n)= Monadic fold over non-empty vectors with strict accumulator O(n)' Monadic fold that discards the result O(n)> Monadic fold over non-empty vectors that discards the result O(n)? Monadic fold with strict accumulator that discards the result O(n)= Monadic fold over non-empty vectors with strict accumulator  that discards the result -Evaluate each action and collect the results -Evaluate each action and discard the results O(n) Prescan    prescanl f z =  .  f z  Example: prescanl (+) 0 <1,2,3,4> = <0,1,3,6> O(n)! Prescan with strict accumulator O(n) Scan    postscanl f z =  .  f z  Example: postscanl (+) 0 <1,2,3,4> = <1,3,6,10> O(n) Scan with strict accumulator O(n) Haskell-style scan  ) scanl f z <x1,...,xn> = <y1,...,y(n+1)>  where y1 = z  yi = f y(i-1) x(i-1)  Example:  scanl (+) 0 <1,2,3,4> = < 0,1,3,6,10> O(n), Haskell-style scan with strict accumulator O(n) Scan over a non-empty vector # scanl f <x1,...,xn> = <y1,...,yn>  where y1 = x1  yi = f y(i-1) xi O(n)8 Scan over a non-empty vector with a strict accumulator O(n) Right-to-left prescan   prescanr f z = > .  (flip f) z . > O(n)/ Right-to-left prescan with strict accumulator O(n) Right-to-left scan O(n), Right-to-left scan with strict accumulator O(n)" Right-to-left Haskell-style scan O(n): Right-to-left Haskell-style scan with strict accumulator O(n), Right-to-left scan over a non-empty vector O(n): Right-to-left scan over a non-empty vector with a strict  accumulator O(n) Convert a vector to a list O(n) Convert a list to a vector O(n) Convert the first n elements of a list to a vector   fromListN n xs =  ( n xs) O(1)= Unsafe convert a mutable vector to an immutable one without C copying. The mutable vector may not be used after this operation. O(1)? Unsafely convert an immutable vector to a mutable one without E copying. The immutable vector may not be used after this operation. O(n)/ Yield a mutable copy of the immutable vector. O(n)0 Yield an immutable copy of the mutable vector. O(n)C Copy an immutable vector into a mutable one. The two vectors must , have the same length. This is not checked. O(n)C Copy an immutable vector into a mutable one. The two vectors must  have the same length.      i starting index n length i starting index n length  !"#$%&'()*+,-./012initial vector (of length m)  list of index/value pairs (of length n) 3initial vector (of length m) vector of index/value pairs (of length n) 4initial vector (of length m) index vector (of length n1) value vector (of length n2) 5678accumulating function f initial vector (of length m)  list of index/value pairs (of length n) 9accumulating function f initial vector (of length m) vector of index/value pairs (of length n) :accumulating function f initial vector (of length m) index vector (of length n1) value vector (of length n2) ;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~i      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !./0"#$%&'()*+,-123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX^_YZ[\]`abcdefghijklmnopqrstuvwxyz{|}~i      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%%&''()*+,-./0123456789:;<=>>?@ABCDCEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     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 { | } ~    E F G H I K M N O P Q R S T U V W X Y ] ^ _ f g h i j k l m n o r t v x y z | ~ p q Z [ ` a s E F T W X U V I J         T U V W X E F  S P Q          T U V W X G H I K    M N O  J L              ^ Y  Z [ ! " f g h i j # $ % & ' k l m n o ` a ( ) * + , r - s t v . / 0 x y z | 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 p q    [ \]^EFTWXUVIJEFSPQ     TUVWXGHIKMNOJLY Z[!"fghij#$%&'`ar-stv./0xyz|123~456789:;<=>?@ABCDEFGHILMNOPQRSUWXV]^EFTWXUVIJ_`abcdEFSPQ     TUVWXGHIKMNOJLY Z[!"fghij#$%&'`ar-stv./0xyz|123~456789:;<=>?@ABCDEFGHILMNOPQRS_UWXV`abcde]^EFSPQ     TUVWXGHIKMNOJL^Y Z[!"fghij#$%&'`ar-stv./0xyz|123~456789:;<=>?@ABCDEFGHILMNOPQRSUWXVk(l)m*n+o,EFTWXUVIJk(l)m*n+o,]^EFTWXUVIJEFSPQ     TUVWXGHIKMNOJL^Y Z[!"fghij#$%&'klmno()*+,`ar-stv./0xyz|123~456789:;<=>?@ABCDEFGHIJKLMNOPQRSUWXVfghijklmnopqrstuvwxyz{|}~}EI                              ffgfg                   !"#$%&'()*+,-./0123f456789:;<=>?@Avector-0.10.9.0Data.Vector.Storable.MutableData.Vector.Primitive.MutableData.Vector.Storable.InternalData.Vector.Fusion.UtilData.Vector.Fusion.Bundle.SizeData.Vector.Internal.Check!Data.Vector.Fusion.Stream.Monadic Data.Vector.Generic.Mutable.BaseData.Vector.Generic!Data.Vector.Fusion.Bundle.MonadicData.Vector.Fusion.BundleData.Vector.Generic.MutableData.Vector.Generic.NewData.Vector.PrimitiveData.Vector.StorableData.Vector.UnboxedData.Vector.Unboxed.MutableData.Vector.Mutable Data.VectorData.Vector.Generic.BasePrelude showsPrec Text.ReadreadPrec Data.DatagfoldlData.Vector.Unboxed.BasebaseForeign.StorableStorableprimitive-0.5.1.0Data.Primitive.TypesPrimgetPtrsetPtrupdPtrBoxunBoxIdunId delay_inline delayed_minSizeUnknownMaxExactsmallerlargertoMax upperBoundChecksInternalUnsafeBoundsdoCheckserror internalErrorcheck checkIndex checkLength checkSliceStreamStepDoneSkipYieldSPECSPEC2lengthnullempty singleton replicate replicateMgenerate generateMconssnoc++headlast!!!?sliceinittailtakedropmapmapMmapM_transunboxindexedindexedRzipWithM zipWithM_ zipWith3M zipWith4M zipWith5M zipWith6MzipWithzipWith3zipWith4zipWith5zipWith6zipzip3zip4zip5zip6eqcmpfilterfilterM 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 fromListNMVector basicLengthbasicUnsafeSlice basicOverlapsbasicUnsafeNewbasicUnsafeReplicatebasicUnsafeReadbasicUnsafeWrite basicClearbasicSetbasicUnsafeCopybasicUnsafeMovebasicUnsafeGrowVectorbasicUnsafeFreezebasicUnsafeThawbasicUnsafeIndexMelemseqMutableBundlesElemssChunkssVectorsSizeChunk fromStreamchunkselementssizesizedunsafeFromList fromVector fromVectors concatVectorsreVectorMBundleinplaceliftmstreamfill transformmstreamRfillR transformRunstream munstream vunstream unstreamR munstreamRsplitAt unsafeSlice unsafeInit unsafeTail unsafeTake unsafeDropoverlapsnew unsafeNewclonegrow unsafeGrowclearreadwriteswap unsafeRead unsafeWrite unsafeSwapsetcopymove unsafeCopy unsafeMoveaccumupdate unsafeAccum unsafeUpdatereverseunstablePartitionunstablePartitionBundlepartitionBundleNewcreaterunrunPrimapplymodifymodifyWithBundle! unsafeIndex unsafeHead unsafeLastindexMheadMlastM unsafeIndexM unsafeHeadM unsafeLastM constructN constructrN enumFromNconcatforce//update_ unsafeUpd unsafeUpdate_ accumulate accumulate_unsafeAccumulateunsafeAccumulate_ backpermuteunsafeBackpermuteimapforMforM_izipWith izipWith3 izipWith4 izipWith5 izipWith6unzipunzip3unzip4unzip5unzip6ifilter partitionspanbreak findIndices elemIndex elemIndicesfoldr'foldr1'ifoldlifoldl'ifoldrifoldr'allanysumproductmaximum maximumByminimum minimumBymaxIndex maxIndexByminIndex minIndexByfoldM_fold1M_foldM'_fold1M'_sequence sequence_prescanr prescanr' postscanr postscanr'scanrscanr'scanr1scanr1'convert unsafeFreezefreeze unsafeThawthawstreamstreamRmkTypedataCastSTVectorIOVector unsafeCastunsafeFromForeignPtrunsafeFromForeignPtr0unsafeToForeignPtrunsafeToForeignPtr0 unsafeWithUnboxghc-prim GHC.Classesmin $fMonadBox $fFunctorBox $fMonadId $fFunctorId lowerBound $fNumSizenot&&||doBoundsChecksdoUnsafeChecksdoInternalChecks error_msg checkErrorcheckIndex_msgcheckIndex_msg#checkLength_msgcheckLength_msg#checkSlice_msgcheckSlice_msg# Data.MaybeNothingJust DropWhileDropWhile_NextDropWhile_YieldDropWhile_Drop emptyStreamconsumeenumFromTo_smallenumFromTo_intenumFromTo_intlikeenumFromTo_big_wordenumFromTo_big_intenumFromTo_charenumFromTo_double$fFunctorStream $fFunctorStepGHC.List$fFunctorBundletoListFB $fOrdBundle $fEqBundle vmunstreamenlargeexchangeunsafeExchange unsafeAppend1unsafePrepend1 munstreamMaxmunstreamUnknown vmunstreamMaxvmunstreamUnknown munstreamRMaxmunstreamRUnknown growFront enlarge_delta enlargeFrontunsafeGrowFrontunstablePartitionMax partitionMaxpartitionUnknown GHC.TypesTrueEqOrd update_streamunsafeUpdate_stream accum_streamunsafeAccum_streampartition_streamunstablePartition_streamunstablePartition_newdiscard unstreamM unstreamPrimMunstreamPrimM_IOunstreamPrimM_ST$fMVectorMVectora$fNFDataMVector$fMonoidVector $fOrdVector $fEqVector$fVectorVectora $fDataVector $fReadVector $fShowVector$fNFDataVectorGHC.ForeignPtr ForeignPtr storableSetstorableSetAsPrim mallocVector vectorTyConfromBooltoBool$fVectorVector(,,,,,)$fMVectorMVector(,,,,,)$fUnbox(,,,,,)$fVectorVector(,,,,)$fMVectorMVector(,,,,) $fUnbox(,,,,)$fVectorVector(,,,)$fMVectorMVector(,,,) $fUnbox(,,,)$fVectorVector(,,)$fMVectorMVector(,,) $fUnbox(,,)$fVectorVector(,)$fMVectorMVector(,) $fUnbox(,)$fVectorVectorComplex$fMVectorMVectorComplex$fUnboxComplex$fVectorVectorBool$fMVectorMVectorBool $fUnboxBool$fVectorVectorChar$fMVectorMVectorChar $fUnboxChar$fVectorVectorDouble$fMVectorMVectorDouble $fUnboxDouble$fVectorVectorFloat$fMVectorMVectorFloat $fUnboxFloat$fVectorVectorWord64$fMVectorMVectorWord64 $fUnboxWord64$fVectorVectorWord32$fMVectorMVectorWord32 $fUnboxWord32$fVectorVectorWord16$fMVectorMVectorWord16 $fUnboxWord16$fVectorVectorWord8$fMVectorMVectorWord8 $fUnboxWord8$fVectorVectorWord$fMVectorMVectorWord $fUnboxWord$fVectorVectorInt64$fMVectorMVectorInt64 $fUnboxInt64$fVectorVectorInt32$fMVectorMVectorInt32 $fUnboxInt32$fVectorVectorInt16$fMVectorMVectorInt16 $fUnboxInt16$fVectorVectorInt8$fMVectorMVectorInt8 $fUnboxInt8$fVectorVectorInt$fMVectorMVectorInt $fUnboxInt$fVectorVector()$fMVectorMVector() $fUnbox()$fTypeable2MVector$fTypeable1VectorV_6MV_6V_5MV_5V_4MV_4V_3MV_3V_2MV_2 V_Complex MV_ComplexV_BoolMV_BoolV_CharMV_CharV_Double MV_DoubleV_FloatMV_FloatV_Word64 MV_Word64V_Word32 MV_Word32V_Word16 MV_Word16V_Word8MV_Word8V_WordMV_WordV_Int64MV_Int64V_Int32MV_Int32V_Int16MV_Int16V_Int8MV_Int8V_IntMV_IntV_UnitMV_UnitIO moveBackwardsmoveForwardsSmallOverlapmoveForwardsLargeOverlaploopM uninitialised$fTraversableVector$fFoldableVector$fAlternativeVector$fApplicativeVector$fMonadPlusVector $fMonadVector$fFunctorVector