-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Infinite lists
--   
--   Modern lightweight library for infinite lists with fusion:
--   
--   <ul>
--   <li>API similar to <a>Data.List</a>.</li>
--   <li>No dependencies other than <a>base</a>.</li>
--   <li>Top performance, driven by fusion.</li>
--   <li>Avoid dangerous instances like <a>Foldable</a>.</li>
--   <li>Use <a>NonEmpty</a> where applicable.</li>
--   <li>Use <a>Word</a> for indices.</li>
--   <li>Be lazy, but not too lazy.</li>
--   </ul>
--   
--   <pre>
--   {-# LANGUAGE PostfixOperators #-}
--   import Data.List.Infinite (Infinite(..), (...), (....))
--   import qualified Data.List.Infinite as Inf
--   </pre>
@package infinite-list
@version 0.1.3


-- | Modern lightweight library for infinite lists with fusion:
--   
--   <ul>
--   <li>API similar to <a>Data.List</a>.</li>
--   <li>No dependencies other than <tt>base</tt>.</li>
--   <li>Top performance, driven by fusion.</li>
--   <li>Avoid dangerous instances like <a>Foldable</a>.</li>
--   <li>Use <a>NonEmpty</a> where applicable.</li>
--   <li>Use <a>Word</a> for indices.</li>
--   <li>Be lazy, but not too lazy.</li>
--   </ul>
--   
--   <pre>
--   {-# LANGUAGE PostfixOperators #-}
--   import Data.List.Infinite (Infinite(..), (...), (....))
--   import qualified Data.List.Infinite as Inf
--   </pre>
module Data.List.Infinite

-- | Type of infinite lists.
--   
--   In terms of recursion schemes, <a>Infinite</a> <tt>a</tt> is a fix
--   point of the base functor <tt>(a,)</tt>, <a>foldr</a> is a
--   catamorphism and <a>unfoldr</a> is an anamorphism.
data Infinite a
(:<) :: a -> Infinite a -> Infinite a
infixr 5 :<

-- | Get the first elements of an infinite list.
head :: Infinite a -> a

-- | Get the elements of an infinite list after the first one.
tail :: Infinite a -> Infinite a

-- | Split an infinite list into its <a>head</a> and <a>tail</a>.
uncons :: Infinite a -> (a, Infinite a)

-- | Convert to a list. Use <a>cycle</a> to go in the opposite direction.
toList :: Infinite a -> [a]

-- | Right-associative fold of an infinite list, necessarily lazy in the
--   accumulator. Any unconditional attempt to force the accumulator even
--   to the weak head normal form (WHNF) will hang the computation. E. g.,
--   the following definition isn't productive:
--   
--   <pre>
--   import Data.List.NonEmpty (NonEmpty(..))
--   toNonEmpty = foldr (\a (x :| xs) -&gt; a :| x : xs) :: Infinite a -&gt; NonEmpty a
--   </pre>
--   
--   One should use lazy patterns, e. g.,
--   
--   <pre>
--   toNonEmpty = foldr (\a ~(x :| xs) -&gt; a :| x : xs)
--   </pre>
--   
--   This is a catamorphism on infinite lists.
foldr :: (a -> b -> b) -> Infinite a -> b

-- | Apply a function to every element of an infinite list.
map :: (a -> b) -> Infinite a -> Infinite b

-- | Fold an infinite list from the left and return a list of successive
--   reductions, starting from the initial accumulator:
--   
--   <pre>
--   scanl f acc (x1 :&lt; x2 :&lt; ...) = acc :&lt; f acc x1 :&lt; f (f acc x1) x2 :&lt; ...
--   </pre>
scanl :: (b -> a -> b) -> b -> Infinite a -> Infinite b

-- | Same as <a>scanl</a>, but strict in accumulator.
scanl' :: (b -> a -> b) -> b -> Infinite a -> Infinite b

-- | Fold an infinite list from the left and return a list of successive
--   reductions, starting from the first element:
--   
--   <pre>
--   scanl1 f (x0 :&lt; x1 :&lt; x2 :&lt; ...) = x0 :&lt; f x0 x1 :&lt; f (f x0 x1) x2 :&lt; ...
--   </pre>
scanl1 :: (a -> a -> a) -> Infinite a -> Infinite a

-- | Fold an infinite list from the left and return a list of successive
--   reductions, keeping accumulator in a state:
--   
--   <pre>
--   mapAccumL f acc0 (x1 :&lt; x2 :&lt; ...) =
--     let (acc1, y1) = f acc0 x1 in
--       let (acc2, y2) = f acc1 x2 in
--         ...
--           y1 :&lt; y2 :&lt; ...
--   </pre>
--   
--   If you are looking how to traverse with a state, look no further.
mapAccumL :: (acc -> x -> (acc, y)) -> acc -> Infinite x -> Infinite y

-- | Same as <a>mapAccumL</a>, but strict in accumulator.
mapAccumL' :: (acc -> x -> (acc, y)) -> acc -> Infinite x -> Infinite y

-- | Map each element to an action, evaluate these actions from left to
--   right and ignore the results. Note that the return type is <a>Void</a>
--   instead of usual <tt>()</tt>.
--   
--   <pre>
--   &gt;&gt;&gt; traverse_ print (0...) -- hit Ctrl+C to terminate
--   0
--   1
--   2Interrupted
--   </pre>
--   
--   <a>traverse_</a> could be productive for some short-circuiting
--   <tt>f</tt>:
--   
--   <pre>
--   &gt;&gt;&gt; traverse_ (\x -&gt; if x &gt; 10 then Left x else Right ()) (0...)
--   Left 11
--   </pre>
traverse_ :: Applicative f => (a -> f ()) -> Infinite a -> f Void

-- | Flipped <a>traverse_</a>.
for_ :: Applicative f => Infinite a -> (a -> f ()) -> f Void

-- | Flatten out an infinite list of non-empty lists.
--   
--   The peculiar type with <a>NonEmpty</a> is to guarantee that
--   <a>concat</a> is productive and results in an infinite list. Otherwise
--   the concatenation of infinitely many <tt>[a]</tt> could still be a
--   finite list.
concat :: Infinite (NonEmpty a) -> Infinite a

-- | First <a>map</a> every element, then <a>concat</a>.
--   
--   The peculiar type with <a>NonEmpty</a> is to guarantee that
--   <a>concatMap</a> is productive and results in an infinite list.
--   Otherwise the concatenation of infinitely many <tt>[b]</tt> could
--   still be a finite list.
concatMap :: (a -> NonEmpty b) -> Infinite a -> Infinite b

-- | Insert an element between adjacent elements of an infinite list.
intersperse :: a -> Infinite a -> Infinite a

-- | Insert a non-empty list between adjacent elements of an infinite list,
--   and subsequently flatten it out.
--   
--   The peculiar type with <a>NonEmpty</a> is to guarantee that
--   <a>intercalate</a> is productive and results in an infinite list. If
--   separator is an empty list, concatenation of infinitely many
--   <tt>[a]</tt> could still be a finite list.
intercalate :: NonEmpty a -> Infinite [a] -> Infinite a

-- | Interleave two infinite lists.
interleave :: Infinite a -> Infinite a -> Infinite a

-- | Transpose rows and columns of an argument.
--   
--   This is actually <tt>distribute</tt> from <a><tt>Distributive</tt></a>
--   type class in disguise.
transpose :: Functor f => f (Infinite a) -> Infinite (f a)

-- | Generate an infinite list of all finite subsequences of the argument.
--   
--   <pre>
--   &gt;&gt;&gt; take 8 (subsequences (0...))
--   [[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]]
--   </pre>
subsequences :: Infinite a -> Infinite [a]

-- | Generate an infinite list of all non-empty finite subsequences of the
--   argument.
--   
--   <pre>
--   &gt;&gt;&gt; take 7 (subsequences1 (0...))
--   [0 :| [],1 :| [],0 :| [1],2 :| [],0 :| [2],1 :| [2],0 :| [1,2]]
--   </pre>
subsequences1 :: Infinite a -> Infinite (NonEmpty a)

-- | Generate an infinite list of all finite (such that only finite number
--   of elements change their positions) permutations of the argument.
--   
--   <pre>
--   &gt;&gt;&gt; take 6 (fmap (take 3) (permutations (0...)))
--   [[0,1,2],[1,0,2],[2,1,0],[1,2,0],[2,0,1],[0,2,1]]
--   </pre>
permutations :: Infinite a -> Infinite (Infinite a)

-- | Generate an infinite progression, starting from a given element,
--   similar to <tt>[x..]</tt>. For better user experience consider
--   enabling <tt>{-# LANGUAGE PostfixOperators #-}</tt>:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XPostfixOperators
--   
--   &gt;&gt;&gt; Data.List.Infinite.take 10 (0...)
--   [0,1,2,3,4,5,6,7,8,9]
--   </pre>
--   
--   Beware that for finite types <a>(...)</a> applies <a>cycle</a> atop of
--   <tt>[x..]</tt>:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XPostfixOperators
--   
--   &gt;&gt;&gt; Data.List.Infinite.take 10 (EQ...)
--   [EQ,GT,EQ,GT,EQ,GT,EQ,GT,EQ,GT]
--   </pre>
--   
--   Remember that <a>Int</a> is a finite type as well. One is unlikely to
--   hit this on a 64-bit architecture, but on a 32-bit machine it's fairly
--   possible to traverse <tt>((0 :: <a>Int</a>) ...)</tt> far enough to
--   encounter <tt>0</tt> again.
(...) :: Enum a => a -> Infinite a
infix 0 ...

-- | Generate an infinite arithmetic progression, starting from given
--   elements, similar to <tt>[x,y..]</tt>. For better user experience
--   consider enabling <tt>{-# LANGUAGE PostfixOperators #-}</tt>:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XPostfixOperators
--   
--   &gt;&gt;&gt; Data.List.Infinite.take 10 ((1,3)....)
--   [1,3,5,7,9,11,13,15,17,19]
--   </pre>
--   
--   Beware that for finite types <a>(....)</a> applies <a>cycle</a> atop
--   of <tt>[x,y..]</tt>:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XPostfixOperators
--   
--   &gt;&gt;&gt; Data.List.Infinite.take 10 ((EQ,GT)....)
--   [EQ,GT,EQ,GT,EQ,GT,EQ,GT,EQ,GT]
--   </pre>
--   
--   Remember that <a>Int</a> is a finite type as well: for a sufficiently
--   large step of progression <tt>y - x</tt> one may observe <tt>((x ::
--   Int, y)....)</tt> cycling back to emit <tt>x</tt> fairly soon.
(....) :: Enum a => (a, a) -> Infinite a
infix 0 ....

-- | Generate an infinite list of repeated applications.
iterate :: (a -> a) -> a -> Infinite a

-- | Same as <a>iterate</a>, but strict in accumulator.
iterate' :: (a -> a) -> a -> Infinite a

-- | Build an infinite list from a seed value.
--   
--   This is an anamorphism on infinite lists.
unfoldr :: (b -> (a, b)) -> b -> Infinite a

-- | Generate an infinite list of <tt>f</tt> 0, <tt>f</tt> 1, <tt>f</tt>
--   2...
--   
--   <a>tabulate</a> and <a>(!!)</a> witness that <a>Infinite</a> is
--   <a><tt>Representable</tt></a>.
tabulate :: (Word -> a) -> Infinite a

-- | Repeat the same element ad infinitum.
repeat :: a -> Infinite a

-- | Repeat a non-empty list ad infinitum. If you were looking for
--   something like <tt>fromList :: [a] -&gt; Infinite a</tt>, look no
--   further.
--   
--   It would be less annoying to take <tt>[a]</tt> instead of
--   <a>NonEmpty</a> <tt>a</tt>, but we strive to avoid partial functions.
cycle :: NonEmpty a -> Infinite a

-- | Prepend a list to an infinite list.
prependList :: [a] -> Infinite a -> Infinite a

-- | Take a prefix of given length.
take :: Int -> Infinite a -> [a]

-- | Drop a prefix of given length.
drop :: Int -> Infinite a -> Infinite a

-- | Split an infinite list into a prefix of given length and the rest.
splitAt :: Int -> Infinite a -> ([a], Infinite a)

-- | Take the longest prefix satisfying a predicate.
takeWhile :: (a -> Bool) -> Infinite a -> [a]

-- | Drop the longest prefix satisfying a predicate.
--   
--   This function isn't productive (e. g., <a>head</a> <a>.</a>
--   <a>dropWhile</a> <tt>f</tt> won't terminate), if all elements of the
--   input list satisfy the predicate.
dropWhile :: (a -> Bool) -> Infinite a -> Infinite a

-- | Split an infinite list into the longest prefix satisfying a predicate
--   and the rest.
--   
--   This function isn't productive in the second component of the tuple
--   (e. g., <a>head</a> <a>.</a> <a>snd</a> <a>.</a> <a>span</a>
--   <tt>f</tt> won't terminate), if all elements of the input list satisfy
--   the predicate.
span :: (a -> Bool) -> Infinite a -> ([a], Infinite a)

-- | Split an infinite list into the longest prefix <i>not</i> satisfying a
--   predicate and the rest.
--   
--   This function isn't productive in the second component of the tuple
--   (e. g., <a>head</a> <a>.</a> <a>snd</a> <a>.</a> <a>break</a>
--   <tt>f</tt> won't terminate), if no elements of the input list satisfy
--   the predicate.
break :: (a -> Bool) -> Infinite a -> ([a], Infinite a)

-- | Group consecutive equal elements.
group :: Eq a => Infinite a -> Infinite (NonEmpty a)

-- | Generate all prefixes of an infinite list.
--   
--   <pre>
--   &gt;&gt;&gt; :set -XPostfixOperators
--   
--   &gt;&gt;&gt; Data.List.Infinite.take 5 $ Data.List.Infinite.inits (0...)
--   [[],[0],[0,1],[0,1,2],[0,1,2,3]]
--   </pre>
--   
--   If you need reversed prefixes, they can be generated cheaper using
--   <a>scanl'</a>:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XPostfixOperators
--   
--   &gt;&gt;&gt; Data.List.Infinite.take 5 $ Data.List.Infinite.scanl' (flip (:)) [] (0...)
--   [[],[0],[1,0],[2,1,0],[3,2,1,0]]
--   </pre>
inits :: Infinite a -> Infinite [a]

-- | Generate all non-empty prefixes of an infinite list.
inits1 :: Infinite a -> Infinite (NonEmpty a)

-- | Generate all suffixes of an infinite list.
tails :: Infinite a -> Infinite (Infinite a)

-- | Check whether a list is a prefix of an infinite list.
isPrefixOf :: Eq a => [a] -> Infinite a -> Bool

-- | If a list is a prefix of an infinite list, strip it and return the
--   rest. Otherwise return <a>Nothing</a>.
stripPrefix :: Eq a => [a] -> Infinite a -> Maybe (Infinite a)

-- | Filter an infinite list, removing elements which does not satisfy a
--   predicate.
--   
--   This function isn't productive (e. g., <a>head</a> <a>.</a>
--   <a>filter</a> <tt>f</tt> won't terminate), if no elements of the input
--   list satisfy the predicate.
--   
--   A common objection is that since it could happen that no elements of
--   the input satisfy the predicate, the return type should be
--   <tt>[a]</tt> instead of <a>Infinite</a> <tt>a</tt>. This would not
--   however make <a>filter</a> any more productive. Note that such
--   hypothetical <a>filter</a> could not ever generate <tt>[]</tt>
--   constructor, only <tt>(:)</tt>, so we would just have a more lax type
--   gaining nothing instead. Same reasoning applies to other filtering /
--   partitioning / searching functions.
filter :: (a -> Bool) -> Infinite a -> Infinite a

-- | Find the first pair, whose first component is equal to the first
--   argument, and return the second component. If there is nothing to be
--   found, this function will hang indefinitely.
lookup :: Eq a => a -> Infinite (a, b) -> b

-- | Find the first element, satisfying a predicate. If there is nothing to
--   be found, this function will hang indefinitely.
find :: (a -> Bool) -> Infinite a -> a

-- | Apply a function to every element of an infinite list and collect
--   <a>Just</a> results.
--   
--   This function isn't productive (e. g., <a>head</a> <a>.</a>
--   <a>mapMaybe</a> <tt>f</tt> won't terminate), if no elements of the
--   input list result in <a>Just</a>.
mapMaybe :: (a -> Maybe b) -> Infinite a -> Infinite b

-- | Keep only <a>Just</a> elements.
--   
--   This function isn't productive (e. g., <a>head</a> <a>.</a>
--   <a>catMaybes</a> won't terminate), if no elements of the input list
--   are <a>Just</a>.
catMaybes :: Infinite (Maybe a) -> Infinite a

-- | Split an infinite list into two infinite lists: the first one contains
--   elements, satisfying a predicate, and the second one the rest.
--   
--   This function isn't productive in the first component of the tuple (e.
--   g., <a>head</a> <a>.</a> <a>fst</a> <a>.</a> <a>partition</a>
--   <tt>f</tt> won't terminate), if no elements of the input list satisfy
--   the predicate. Same for the second component, if all elements of the
--   input list satisfy the predicate.
partition :: (a -> Bool) -> Infinite a -> (Infinite a, Infinite a)

-- | Apply a function to every element of an infinite list and separate
--   <a>Left</a> and <a>Right</a> results.
--   
--   This function isn't productive (e. g., <a>head</a> <a>.</a> <a>fst</a>
--   <a>.</a> <a>mapEither</a> <tt>f</tt> won't terminate), if no elements
--   of the input list result in <a>Left</a> or <a>Right</a>.
mapEither :: (a -> Either b c) -> Infinite a -> (Infinite b, Infinite c)

-- | Separate <a>Left</a> and <a>Right</a> elements.
--   
--   This function isn't productive (e. g., <a>head</a> <a>.</a> <a>fst</a>
--   <a>.</a> <a>partitionEithers</a> won't terminate), if no elements of
--   the input list are <a>Left</a> or <a>Right</a>.
partitionEithers :: Infinite (Either a b) -> (Infinite a, Infinite b)

-- | Return <i>n</i>-th element of an infinite list. On contrary to
--   <tt>Data.List.</tt><a>!!</a>, this function takes <a>Word</a> instead
--   of <a>Int</a> to avoid <a>error</a> on negative arguments.
--   
--   If you are concerned that unsigned indices may accidentally underflow,
--   compile with <a><tt>-fno-ignore-asserts</tt></a>: there is an assert
--   checking that the index does not exceed <a>fromIntegral</a>
--   (<a>maxBound</a> :: <a>Int</a>).
--   
--   This is actually <tt>index</tt> from <a><tt>Representable</tt></a>
--   type class in disguise.
(!!) :: Infinite a -> Word -> a
infixl 9 !!

-- | Return an index of the first element, equal to a given. If there is
--   nothing to be found, this function will hang indefinitely.
elemIndex :: Eq a => a -> Infinite a -> Word

-- | Return indices of all elements, equal to a given.
--   
--   This function isn't productive (e. g., <a>head</a> <a>.</a>
--   <a>elemIndices</a> <tt>f</tt> won't terminate), if no elements of the
--   input list are equal the given one.
elemIndices :: Eq a => a -> Infinite a -> Infinite Word

-- | Return an index of the first element, satisfying a predicate. If there
--   is nothing to be found, this function will hang indefinitely.
findIndex :: (a -> Bool) -> Infinite a -> Word

-- | Return indices of all elements, satisfying a predicate.
--   
--   This function isn't productive (e. g., <a>head</a> <a>.</a>'
--   <a>findIndices</a> <tt>f</tt> won't terminate), if no elements of the
--   input list satisfy the predicate.
findIndices :: (a -> Bool) -> Infinite a -> Infinite Word

-- | Zip two infinite lists.
zip :: Infinite a -> Infinite b -> Infinite (a, b)

-- | Zip two infinite lists with a given function.
zipWith :: (a -> b -> c) -> Infinite a -> Infinite b -> Infinite c

-- | Zip three infinite lists.
zip3 :: Infinite a -> Infinite b -> Infinite c -> Infinite (a, b, c)

-- | Zip three infinite lists with a given function.
zipWith3 :: (a -> b -> c -> d) -> Infinite a -> Infinite b -> Infinite c -> Infinite d

-- | Zip four infinite lists.
zip4 :: Infinite a -> Infinite b -> Infinite c -> Infinite d -> Infinite (a, b, c, d)

-- | Zip four infinite lists with a given function.
zipWith4 :: (a -> b -> c -> d -> e) -> Infinite a -> Infinite b -> Infinite c -> Infinite d -> Infinite e

-- | Zip five infinite lists.
zip5 :: Infinite a -> Infinite b -> Infinite c -> Infinite d -> Infinite e -> Infinite (a, b, c, d, e)

-- | Zip five infinite lists with a given function.
zipWith5 :: (a -> b -> c -> d -> e -> f) -> Infinite a -> Infinite b -> Infinite c -> Infinite d -> Infinite e -> Infinite f

-- | Zip six infinite lists.
zip6 :: Infinite a -> Infinite b -> Infinite c -> Infinite d -> Infinite e -> Infinite f -> Infinite (a, b, c, d, e, f)

-- | Zip six infinite lists with a given function.
zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> Infinite a -> Infinite b -> Infinite c -> Infinite d -> Infinite e -> Infinite f -> Infinite g

-- | Zip seven infinite lists.
zip7 :: Infinite a -> Infinite b -> Infinite c -> Infinite d -> Infinite e -> Infinite f -> Infinite g -> Infinite (a, b, c, d, e, f, g)

-- | Zip seven infinite lists with a given function.
zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> Infinite a -> Infinite b -> Infinite c -> Infinite d -> Infinite e -> Infinite f -> Infinite g -> Infinite h

-- | Zip an <a>Infinite</a> with any <a>Traversable</a>, maintaining the
--   shape of the latter.
--   
--   <pre>
--   &gt;&gt;&gt; import Data.Functor.Compose (Compose(..))
--   
--   &gt;&gt;&gt; heteroZip (0...) (Compose [Just 10, Nothing, Just 20])
--   Compose [Just (0,10),Nothing,Just (1,20)]
--   </pre>
heteroZip :: Traversable t => Infinite a -> t b -> t (a, b)

-- | Use a given function to zip an <a>Infinite</a> with any
--   <a>Traversable</a>, maintaining the shape of the latter.
--   
--   <pre>
--   &gt;&gt;&gt; import Data.Functor.Compose (Compose(..))
--   
--   &gt;&gt;&gt; heteroZipWith (+) (0...) (Compose [Just 10, Nothing, Just 20])
--   Compose [Just 10,Nothing,Just 21]
--   </pre>
heteroZipWith :: Traversable t => (a -> b -> c) -> Infinite a -> t b -> t c

-- | Unzip an infinite list of tuples.
unzip :: Infinite (a, b) -> (Infinite a, Infinite b)

-- | Unzip an infinite list of triples.
unzip3 :: Infinite (a, b, c) -> (Infinite a, Infinite b, Infinite c)

-- | Unzip an infinite list of quadruples.
unzip4 :: Infinite (a, b, c, d) -> (Infinite a, Infinite b, Infinite c, Infinite d)

-- | Unzip an infinite list of quintuples.
unzip5 :: Infinite (a, b, c, d, e) -> (Infinite a, Infinite b, Infinite c, Infinite d, Infinite e)

-- | Unzip an infinite list of sextuples.
unzip6 :: Infinite (a, b, c, d, e, f) -> (Infinite a, Infinite b, Infinite c, Infinite d, Infinite e, Infinite f)

-- | Unzip an infinite list of septuples.
unzip7 :: Infinite (a, b, c, d, e, f, g) -> (Infinite a, Infinite b, Infinite c, Infinite d, Infinite e, Infinite f, Infinite g)

-- | Split an infinite string into lines, by <tt>\n</tt>. Empty lines are
--   preserved.
--   
--   In contrast to their counterparts from <a>Data.List</a>, it holds that
--   <a>unlines</a> <tt>.</tt> <a>lines</a> <tt>=</tt> <a>id</a>.
lines :: Infinite Char -> Infinite [Char]

-- | Split an infinite string into words, by any <a>isSpace</a> symbol.
--   Leading spaces are removed and, as underlined by the return type,
--   repeated spaces are treated as a single delimiter.
words :: Infinite Char -> Infinite (NonEmpty Char)

-- | Concatenate lines together with <tt>\n</tt>.
--   
--   In contrast to their counterparts from <a>Data.List</a>, it holds that
--   <a>unlines</a> <tt>.</tt> <a>lines</a> <tt>=</tt> <a>id</a>.
unlines :: Infinite [Char] -> Infinite Char

-- | Concatenate words together with a space.
--   
--   The function is meant to be a counterpart of with <a>words</a>. If you
--   need to concatenate together <a>Infinite</a>
--   <tt>[</tt><a>Char</a><tt>]</tt>, use <a>intercalate</a>
--   <tt>(</tt><a>pure</a> <tt>' ')</tt>.
unwords :: Infinite (NonEmpty Char) -> Infinite Char

-- | Remove duplicate from a list, keeping only the first occurrence of
--   each element. Because of a very weak constraint on <tt>a</tt>, this
--   operation takes <i>O</i>(<i>n</i>²) time. Consider using <a>nubOrd</a>
--   instead.
nub :: Eq a => Infinite a -> Infinite a

-- | Same as <a>nub</a>, but asymptotically faster, taking only
--   <i>O</i>(<i>n</i> log <i>n</i>) time.
nubOrd :: Ord a => Infinite a -> Infinite a

-- | Remove all occurrences of an element from an infinite list.
delete :: Eq a => a -> Infinite a -> Infinite a

-- | Take an infinite list and remove the first occurrence of every element
--   of a finite list.
(\\) :: Eq a => Infinite a -> [a] -> Infinite a

-- | Union of a finite and an infinite list. It contains the finite list as
--   a prefix and afterwards all non-duplicate elements of the infinite
--   list, which are not members of the finite list.
union :: Eq a => [a] -> Infinite a -> Infinite a

-- | Return all elements of an infinite list, which are simultaneously
--   members of a finite list.
intersect :: Eq a => Infinite a -> [a] -> Infinite a

-- | Insert an element at the first position where it is less than or equal
--   to the next one. If the input was sorted, the output remains sorted as
--   well.
insert :: Ord a => a -> Infinite a -> Infinite a

-- | Overloaded version of <a>nub</a>. Consider using <a>nubOrdBy</a>
--   instead.
nubBy :: (a -> a -> Bool) -> Infinite a -> Infinite a

-- | Overloaded version of <a>nubOrd</a>.
nubOrdBy :: (a -> a -> Ordering) -> Infinite a -> Infinite a

-- | Overloaded version of <a>delete</a>.
deleteBy :: (a -> b -> Bool) -> a -> Infinite b -> Infinite b

-- | Overloaded version of <a>(\\)</a>.
deleteFirstsBy :: (a -> b -> Bool) -> Infinite b -> [a] -> Infinite b

-- | Overloaded version of <a>union</a>.
unionBy :: (a -> a -> Bool) -> [a] -> Infinite a -> Infinite a

-- | Overloaded version of <a>intersect</a>.
intersectBy :: (a -> b -> Bool) -> Infinite a -> [b] -> Infinite a

-- | Overloaded version of <a>group</a>.
groupBy :: (a -> a -> Bool) -> Infinite a -> Infinite (NonEmpty a)

-- | Overloaded version of <a>insert</a>.
insertBy :: (a -> a -> Ordering) -> a -> Infinite a -> Infinite a

-- | Take a prefix of given length.
genericTake :: Integral i => i -> Infinite a -> [a]

-- | Drop a prefix of given length.
genericDrop :: Integral i => i -> Infinite a -> Infinite a

-- | Split an infinite list into a prefix of given length and the rest.
genericSplitAt :: Integral i => i -> Infinite a -> ([a], Infinite a)
instance GHC.Internal.Base.Applicative Data.List.Infinite.Internal.Infinite
instance GHC.Internal.Base.Functor Data.List.Infinite.Internal.Infinite
instance GHC.Internal.Control.Monad.Fix.MonadFix Data.List.Infinite.Internal.Infinite
instance GHC.Internal.Base.Monad Data.List.Infinite.Internal.Infinite
