on master help sign in
Fix definition of length: forgot surrogate pairs

--HG-- extra : convert_revision : e097713823e472a6b85bd07ca9f724ad5eebaddf

commitcf427a519c4c6ddd017403c9ed85fb3f6c43a126 authorBryan O'Sullivan <bos@serpentine.com> dateWed 21 Jan 2009, 06:05 (18 years ago) parent12dcc57
1 file changed+2−9
Data/Text.hs+2−9
Data/Text.hs+2−9
@@ -305,15 +305,8 @@ null t = S.null (stream t)
305305-- | /O(n)/ Returns the number of characters in a 'Text'.
306306-- Subject to array fusion.
307307length :: Text -> Int
308−length (Text _arr _off len) = len
309−{-# INLINE [1] length #-}
310−
311−{-# RULES
312−"TEXT length -> fused" [~1] forall t.
313− length t = S.length (stream t)
314−"TEXT length -> unfused" [1] forall t.
315− S.length (stream t) = length t
316− #-}
308+length length t = S.length (stream t)
309+{-# INLINE length #-}
317310
318311-- -----------------------------------------------------------------------------
319312-- * Transformations