on master help sign in
Fix definition of length: forgot surrogate pairs
cf427a5Bryan O'Sullivan
Data/Text.hs+2−9
@@ -305,15 +305,8 @@ null t = S.null (stream t)
305-- | /O(n)/ Returns the number of characters in a 'Text'.
305-- | /O(n)/ Returns the number of characters in a 'Text'.
306-- Subject to array fusion.
306-- Subject to array fusion.
307length :: Text -> Int
307length :: Text -> Int
308−length (Text _arr _off len) = len
308+length length t = S.length (stream t)
309−{-# INLINE [1] length #-}
309+{-# INLINE 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− #-}
317
310
318-- -----------------------------------------------------------------------------
311-- -----------------------------------------------------------------------------
319-- * Transformations
312-- * Transformations