-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Internals of "text-builder"
--   
--   Core functionality of "text-builder" with guts exposed for efficient
--   custom integrations.
--   
--   Consider this to be what you'll find in the "Internal" modules of
--   packages violating PVP. You'll find more on this in a blog
--   post.
@package text-builder-core
@version 0.1.1.1

module TextBuilderCore

-- | Composable specification of how to efficiently construct strict
--   Text.
--   
--   Provides instances of Semigroup and Monoid, which have
--   complexity of O(1).
data TextBuilder
TextBuilder :: Int -> (forall s. () => MArray s -> Int -> ST s Int) -> TextBuilder

-- | Check whether the builder is empty.
isEmpty :: TextBuilder -> Bool

-- | Execute the builder producing a strict text.
toText :: TextBuilder -> Text

-- | Construct from a list of characters.
string :: String -> TextBuilder

-- | Strict text.
text :: Text -> TextBuilder

-- | Lazy text.
lazyText :: Text -> TextBuilder

-- | Unicode character.
char :: Char -> TextBuilder

-- | Safe Unicode codepoint with invalid values replaced by the �
--   char (codepoint 0xfffd), which is the same as what
--   Data.Text.pack does.
unicodeCodepoint :: Int -> TextBuilder

-- | Helper for constructing from char producers a bit more efficiently
--   than via (text . fromString).
--   
--   
--   >>> unsafeChars 3 "123"
--   "123"
--   
--   
--   
--   >>> unsafeChars 4 "123"
--   "123"
--   
unsafeChars :: Int -> [Char] -> TextBuilder

-- | Provides a unified way to deal with the byte array regardless of the
--   version of the text library.
--   
--   Keep in mind that prior to text-2.0, the array was operating
--   on Word16 values due to the library abstracting over
--   UTF-16. Starting from text-2.0, the array operates
--   on Word8 values and the library abstracts over UTF-8.
--   
--   This function is useful for building ASCII values.
--   
--   
--   >>> unsafeSeptets 3 (fmap (+48) [1, 2, 3])
--   "123"
--   
--   
--   
--   >>> unsafeSeptets 4 (fmap (+48) [1, 2, 3])
--   "123"
--   
unsafeSeptets :: Int -> [Word8] -> TextBuilder

-- | Same as unsafeSeptets, but writes the bytes in reverse order
--   and requires the size to be precise.
--   
--   
--   >>> unsafeReverseSeptets 3 (fmap (+48) [1, 2, 3])
--   "321"
--   
unsafeReverseSeptets :: Int -> [Word8] -> TextBuilder
instance Test.QuickCheck.Arbitrary.Arbitrary TextBuilderCore.TextBuilder
instance GHC.Classes.Eq TextBuilderCore.TextBuilder
instance GHC.Internal.Data.String.IsString TextBuilderCore.TextBuilder
instance GHC.Internal.Base.Monoid TextBuilderCore.TextBuilder
instance GHC.Internal.Base.Semigroup TextBuilderCore.TextBuilder
instance GHC.Internal.Show.Show TextBuilderCore.TextBuilder
