@@ -288,7 +288,17 @@ uncons (Text arr off len)
288 n = A.unsafeIndex arr (off+1)
288 n = A.unsafeIndex arr (off+1)
289{-# INLINE uncons #-}
289{-# INLINE uncons #-}
291+second :: (b -> c) -> (a,b) -> (a,c)
292+second f (a, b) = (a, f b)
295+"TEXT uncons -> fused" [~1] forall t.
296+ uncons t = fmap (second unstream) (S.uncons (stream t))
297+"TEXT uncons -> unfused" [1] forall t.
298+ fmap (second unstream) (S.uncons (stream t)) = uncons t
291−-- | /O(n)/ Returns the last character of a 'Text', which must be
301+-- | /O(1)/ Returns the last character of a 'Text', which must be
292-- non-empty. Subject to array fusion.
302-- non-empty. Subject to array fusion.
293last :: Text -> Char
303last :: Text -> Char
294last (Text arr off len)
304last (Text arr off len)