úÎìwÑe      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdportable provisionalEdward Kmett <ekmett@gmail.com> Safe-Inferred2< produces a new stream by repeatedly applying the unfolding : function to the seed value to produce an element of type b and a new 2 seed value. When the unfolding function returns e instead of $ a new seed value, the stream ends. ( efficiently turns a normal list into a  stream,  producing e if the input is empty. ? produces the first element of the stream, and a stream of the  remaining elements, if any. )Extract the first element of the stream. /Extract the possibly-empty tail of the stream. (Extract the last element of the stream. :Extract everything except the last element of the stream. !"Prepend an element to the stream. " Synonym for !. #Sort a stream. $Converts a normal list to a  stream. (Raises an error if given an empty list. %/Convert a stream to a normal list efficiently. f"Lift list operations to work on a  stream. Beware2: If the provided function returns an empty list,  this will raise an error. &Map a function over a  stream. 'The ' function takes a stream xs and returns all the  finite prefixes of xs. (The ( function takes a stream xs and returns all the  suffixes of xs. )) x xs inserts x into the last position in xs where it H is still less than or equal to the next element. In particular, if the < list is sorted beforehand, the result will also be sorted. ** is similar to g%, 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. ++ is the right-to-left dual of *.  Note that & head (scanr f z xs) == foldr f z xs. ,, is a variant of *& that has no starting value argument: F scanl1 f [x1, x2, ...] == x1 :| [x1 `f` x2, x1 `f` (x2 `f` x3), ...] -- is a variant of +& that has no starting value argument. .'intersperse x xs'0 alternates elements of the list with copies of x. . intersperse 0 (1 :| [2,3]) == 1 :| [0,2,0,3] // f x produces the infinite sequence  of repeated applications of f to x. ' iterate f x = x :| [f x, f (f x), ..] 00 xs$ returns the infinite repetition of xs: & cycle [1,2,3] = 1 :| [2,3,1,2,3,...] 11 a finite NonEmpty stream. 22 x3 returns a constant stream, where all elements are  equal to x. 33 n xs returns the first n elements of xs. 44 n xs drops the first n elements off the front of  the sequence xs. 55 n xs, returns a pair consisting of the prefix of xs  of length n= and the remaining stream immediately following this prefix. . 'splitAt' n xs == ('take' n xs, 'drop' n xs) 0 xs == ys ++ zs where (ys, zs) = 'splitAt' n xs 66 p xs* returns the longest prefix of the stream  xs for which the predicate p holds. 77 p xs$ returns the suffix remaining after  6 p xs. 88 p xs returns the longest prefix of xs that satisfies  p-, together with the remainder of the stream. 5 'span' p xs == ('takeWhile' p xs, 'dropWhile' p xs) - xs == ys ++ zs where (ys, zs) = 'span' p xs 9The 9 p function is equivalent to 8 (not . p). :: p xs removes any elements from xs that do not satisfy p. ;The ; function takes a predicate p and a stream  xsA, and returns a pair of lists. The first list corresponds to the  elements of xs for which p& holds; the second corresponds to the  elements of xs for which p does not hold. ; 'partition' p xs = ('filter' p xs, 'filter' (not . p) xs) <The </ function takes a stream and returns a list of A streams such that flattening the resulting list is equal to the 8 argument. Moreover, each stream in the resulting list ? contains only equal elements. For example, in list notation: f 'group' $ 'cycle' "Mississippi" = "M" : "i" : "ss" : "i" : "ss" : "i" : "pp" : "i" : "M" : "i" : ... == operates like <!, but uses the provided equality  predicate instead of h. >> operates like <", but uses the knowledge that its < input is non-empty to produce guaranteed non-empty output. ?? is to > as = is to <. @The isPrefix function returns True if the first argument is  a prefix of the second. Axs !! n# returns the element of the stream xs at index  n0. Note that the head of the stream has index 0. Beware9: a negative or out-of-bounds index will cause an error. BThe B4 function takes two streams and returns a stream of  corresponding pairs. CThe C function generalizes B. Rather than tupling < the elements, the elements are combined using the function  passed as the first argument. DThe D function is the inverse of the B function. EThe E/ function breaks a stream of characters into a 7 stream of words, which were delimited by white space. Beware3: if the input contains no words (i.e. is entirely ( whitespace), this will cause an error. FThe F% function is an inverse operation to E. It % joins words with separating spaces. Beware : the input ("" :| []) will cause an error. GThe G6 function breaks a stream of characters into a stream @ of strings at newline characters. The resulting strings do not  contain newlines. HThe H% function is an inverse operation to G. It = joins lines, after appending a terminating newline to each. IThe I5 function removes duplicate elements from a list. In @ particular, it keeps only the first occurence of each element.  (The name I means 'essence'.)  It is a special case of J!, which allows the programmer to # supply their own inequality test. JThe J function behaves just like I, except it uses a < user-supplied equality predicate instead of the overloaded h  function. ; !"#$%f&'()*+,-./0123456789:;<=>?@ABCDEFGHIJijklm5 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJ5&.*+,- !"#1'(/20)3456789:;<=>?@IJABCDEFGH$%: !"#$%f&'()*+,-./0123456789:;<=>?@ABCDEFGHIJijklmportable provisionalEdward Kmett <ekmett@gmail.com> Trustworthy KOption is effectively n with a better instance of , built off of an underlying ]  instead of an underlying F. Ideally, this type would not exist at all and we would just fix the  intance of n N-Provide a Semigroup for an arbitrary Monoid. QUse K (Q a) to get the behavior of  from  Data.Monoid TUse K (T a) to get the behavior of  from  Data.Monoid. ^An associative operation.   (a <> b) <> c = a <> (b <> c) If a is also a  we further require  (<>) = mappend _Reduce a non-empty list with <> XThe default definition should be sufficient, but this can be overridden for efficiency. `Repeat a value (n + 1) times.  7 times1p n a = a <> a <> ... <> a -- using <> n times UThe default definition uses peasant multiplication, exploiting associativity to only  require O(log n) uses of <>.  See also times. aA generalization of  to an arbitrary ]. ; May fail to terminate for some values in some semigroups. bRepeat a value n times.  9 times n a = a <> a <> ... <> a -- using <> (n-1) times Implemented using `. cFold an K case-wise, just like o. d@This lets you use a difference list of a Semigroup as a Monoid. IKLMNOPQRSTUVWXYZ[\]^_`abcdpqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œž0 KLMNOPQRSTUVWXYZ[\]^_`abcd0]^_`Z[\WXYTUVQRSNOPb   KLMcda:KLMNOPQRSTUVWXYZ[\]^_`abcdpqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMMNOPQRSTTUVVWXYZ[\]^_`abcdefghijkl`m`nopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžsemigroups-0.10Data.SemigroupData.List.NonEmpty Data.MonoidLastFirst Data.ListcyclebasemconcatmappendmemptyMonoidgetDualDualappEndoEndogetAllAllgetAnyAnygetSumSum getProductProductNonEmpty:|lengthxorunfoldnonEmptyunconsheadtaillastinit<|conssortfromListtoListmapinitstailsinsertscanlscanrscanl1scanr1 intersperseiteratereverserepeattakedropsplitAt takeWhile dropWhilespanbreakfilter partitiongroupgroupBygroup1groupBy1 isPrefixOf!!zipzipWithunzipwordsunwordslinesunlinesnubnubByOption getOption WrappedMonoid WrapMonoid unwrapMonoidgetLastgetFirstMaxgetMaxMingetMin Semigroup<>sconcattimes1pcycle1timesNoptiondiff Data.MaybeNothinglift Data.Foldablefoldlghc-prim GHC.Classes==$fFoldableNonEmpty$fTraversableNonEmpty$fMonadNonEmpty$fApplicativeNonEmpty$fFunctorNonEmptyMaybemaybe$fSemigroupMap$fSemigroupIntMap$fSemigroupSet$fSemigroupIntSet$fSemigroupSeq$fMonoidOption$fSemigroupOption$fTraversableOption$fFoldableOption$fMonadFixOption$fMonadPlusOption$fAlternativeOption $fMonadOption$fApplicativeOption$fFunctorOption$fMonoidWrappedMonoid$fSemigroupWrappedMonoid$fSemigroupHashMap$fSemigroupText$fSemigroupText0$fSemigroupByteString$fSemigroupByteString0$fSemigroupLast$fSemigroupFirst $fMonoidMax$fSemigroupMax $fMonoidMin$fSemigroupMin$fSemigroupNonEmpty$fSemigroupLast0$fSemigroupFirst0$fSemigroupProduct$fSemigroupSum$fSemigroupAny$fSemigroupAll$fSemigroupEndo$fSemigroupDual$fSemigroupOrdering$fSemigroup(,,,,)$fSemigroup(,,,)$fSemigroup(,,)$fSemigroup(,)$fSemigroupEither$fSemigroupMaybe $fSemigroup[]$fSemigroup(->) $fSemigroup()