on master help sign in
Add an NFData instance.
4330bbfBryan O'Sullivan
Data/Text/Lazy.hs+5
@@ -168,6 +168,7 @@ import Prelude (Char, Bool(..), Maybe(..), String,
168 (&&), (+), (-), (.), ($), (++),
168 (&&), (+), (-), (.), ($), (++),
169 div, flip, fromIntegral, not, otherwise)
169 div, flip, fromIntegral, not, otherwise)
170import qualified Prelude as P
170import qualified Prelude as P
171+import Control.DeepSeq (NFData(..))
171import Data.Int (Int64)
172import Data.Int (Int64)
172import qualified Data.List as L
173import qualified Data.List as L
173import Data.Char (isSpace)
174import Data.Char (isSpace)
@@ -206,6 +207,10 @@ instance Monoid Text where
206instance IsString Text where
207instance IsString Text where
207 fromString = pack
208 fromString = pack
208
209
210+instance NFData Text where
211+ rnf Empty = ()
212+ rnf (Chunk _ ts) = rnf ts
213+
209-- | /O(n)/ Convert a 'String' into a 'Text'.
214-- | /O(n)/ Convert a 'String' into a 'Text'.
210--
215--
211-- This function is subject to array fusion.
216-- This function is subject to array fusion.