Commits

Bryan O'Sullivan committed 6e2ffba

Add an NFData instance.

Comments (0)

Files changed (1)

Data/Text/Lazy.hs

                 (&&), (+), (-), (.), ($), (++),
                 div, flip, fromIntegral, not, otherwise)
 import qualified Prelude as P
+import Control.DeepSeq (NFData(..))
 import Data.Int (Int64)
 import qualified Data.List as L
 import Data.Char (isSpace)
 instance IsString Text where
     fromString = pack
 
+instance NFData Text where
+    rnf Empty        = ()
+    rnf (Chunk _ ts) = rnf ts
+
 -- | /O(n)/ Convert a 'String' into a 'Text'.
 --
 -- This function is subject to array fusion.