on master help sign in
Add an NFData instance.

--HG-- extra : convert_revision : fd48f0aedd42458f193fe54359bc33eb32314da3

commit4330bbfb5928849d48d03bbd940700d72b3b45ac authorBryan O'Sullivan <bos@serpentine.com> dateMon 30 Nov 2009, 06:45 (17 years ago) parente63b869
1 file changed+5
Data/Text/Lazy.hs+5
Data/Text/Lazy.hs+5
@@ -168,6 +168,7 @@ import Prelude (Char, Bool(..), Maybe(..), String,
168168 (&&), (+), (-), (.), ($), (++),
169169 div, flip, fromIntegral, not, otherwise)
170170import qualified Prelude as P
171+import Control.DeepSeq (NFData(..))
171172import Data.Int (Int64)
172173import qualified Data.List as L
173174import Data.Char (isSpace)
@@ -206,6 +207,10 @@ instance Monoid Text where
206207instance IsString Text where
207208 fromString = pack
208209
210+instance NFData Text where
211+ rnf Empty = ()
212+ rnf (Chunk _ ts) = rnf ts
213+
209214-- | /O(n)/ Convert a 'String' into a 'Text'.
210215--
211216-- This function is subject to array fusion.