on master help sign in
Twiddle docs.

--HG-- extra : convert_revision : 0c9734d422d158e41218d5fc8d6487594af5da62

commite99decfaa602d6a994b7883b833ff735a5327a73 authorBryan O'Sullivan <bos@serpentine.com> dateMon 23 Feb 2009, 01:14 (18 years ago) parent6c13c65
2 files changed+4−2
Data/Text/Internal.hs+2 Data/Text/Unsafe.hs+2−2
Data/Text/Internal.hs+2
@@ -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 ++ ' ' :
Data/Text/Unsafe.hs+2−2
@@ -1,11 +1,11 @@
11-- |
22-- Module : Data.Text.Unsafe
3−-- License : BSD-style
43-- Copyright : (c) Bryan O'Sullivan 2009
4+-- License : BSD-style
55-- Maintainer : bos@serpentine.com
66-- Stability : experimental
77-- Portability : portable
8−--
8+--
99-- A module containing unsafe 'Text' operations, for very very careful
1010-- use in heavily tested code.
1111module Data.Text.Unsafe