Commit 8f02baac authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Remove Data.List.NonEmpty.{words,unwords,lines,unlines}

This change mirrors the change that occured for the recent
`semigroups-0.18` release, i.e.

  https://github.com/ekmett/semigroups/commit/7a000212847b0d309892f34e4754a25ddec7100b

This removal addresses concerns raised in #10365
parent e2a78eec
......@@ -85,11 +85,6 @@ module Data.List.NonEmpty (
, zip -- :: NonEmpty a -> NonEmpty b -> NonEmpty (a,b)
, zipWith -- :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c
, unzip -- :: NonEmpty (a, b) -> (NonEmpty a, NonEmpty b)
-- * Functions on streams of characters
, words -- :: NonEmpty Char -> NonEmpty String
, unwords -- :: NonEmpty String -> NonEmpty Char
, lines -- :: NonEmpty Char -> NonEmpty String
, unlines -- :: NonEmpty String -> NonEmpty Char
-- * Converting to and from a list
, fromList -- :: [a] -> NonEmpty a
, toList -- :: NonEmpty a -> [a]
......@@ -100,10 +95,10 @@ module Data.List.NonEmpty (
import Prelude hiding (break, cycle, drop, dropWhile,
filter, foldl, foldr, head, init, iterate,
last, length, lines, map, repeat, reverse,
last, length, map, repeat, reverse,
scanl, scanl1, scanr, scanr1, span,
splitAt, tail, take, takeWhile, unlines,
unwords, unzip, words, zip, zipWith, (!!))
splitAt, tail, take, takeWhile,
unzip, zip, zipWith, (!!))
import qualified Prelude
import Control.Applicative (Alternative, many)
......@@ -462,32 +457,6 @@ zipWith f ~(x :| xs) ~(y :| ys) = f x y :| List.zipWith f xs ys
unzip :: Functor f => f (a,b) -> (f a, f b)
unzip xs = (fst <$> xs, snd <$> xs)
-- | The 'words' function breaks a stream of characters into a
-- stream of words, which were delimited by white space.
--
-- /Beware/: if the input contains no words (i.e. is entirely
-- whitespace), this will cause an error.
words :: NonEmpty Char -> NonEmpty String
words = lift List.words
-- | The 'unwords' function is an inverse operation to 'words'. It
-- joins words with separating spaces.
--
-- /Beware/: the input @(\"\" :| [])@ will cause an error.
unwords :: NonEmpty String -> NonEmpty Char
unwords = lift List.unwords
-- | The 'lines' function breaks a stream of characters into a stream
-- of strings at newline characters. The resulting strings do not
-- contain newlines.
lines :: NonEmpty Char -> NonEmpty String
lines = lift List.lines
-- | The 'unlines' function is an inverse operation to 'lines'. It
-- joins lines, after appending a terminating newline to each.
unlines :: NonEmpty String -> NonEmpty Char
unlines = lift List.unlines
-- | The 'nub' function removes duplicate elements from a list. In
-- particular, it keeps only the first occurence of each element.
-- (The name 'nub' means \'essence\'.)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment