on master help sign in
Export 'foldrChunks' and 'foldlChunks'; add 'toStrict' and 'fromStrict' utility functions.

--HG-- extra : convert_revision : 0caf66e0da9e66b8515c4647c9032b373bb0ff1c

commit7b94bbce339e841c8235b669c75ecd79232bf53b authorJohn Millikin <jmillikin@gmail.com> dateSun 15 Aug 2010, 17:22 (16 years ago) parentfdd934c
1 file changed+12
Data/Text/Lazy.hs+12
Data/Text/Lazy.hs+12
@@ -39,6 +39,10 @@ module Data.Text.Lazy
3939 , empty
4040 , fromChunks
4141 , toChunks
42+ , toStrict
43+ , fromStrict
44+ , foldrChunks
45+ , foldlChunks
4246
4347 -- * Basic interface
4448 , cons
@@ -268,6 +272,14 @@ fromChunks cs = L.foldr chunk Empty cs
268272toChunks :: Text -> [T.Text]
269273toChunks cs = foldrChunks (:) [] cs
270274
275+toStrict :: Text -> T.Text
276+toStrict t = T.concat (toChunks t)
277+{-# INLINE [1] toStrict #-}
278+
279+fromStrict :: T.Text -> Text
280+fromStrict t = Chunk t Empty
281+{-# INLINE [1] fromStrict #-}
282+
271283cons :: Char -> Text -> Text
272284cons c t = Chunk (T.singleton c) t
273285{-# INLINE [1] cons #-}