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


-- | ttoparsec-internal
--   
--   A fast parser combinator library, aimed particularly at dealing
--   efficiently with network protocols and complicated text/binary file
--   formats.
@package attoparsec:attoparsec-internal
@version 0.14.4


-- | Fast set membership tests for <a>Word8</a> and 8-bit <a>Char</a>
--   values. The set representation is unboxed for efficiency. For small
--   sets, we test for membership using a binary search. For larger sets,
--   we use a lookup table.
module Data.Attoparsec.ByteString.FastSet
data FastSet
fromList :: [Word8] -> FastSet

-- | Create a set.
set :: ByteString -> FastSet

-- | Check the set for membership. Only works with 8-bit characters:
--   characters above code point 255 will give wrong answers.
memberChar :: Char -> FastSet -> Bool

-- | Check the set for membership.
memberWord8 :: Word8 -> FastSet -> Bool
fromSet :: FastSet -> ByteString
charClass :: String -> FastSet
instance GHC.Classes.Eq Data.Attoparsec.ByteString.FastSet.FastSet
instance GHC.Classes.Ord Data.Attoparsec.ByteString.FastSet.FastSet
instance GHC.Internal.Show.Show Data.Attoparsec.ByteString.FastSet.FastSet

module Data.Attoparsec.Internal.Compat
withPS :: ByteString -> (ForeignPtr Word8 -> Int -> Int -> r) -> r
mkPS :: ForeignPtr Word8 -> Int -> Int -> ByteString

module Data.Attoparsec.Internal.Fhthagn

-- | Just like unsafePerformIO, but we inline it. Big performance gains as
--   it exposes lots of things to further inlining. <i>Very unsafe</i>. In
--   particular, you should do no memory allocation inside an
--   <a>inlinePerformIO</a> block. On Hugs this is just
--   <tt>unsafePerformIO</tt>.
inlinePerformIO :: IO a -> a


-- | An "immutable" buffer that supports cheap appends.
--   
--   A Buffer is divided into an immutable read-only zone, followed by a
--   mutable area that we've preallocated, but not yet written to.
--   
--   We overallocate at the end of a Buffer so that we can cheaply append.
--   Since a user of an existing Buffer cannot see past the end of its
--   immutable zone into the data that will change during an append, this
--   is safe.
--   
--   Once we run out of space at the end of a Buffer, we do the usual
--   doubling of the buffer size.
--   
--   The fact of having a mutable buffer really helps with performance, but
--   it does have a consequence: if someone misuses the Partial API that
--   attoparsec uses by calling the same continuation repeatedly (which
--   never makes sense in practice), they could overwrite data.
--   
--   Since the API *looks* pure, it should *act* pure, too, so we use two
--   generation counters (one mutable, one immutable) to track the number
--   of appends to a mutable buffer. If the counters ever get out of sync,
--   someone is appending twice to a mutable buffer, so we duplicate the
--   entire buffer in order to preserve the immutability of its older self.
--   
--   While we could go a step further and gain protection against API abuse
--   on a multicore system, by use of an atomic increment instruction to
--   bump the mutable generation counter, that would be very expensive, and
--   feels like it would also be in the realm of the ridiculous. Clients
--   should never call a continuation more than once; we lack a linear type
--   system that could enforce this; and there's only so far we should go
--   to accommodate broken uses.
module Data.Attoparsec.ByteString.Buffer
data Buffer

-- | The initial <a>Buffer</a> has no mutable zone, so we can avoid all
--   copies in the (hopefully) common case of no further input being fed to
--   us.
buffer :: ByteString -> Buffer
unbuffer :: Buffer -> ByteString
pappend :: Buffer -> ByteString -> Buffer
length :: Buffer -> Int
unsafeIndex :: Buffer -> Int -> Word8
substring :: Int -> Int -> Buffer -> ByteString
unsafeDrop :: Int -> Buffer -> ByteString
instance GHC.Internal.Base.Monoid Data.Attoparsec.ByteString.Buffer.Buffer
instance GHC.Internal.Base.Semigroup Data.Attoparsec.ByteString.Buffer.Buffer
instance GHC.Internal.Show.Show Data.Attoparsec.ByteString.Buffer.Buffer


-- | An immutable buffer that supports cheap appends.
module Data.Attoparsec.Text.Buffer
data Buffer

-- | The initial <a>Buffer</a> has no mutable zone, so we can avoid all
--   copies in the (hopefully) common case of no further input being fed to
--   us.
buffer :: Text -> Buffer
unbuffer :: Buffer -> Text
unbufferAt :: Int -> Buffer -> Text
length :: Buffer -> Int
pappend :: Buffer -> Text -> Buffer

-- | <i>O(1)</i> Iterate (unsafely) one step forwards through a UTF-8
--   array, returning the current character and the delta to add to give
--   the next offset to iterate at.
iter :: Buffer -> Int -> Iter

-- | <i>O(1)</i> Iterate one step through a UTF-8 array, returning the
--   delta to add to give the next offset to iterate at.
iter_ :: Buffer -> Int -> Int
substring :: Int -> Int -> Buffer -> Text
lengthCodeUnits :: Text -> Int
dropCodeUnits :: Int -> Buffer -> Text
instance GHC.Internal.Base.Monoid Data.Attoparsec.Text.Buffer.Buffer
instance GHC.Internal.Base.Semigroup Data.Attoparsec.Text.Buffer.Buffer
instance GHC.Internal.Show.Show Data.Attoparsec.Text.Buffer.Buffer


-- | Fast set membership tests for <a>Char</a> values. We test for
--   membership using a hashtable implemented with Robin Hood collision
--   resolution. The set representation is unboxed, and the characters and
--   hashes interleaved, for efficiency.
module Data.Attoparsec.Text.FastSet
data FastSet
fromList :: String -> FastSet
set :: Text -> FastSet

-- | Check the set for membership.
member :: Char -> FastSet -> Bool
charClass :: String -> FastSet
