k      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij portable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>klmnopqrpqrportableinternal'Roman Leshchinskiy <rl@cse.unsw.edu.au>stuvwxstuvwxportable experimental'Roman Leshchinskiy <rl@cse.unsw.edu.au>  Strict Maybe  Strict sum  Strict pair     non-portable (existentials)internal'Roman Leshchinskiy <rl@cse.unsw.edu.au>y Empty stream zSingleton stream { Construction | Replication }CGiven a stream of (length,value) pairs and the sum of the lengths, + replicate each value to the given length. LFIXME: This should probably produce a segmented stream but since we want to  get rid of them anyway... ~Concatenation  Indexing  ----------  Indexing  ---------- Associate each element in the  with its index  Substreams  ------------ Yield the tail of a stream  Conversion to/ from lists  -------------------------- Convert a list to a  Generate a list from a  Mapping  Filtering Folding  Scanning Zipping JFIXME: The definition below duplicates work if the second stream produces F Skips. Unfortunately, GHC tends to introduce join points which break ) SpecConstr with the correct definition. Yield an enumerated stream BFIXME: Can this be implemented polymorphically? We could just use " enumFromThenTo here, but this won'#t really work for parallel arrays. . Perhaps we have to introduce an EnumP class? 1Yield an enumerated stream using a specific step 3yz{|}~.yz{|}~/non-portable (unboxed values and GHC libraries)internal'Roman Leshchinskiy <rl@cse.unsw.edu.au>1Number of elements of an immutable unboxed array .Number of elements of a mutable unboxed array  Empty array JProduces an array that consists of a subrange of the original one without  copying any elements. (Allocate an uninitialised unboxed array KTurn a mutable into an immutable array WITHOUT copying its contents, which G implies that the mutable array must not be mutated anymore after this  operation has been executed. K The explicit size parameter supports partially filled arrays (and must be G less than or equal the size used when allocating the mutable array) KTurn a mutable into an immutable array WITHOUT copying its contents, which G implies that the mutable array must not be mutated anymore after this  operation has been executed.  In contrast to $, this operation always freezes the  entire array. Stream of unboxed arrays  ------------------------- 4Generate a stream from an array, from left to right @Construct an array from a stream, filling it from left to right Combinators for unboxed arrays  - (Replicate combinator for unboxed arrays DExtract a slice from an array (given by its start index and length) %Map a function over an unboxed array Reduce an unboxed array BReduce an unboxed array using an *associative* combining operator Summation of an unboxed array %Prefix reduction of an unboxed array FPrefix reduction of an unboxed array using an *associative* combining  operator >Extract a slice from a mutable array (the slice is immutable) HCopy a the contents of an immutable array into a mutable array from the  specified position on Convert a list to an array Convert an array to a list 6The basic operations on unboxed arrays are overloaded Unboxed arrays  --------------- non-portable (GADTS)internal'Roman Leshchinskiy <rl@cse.unsw.edu.au>Creating unboxed arrays  ------------------------ #Basic operations on unboxed arrays % ----------------------------------- Yield an array of units 'Elementwise pairing of array elements. )Elementwise unpairing of array elements. 1Yield the first components of an array of pairs. 2Yield the second components of an array of pairs. #Array operations on unboxed arrays  - LNB: We use instances for all possible unboxed types instead of re-using the M overloading provided by UAE to avoid having to store the UAE dictionary  in UAPrimU. )Basic operations on representation types + ----------------------------------------- DThis type class determines the types that can be elements immutable K unboxed arrays. The representation type of these arrays is defined by way L of an associated type. All representation-dependent functions are methods  of this class. %Yield the length of an unboxed array 5Extract an element out of an immutable unboxed array ARestrict access to a subrange of the original array (no copying) ,Yield the length of a mutable unboxed array !!Allocate a mutable unboxed array "-Read an element from a mutable unboxed array #-Update an element in a mutable unboxed array $CCopy the contents of an immutable unboxed array into a mutable one  from the specified position on %2Convert a mutable into an immutable unboxed array  !"#$% !"#$%non-portable (existentials)internal'Roman Leshchinskiy <rl@cse.unsw.edu.au>&4Generate a stream from an array, from left to right '=Create an array from a stream, filling it from left to right (@Fill a mutable array from a stream from left to right and yield ! the number of elements written. &'(&'( portableinternal'Roman Leshchinskiy <rl@cse.unsw.edu.au>)O(1),  $ returns the length of a UArr as an  . *&Test whether the given array is empty +Yield an empty array ,Yield a singleton array -Prepend an element to an array .Append an element to an array /9Yield an array where all elements contain the same value 1Array indexing 4Concatenate two arrays 6Repeat an array n times 7 Indexing  --------- 3Associate each element of the array with its index 8 Conversion  ----------- "Turn a list into a parallel array 93Collect the elements of a parallel array in a list :Map a function over an array ;AExtract all elements from an array that meet the given predicate <CExtract all elements from an array according to a given flag array =)Array reduction proceeding from the left >>Array reduction proceeding from the left for non-empty arrays FIXME: Rewrite for s. 0foldl1U :: UA a => (a -> a -> a) -> UArr a -> a  {- INLINE foldl1U -} % foldl1U f arr = checkNotEmpty (here foldl1U) (lengthU arr) $  foldlU f (arr % 0) (sliceU arr 1 (lengthU arr - 1)) @KArray reduction that requires an associative combination function with its  unit BIReduction of a non-empty array which requires an associative combination  function C+Prefix scan proceedings from left to right D?Prefix scan of a non-empty array proceeding from left to right EDPrefix scan proceeding from left to right that needs an associative $ combination function with its unit FJPrefix scan of a non-empty array proceeding from left to right that needs % an associative combination function HFAccumulating map from left to right. Does not return the accumulator. 'FIXME: Naming inconsistent with lists. Q2Split an array into two halves at the given index R , applied to a predicate p and a UArr xs, 0 returns the longest prefix (possibly empty) of xs of elements that satisfy p. S  p xs$ returns the suffix remaining after   p xs. TO(n),fusion. The find) function takes a predicate and an array F and returns the first element in the list matching the predicate, or    if there is no such element. UO(n), fusion, The  findIndex5 function takes a predicate and an array and returns G the index of the first element in the array satisfying the predicate,  or   if there is no such element. VO(n),fusion.    key assocs looks up a key in an array + of pairs treated as an association table. 4)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVW3)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYield an enumerated array *FIXME: See comments about enumFromThenToS Z0Yield an enumerated array using a specific step *FIXME: See comments about enumFromThenToS XYZ[\XYZ[\a(Compute the sum of an array of numerals b,Compute the product of an array of numerals c*Determine the maximum element in an array dCDetermine the maximum element in an array under the given ordering e*Determine the minimum element in an array fCDetermine the minimum element in an array under the given ordering g3Determine whether the given element is in an array h Negation of g ]^_`abcdefgh ]^_`abcdefghi Permutations  ------------- Standard permutation KBack permutation operation (ie, the permutation vector determines for each = position in the result array its origin in the input array) Default back permute J The values of the index-value pairs are written into the position in the > result array that is indicated by the corresponding index. H All positions not covered by the index-value pairs will have the value C determined by the initialiser function for that index position. >Yield an array constructed by updating the first array by the 9 associations from the second array (which contains index/value pairs). *Reverse the order of elements in an array ijijportableinternal'Roman Leshchinskiy <rl@cse.unsw.edu.au>k  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk&'89+,-.423N5*):@BA=>?]^`_abcedfCDEFGH/0POQRSgh;T1UVILJKXYZ[\M<76W !"#%$ij(  !""#$%&'()*+,-./0123456789 : ; < = > ? @ 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 hijklmnopqrstuvwxyz{ |} |~ | | |:B   uvector-0.1.0.1Data.Array.VectorData.Array.Vector.Prim.TextData.Array.Vector.Prim.Debug"Data.Array.Vector.Prim.HyperstrictData.Array.Vector.StreamData.Array.Vector.Prim.BUArrData.Array.Vector.UArrData.Array.Vector.Strict.StreamData.Array.Vector.Strict.BasicsbaseGHC.ListData.Int Data.MaybeData.Array.Vector.Strict.EnumData.Array.Vector.Strict.Sums Data.Array.Vector.Strict.PermuteData.Array.Vector.Strict.TextfstSsndSpairSunpairScurrySuncurryS unsafe_pairSunsafe_unpairSmaybeS fromMaybeSMaybeSJustSNothingSEitherSRightSLeftS:*:UArrMUArrunsafeFreezeAllMUnewUunitsUzipUunzipUfstUsndUUIOhPutUhGetUUAsliceUlengthMUnewMUreadMUwriteMUcopyMUunsafeFreezeMUstreamU unstreamU unstreamMUlengthUnullUemptyU singletonUconsUsnocU replicateUreplicateEachUindexUheadUlastUappendUinitUrepeatUindexedUtoUfromUmapUfilterUpackUfoldlUfoldl1U foldl1MaybeUfoldU fold1MaybeUfold1UscanlUscanl1UscanUscan1UscanResU mapAccumLUzip3UzipWithU zipWith3Uunzip3UcombineUtailUdropUtakeUsplitAtU takeWhileU dropWhileUfindU findIndexUlookupUunfoldU enumFromToUenumFromToFracUenumFromThenToUenumFromStepLenUenumFromToEachUandUorUallUanyUsumUproductUmaximumU maximumByUminimumU minimumByUelemUnotElemU permuteMUatomicUpdateMUGHC.ReadRead readListPrecreadPrecreadList readsPrecshowsAppreadAppreadsAppcheck checkCriticalcheckLencheckEq checkNotEmpty uninitialisedemptyS singletonSconsS replicateSreplicateEachS+++indexSindexedSStreamheadStailStoStream fromStreammapSfilterSfoldSscanSzipWithSenumFromToFracSenumFromThenToSnullSsnocSinitStakeSdropSelemSlookupSfoldl1S fold1MaybeSscan1S mapAccumScombineS zipWith3SzipS enumFromToSenumFromStepLenSenumFromToEachSfindS findIndexS takeWhileS dropWhileSunfoldSerrorEmptyStream moduleErrorBoxStepYieldSkipDonelengthBU lengthMBUemptyBUsliceBUnewMBUunsafeFreezeMBUunsafeFreezeAllMBUstreamBU unstreamBU replicateBU extractBUmapBUfoldlBUfoldBUsumBUscanlBUscanBU extractMBUcopyMBUtoBUfromBUUAEBUArrhGetBUhPutBUsizeBUindexBUreadMBUwriteMBUMBUArr primLengthUnewDynU newDynResUUPrimmkUAPrimunUAPrim mkMUAPrim unMUAPrimlengthGHC.BaseInt takeWhile dropWhileNothinglookupeqUrepShere unstreamScan unstreamScanMpermuteU bpermuteU bpermuteDftUupdateUreverseU