@@ -39,6 +39,7 @@ data Text = Text
3939 {-# UNPACK #-} !Int -- length
4040 deriving (Typeable)
4141
42+-- | Smart constructor.
4243text :: A.Array Word16 -> Int -> Int -> Text
4344text arr off len =
4445 assert (len >= 0) .
@@ -55,6 +56,7 @@ empty :: Text
5556empty = Text A.empty 0 0
5657{-# INLINE [1] empty #-}
5758
59+-- | A useful 'show'-like function for debugging purposes.
5860showText :: Text -> String
5961showText (Text arr off len) =
6062 "Text " ++ (show . take (off+len) . A.toList) arr ++ ' ' :