ڏ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~portable provisionalEdward Kmett <ekmett@gmail.com>Extract the focused element )Move the head of the zipper to the right (Move the head of the zipper to the left KCons before the head of the zipper. The head now points to the new element UMove the head of the zipper one step to the right, returning the value we move over. Interleave two Zippers xs and ys, alternating elements  from each list. ; [x1,x2,...] `interleave` [y1,y2,...] == [x1,y1,x2,y2,...]  interleave = (<>)   y xs" creates an alternating stream of  elements from xs and y.  4 computes the transposition of a stream of streams.   n xs drops the first n elements off the front of  the sequence xs.  n xs- returns a pair consisting of the prefix of  xs of length n1 and the remaining stream immediately following  this prefix. Beware8: passing a negative integer as the first argument will 0 cause an error if you access the taken portion  p xs* returns the longest prefix of the stream  xs for which the predicate p holds.  p xs$ returns the suffix remaining after   p xs. Beware0: this function may diverge if every element of xs  satisfies p, e.g. dropWhile even (repeat 0) will loop.  p xs returns the longest prefix of xs that satisfies  p-, together with the remainder of the stream. The  p function is equivalent to  not . p. The isPrefix function returns True if the first argument is  a prefix of the second. xs !! n# returns the element of the stream xs at index  n0. Note that the head of the stream has index 0. Beware>: passing a negative integer as the first argument will cause  an error. The 5 function takes a predicate and a stream and returns L the index of the first element in the stream that satisfies the predicate, Beware:  p xs) will diverge if none of the elements of  xs satisfy p. /Internal helper, used to find an index in the The 1 function returns the index of the first element ( in the given stream which is equal (by ) to the query element, Beware:  x xs& will diverge if none of the elements  of xs equal x. The 2 function takes two streams and returns a list of  corresponding pairs.  zip = liftA2 (,) The  function generalizes . Rather than tupling = the functions, the elements are combined using the function ! passed as the first argument to .  zipWith = liftA2 The  function is the inverse of the  function.    portable provisionalEdward Kmett <ekmett@gmail.com>%O(1) cons O(1) !O(1). "#O(1). $O(log n). %O(log n). &O(log n). '()*+,-./0 !"#$%&'()*+,-./0% !"#$&'()*+-./0, !"#$%&'()*+,-./0portable provisionalEdward Kmett <ekmett@gmail.com>*12345O(log n) 67O(1) 8O(log n). 9O(1) cons :;O(1) <O(1). =>O(log n). ?O(1). @O(log n). AO(log n). BCDEFGHIJKL123456789:;<=>?@ABCDEFGHIJKL1329:8;<=>?@AB67DCEF45IJLKGH13223456789:;<=>?@ABCDEFGHIJKLportable provisionalEdward Kmett <ekmett@gmail.com> MNOPQRSTUVW MNOPQRSTUVW MONQPRTSUVW MONNOPQRSTUVWportable provisionalEdward Kmett <ekmett@gmail.com>2XYZ[\](Extract the first element of the stream ^.Extract the possibly empty tail of the stream _'Extract the last element of the stream `9Extract everything except the last element of the stream acons onto a stream bcSort a stream d(Converts an non-empty list to a stream. e'Convert a stream to a list efficiently "Lift list operations to work on a X stream fmap a function over a X stream gThe g function takes a stream xs and returns all the  finite prefixes of xs. hThe h function takes a stream xs and returns all the  suffixes of xs. ii an item into a X jj is similar to %, but returns a stream of successive  reduced values from the left:  D scanl f z [x1, x2, ...] == z :| [z `f` x1, (z `f` x1) `f` x2, ...]  Note that & last (scanl f z xs) == foldl f z xs. kk is the right-to-left dual of j.  Note that & head (scanr f z xs) == foldr f z xs. ll is a variant of j& that has no starting value argument: F scanl1 f [x1, x2, ...] == x1 :| [x1 `f` x2, x1 `f` (x2 `f` x3), ...] mm is a variant of k& that has no starting value argument. noo f x produces the infinite sequence  of repeated applications of f to x. % iterate f x = [x, f x, f (f x), ..] pp xs$ returns the infinite repetition of xs: & cycle [1,2,3] = 1 :| [2,3,1,2,3,...] qq a finite NonEmpty rr x3 returns a constant stream, where all elements are  equal to x. ss n xs returns the first n elements of xs. Beware8: passing a negative integer as the first argument will  cause an error. tt n xs drops the first n elements off the front of  the sequence xs. Beware8: passing a negative integer as the first argument will  cause an error. uu n xs, returns a pair consisting of the prefix of xs  of length n= and the remaining stream immediately following this prefix. Beware8: passing a negative integer as the first argument will  cause an error. vv p xs* returns the longest prefix of the stream  xs for which the predicate p holds. ww p xs$ returns the suffix remaining after  v p xs. xx p xs returns the longest prefix of xs that satisfies  p-, together with the remainder of the stream. yThe y p function is equivalent to x not . p. zz p xs, removes any elements from xs that do not satisfy p. {The { function takes a predicate p and a stream  xs>, and returns a pair of streams. The first stream corresponds  to the elements of xs for which p holds; the second stream  corresponds to the elements of xs for which p does not hold. |The |1 function takes a stream and returns a stream of A lists such that flattening the resulting stream is equal to the ; argument. Moreover, each sublist in the resulting stream - contains only equal elements. For example, b group $ cycle "Mississippi" = "M" : "i" : "ss" : "i" : "ss" : "i" : "pp" : "i" : "M" : "i" : ... }~The isPrefix function returns True if the first argument is  a prefix of the second. xs !! n# returns the element of the stream xs at index  n0. Note that the head of the stream has index 0. Beware>: passing a negative integer as the first argument will cause  an error. The 2 function takes two streams and returns a list of  corresponding pairs. The  function generalizes . Rather than tupling = the functions, the elements are combined using the function ! passed as the first argument to . The  function is the inverse of the  function. The / function breaks a stream of characters into a 7 stream of words, which were delimited by white space. The % function is an inverse operation to . It % joins words with separating spaces. The 4 function breaks a stream of characters into a list @ of strings at newline characters. The resulting strings do not  contain newlines. The % function is an inverse operation to . It = joins lines, after appending a terminating newline to each. 1XYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~1XYfnjklm]^_`ab\cqghorpZistuvwxyz{|}~de[1XYYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~portable (Haskell 2010) provisionalEdward Kmett <ekmett@gmail.com>+"Map a pure function over a stream +Extract the first element of the sequence. 7Extract the sequence following the head of the stream. The  function takes a stream xs and returns all the  suffixes of xs.  x3 returns a constant stream, where all elements are  equal to x. =The unfold function is similar to the unfold for lists. Note 6 there is no base case: all streams must be infinite. Interleave two Streams xs and ys, alternating elements  from each list. ; [x1,x2,...] `interleave` [y1,y2,...] == [x1,y1,x2,y2,...] The  function takes a stream xs and returns all the  finite prefixes of xs. Note that this  is lazier then Data.List.inits:   inits _|_ = [] ::: _|_  while for Data.List.inits:  inits _|_ = _|_  y xs" creates an alternating stream of  elements from xs and y. 4 yields a stream of successive reduced values from: B scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...] 4 yields a stream of successive reduced values from: B scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]  is a variant of & that has no starting value argument: 0 scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...] scanl1' is a strict  that has no starting value. 4 computes the transposition of a stream of streams.  f x produces the infinite sequence  of repeated applications of f to x. % iterate f x = [x, f x, f (f x), ..]  xs$ returns the infinite repetition of xs: < cycle [1,2,3] = Cons 1 (Cons 2 (Cons 3 (Cons 1 (Cons 2 ...  n xs returns the first n elements of xs. Beware8: passing a negative integer as the first argument will  cause an error.  n xs drops the first n elements off the front of  the sequence xs. Beware8: passing a negative integer as the first argument will  cause an error.  n xs- returns a pair consisting of the prefix of  xs of length n1 and the remaining stream immediately following  this prefix. Beware8: passing a negative integer as the first argument will  cause an error.  p xs* returns the longest prefix of the stream  xs for which the predicate p holds.  p xs$ returns the suffix remaining after   p xs. Beware0: this function may diverge if every element of xs  satisfies p, e.g. dropWhile even (repeat 0) will loop.  p xs returns the longest prefix of xs that satisfies  p-, together with the remainder of the stream. The  p function is equivalent to  not . p.  p xs, removes any elements from xs that do not satisfy p. Beware6: this function may diverge if there is no element of  xs that satisfies p, e.g. filter odd (repeat 0) will loop. The  function takes a predicate p and a stream  xs>, and returns a pair of streams. The first stream corresponds  to the elements of xs for which p holds; the second stream  corresponds to the elements of xs for which p does not hold. Beware9: One of the elements of the tuple may be undefined. For  example, +fst (partition even (repeat 0)) == repeat 0 ; on the  other hand snd (partition even (repeat 0)) is undefined. The 1 function takes a stream and returns a stream of A lists such that flattening the resulting stream is equal to the ; argument. Moreover, each sublist in the resulting stream - contains only equal elements. For example, v group $ cycle "Mississippi" = "M" ::: "i" ::: "ss" ::: "i" ::: "ss" ::: "i" ::: "pp" ::: "i" ::: "M" ::: "i" ::: ... The isPrefix function returns True if the first argument is  a prefix of the second. xs !! n# returns the element of the stream xs at index  n0. Note that the head of the stream has index 0. Beware>: passing a negative integer as the first argument will cause  an error. The 1 function returns the index of the first element ( in the given stream which is equal (by ) to the query element, Beware:  x xs& will diverge if none of the elements  of xs equal x. The  function extends , by returning the I indices of all elements equal to the query element, in ascending order. Beware:  x xs will diverge if any suffix of  xs does not contain x. The 5 function takes a predicate and a stream and returns L the index of the first element in the stream that satisfies the predicate, Beware:  p xs) will diverge if none of the elements of  xs satisfy p. The  function extends , by returning the @ indices of all elements satisfying the predicate, in ascending  order. Beware:  p xs" will diverge if all the elements  of any suffix of xs fails to satisfy p. The 2 function takes two streams and returns a list of  corresponding pairs. The  function generalizes . Rather than tupling = the functions, the elements are combined using the function ! passed as the first argument to . The  function is the inverse of the  function. The / function breaks a stream of characters into a 7 stream of words, which were delimited by white space. Beware: if the stream of characters xs does not contain white  space, accessing the tail of words xs will loop. The % function is an inverse operation to . It % joins words with separating spaces. The 4 function breaks a stream of characters into a list @ of strings at newline characters. The resulting strings do not  contain newlines. Beware: if the stream of characters xs does not contain + newline characters, accessing the tail of lines xs will loop. The % function is an inverse operation to . It = joins lines, after appending a terminating newline to each. The  converts an infinite list to a  stream. Beware.: Passing a finite list, will cause an error. ***portable provisionalEdward Kmett <ekmett@gmail.com> &equivalent to inits sans the initial [] context      !"#$%&'()*+,-./0123%4&'56(7)*+,8-./012365(9):;<=7>6?,@9A(-BCDEFG %HIJKLM!"#NOPQ$R9(%<ABSDTFGHIJ UV!"#NOPQ,$2(WCB<%XYZ2[\]^_@`abcdef[\]^_g@`hbcdefijkKl streams-0.2&Data.Stream.Infinite.Functional.ZipperData.Stream.Infinite.SkewData.Stream.Future.SkewData.Stream.FutureData.Stream.NonEmptyData.Stream.InfiniteData.Stream.BranchingbaseGHC.ListreverseZipper:~ toSequenceheadtailuntail<|uncons interleave intersperse transposetakedropsplitAt takeWhile dropWhilespanbreak isPrefixOf!! findIndex elemIndexzipzipWithunzipStreamrepeatindexedfromtailsindexsplitsplitWfromListinsertinsertByadjustupdateFuture:<Last replicatelengthconslasttoFuturemapNonEmpty:|unfoldnonEmptyinitsorttoListinitsscanlscanrscanl1scanr1iteratecyclefilter partitiongroupgroupBygroup1groupBy1wordsunwordslinesunlines:>scanl'scanl1' elemIndices findIndicesinits1 findIndex' GHC.Classes==CompleteBinTipbinweight mapWithIndextabulate indexComplete dropComplete splitCompletesplitCompleteWadjustComplete extendTree singletonlift Data.Foldablefoldl