Îõ³h$î/*      !"#$%&'()%Johan Tibell BSD3NoneÇÔÙÉ*persistent-vectorˆCreate a new mutable array of specified size, in the specified state thread, with each element containing the specified initial value.+persistent-vectorÅUnsafely copy the elements of an array. Array bounds are not checked.,persistent-vectorÅUnsafely copy the elements of an array. Array bounds are not checked.-persistent-vectorO(n)Ô Insert an element at the given position in this array, increasing its size by one..persistent-vectorO(n)Ô Insert an element at the given position in this array, increasing its size by one./persistent-vectorO(n)8 Update the element at the given position in this array.0persistent-vectorO(n)8 Update the element at the given position in this array.1persistent-vectorO(n)š Update the element at the given positio in this array, by applying a function to it. Evaluates the element to WHNF before inserting it into the array.2persistent-vectorO(1)Ê Update the element at the given position in this array, without copying.3persistent-vector.Note: strict in the initial accumulator value.4persistent-vector.Note: Strict in the initial accumulator value.5persistent-vectorO(n)Ô Delete an element at the given position in this array, decreasing its size by one.6persistent-vectorO(n)Ô Delete an element at the given position in this array, decreasing its size by one.7persistent-vectorStrict version of 8.,9:;<*=>?@ABCDEFGHIJK+,-./0123LMN4OP5687QRSTUNoneÇÙñpersistent-vector.Persistent vectors based on array mapped triespersistent-vector O(n)  Map over the vectorpersistent-vector O(n)  Right fold over the vectorpersistent-vector O(n) # Strict right fold over the vector..Note: Strict in the initial accumulator value.persistent-vector O(n)  Left fold over the vector.persistent-vector O(n) " Strict left fold over the vector..Note: Strict in the initial accumulator value.persistent-vector O(m)  Append two  instances  append v1 v2*This operation is linear in the length of v2 (where length v1 == n and length v2 == m).persistent-vector O(1)  The empty vector.persistent-vector O(1) $ Test to see if the vector is empty. persistent-vector O(1)  Get the length of the vector. persistent-vector O(1) ' Bounds-checked indexing into a vector. persistent-vector O(1) " Unchecked indexing into a vector.ÙOut-of-bounds indexing might not even crash”@it will usually just return nonsense values.ÕNote: the actual lookup is not performed until the result is forced. This can cause a memory leak if the result of indexing is stored, unforced, after the rest of the vector becomes garbage. To avoid this, use   or   instead. persistent-vector O(1) Â Unchecked indexing into a vector in the context of an arbitrary V functor. If the V is "strict" (such as W , (strict) ST s , (strict) StateT, or X , but not Identity, ReaderTù, etc.), then the lookup is performed before the next action. This avoids space leaks that can result from lazy uses of  . See the documentation for   for a custom VÂ that can be especially useful in conjunction with this function.ãNote that out-of-bounds indexing might not even crash”@it will usually just return nonsense values. persistent-vector O(1) " Unchecked indexing into a vector.ãNote that out-of-bounds indexing might not even crash”@it will usually just return nonsense values.ãThis function exists mostly because there is not, as yet, a well-known, canonical, and convenient liftedË unary tuple. So we instead offer an eager indexing function returning an unliftedÞ unary tuple. Users who prefer to avoid such "low-level" features can do something like this: €data Solo a = Solo a deriving Functor instance Applicative Solo where pure = Solo liftA2 f (Solo a) (Solo b) = Solo (f a b) Now *unsafeIndexA :: Vector a -> Int -> Solo a persistent-vector O(1) * Construct a vector with a single element.persistent-vector O(1) , Append an element to the end of the vector.persistent-vector O(1)  Update a single element at ix with new value elt in v. update ix elt vpersistent-vector O(n)  Bulk update.  v // updates For each (index, element) pair in updates , modify v such that the indexth position of v is element. Indices in updates that are not in vÝ are ignored. The updates are applied in order, so the last one at each index takes effegct.persistent-vector O(n)  Reverse a vectorpersistent-vector O(n) # Filter according to the predicate.persistent-vector O(n) : Return the elements that do and do not obey the predicatepersistent-vector O(n)  Construct a vector from a listpersistent-vector O(n)  Take n) elements starting from the start of the persistent-vector O(n)  Drop n) elements starting from the start of the persistent-vector O(n) - Split the vector into two at the given indexéNote that this function strictly computes both result vectors (once the tuple itself is reduced to whnf)persistent-vector O(n)  Return a slice of v of length length starting at index start+. The returned vector may have fewer than lengthé elements if the bounds are off on either side (the start is negative or length takes it past the end).7A slice of negative or zero length is the empty vector. slice start length vpersistent-vector O(1) $ Drop any unused space in the vector$NOTE: This is currently the identitypersistent-vector O(n) Ü Apply a predicate p to the vector, returning the longest prefix of elements that satisfy p.persistent-vector O(n) 0 Returns the longest suffix after takeWhile p v.  Ù      !"#$%&'()*+,-./0123456789 :; <=>? @ABCDEFGHIJKLMNOPQRMSTÕ.persistent-vector-0.2.0-E3mIeaY0wl8F1VuqFlUnnmData.Vector.PersistentData.Vector.Persistent.ArrayVectormapfoldrfoldr'foldlfoldl'appendemptynulllengthindex unsafeIndex unsafeIndexA unsafeIndex# singletonsnocupdate//reversefilter partitionfromListtakedropsplitAtsliceshrink takeWhile dropWhile$fNFDataVector_ $fOrdVector_ $fEqVector_$fNFDataVector$fTraversableVector$fMonoidVector$fSemigroupVector$fFunctorVector$fFoldableVector $fOrdVector $fEqVector $fShowVector $fShowVector_newcopycopyMinsertinsert'update' updateWith unsafeUpdate'deletedelete'map'MArrayArraylengthMnew_ singleton'pairreadwriteindex#index_indexM_ unsafeFreeze unsafeThawrunrun2 boundedFoldl' boundedFoldrthaw fromListRevtoList traverseArraybaseGHC.Base Applicativeghc-prim GHC.TypesIO GHC.MaybeMaybe