Commit eb3962b5 authored by Bodigrim's avatar Bodigrim Committed by Xia Li-yao
Browse files

Remove our own definition of intersperse (it matches since base-4.4)

See ghc/ghc#4282
parent 4132111d
......@@ -230,7 +230,6 @@ import qualified Prelude as P
import Data.Text.Unsafe (Iter(..), iter, iter_, lengthWord16, reverseIter,
reverseIter_, unsafeHead, unsafeTail)
import Data.Text.Internal.Unsafe.Char (unsafeChr)
import qualified Data.Text.Internal.Functions as F
import qualified Data.Text.Internal.Encoding.Utf16 as U16
import Data.Text.Internal.Search (indices)
#if defined(__HADDOCK__)
......@@ -622,7 +621,7 @@ map f t = unstream (S.map (safe . f) (stream t))
-- >>> T.intercalate "NI!" ["We", "seek", "the", "Holy", "Grail"]
-- "WeNI!seekNI!theNI!HolyNI!Grail"
intercalate :: Text -> [Text] -> Text
intercalate t = concat . (F.intersperse t)
intercalate t = concat . L.intersperse t
{-# INLINE intercalate #-}
-- | /O(n)/ The 'intersperse' function takes a character and places it
......
......@@ -17,7 +17,6 @@
module Data.Text.Internal.Functions
(
intersperse,
unsafeWithForeignPtr
) where
......@@ -29,16 +28,6 @@ import qualified GHC.ForeignPtr (unsafeWithForeignPtr)
import qualified Foreign.ForeignPtr (withForeignPtr)
#endif
-- | A lazier version of Data.List.intersperse. The other version
-- causes space leaks!
intersperse :: a -> [a] -> [a]
intersperse _ [] = []
intersperse sep (x:xs) = x : go xs
where
go [] = []
go (y:ys) = sep : y: go ys
{-# INLINE intersperse #-}
unsafeWithForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b
#if MIN_VERSION_base(4,15,0)
unsafeWithForeignPtr = GHC.ForeignPtr.unsafeWithForeignPtr
......
......@@ -223,7 +223,6 @@ import Data.Text.Internal.Lazy (Text(..), chunk, empty, foldlChunks,
foldrChunks, smallChunkSize)
import Data.Text.Internal (firstf, safe, text)
import Data.Text.Lazy.Encoding (decodeUtf8', encodeUtf8)
import qualified Data.Text.Internal.Functions as F
import Data.Text.Internal.Lazy.Search (indices)
import qualified GHC.CString as GHC
import qualified GHC.Exts as Exts
......@@ -568,7 +567,7 @@ map f t = unstream (S.map (safe . f) (stream t))
-- 'Text's and concatenates the list after interspersing the first
-- argument between each element of the list.
intercalate :: Text -> [Text] -> Text
intercalate t = concat . (F.intersperse t)
intercalate t = concat . L.intersperse t
{-# INLINE intercalate #-}
-- | /O(n)/ The 'intersperse' function takes a character and places it
......
Supports Markdown
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