Commit 601a5730 authored by Bodigrim's avatar Bodigrim
Browse files

Redesign concat

parent cdc80a84
......@@ -794,12 +794,10 @@ foldr1 f t = S.foldr1 f (stream t)
-- | /O(n)/ Concatenate a list of 'Text's.
concat :: [Text] -> Text
concat = to
where
go Empty css = to css
go (Chunk c cs) css = Chunk c (go cs css)
to [] = Empty
to (cs:css) = go cs css
concat [] = Empty
concat (Empty : css) = concat css
concat (Chunk c Empty : css) = Chunk c (concat css)
concat (Chunk c cs : css) = Chunk c (concat (cs : css))
{-# INLINE concat #-}
-- | /O(n)/ Map a function over a 'Text' that results in a 'Text', and
......
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