summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2015-10-31 21:55:26 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2015-10-31 21:55:26 +0100
commit8f02baac9ea3d8cf8dfbadd2bc3af799ddbc0367 (patch)
treed57795ca6fb026bae03ab63ade95fac9c436105a /libraries
parente2a78eec37ccabea9c1269fd408a0e692d9c927f (diff)
downloadhaskell-8f02baac9ea3d8cf8dfbadd2bc3af799ddbc0367.tar.gz
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
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/Data/List/NonEmpty.hs37
1 files changed, 3 insertions, 34 deletions
diff --git a/libraries/base/Data/List/NonEmpty.hs b/libraries/base/Data/List/NonEmpty.hs
index d8bad07c7b..9bcdcbfeba 100644
--- a/libraries/base/Data/List/NonEmpty.hs
+++ b/libraries/base/Data/List/NonEmpty.hs
@@ -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\'.)