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


-- | Set of bytes.
--   
--   Data structure for sets of bytes, where bytes are <tt>Word8</tt>
--   values.
@package byteset
@version 0.1.1.0


-- | Inspired in the <tt>Data.IntSet</tt> API, a similar API where the
--   elements of the set are bytes (values of type <a>Word8</a>).
module Data.ByteSet

-- | Set of bytes (<a>Word8</a>). Note that NF and WHNF are equivalent for
--   values of type <a>ByteSet</a>.
data ByteSet

-- | 8-bit unsigned integer type
data Word8 :: *

-- | <i>O(1)</i>. Is the byteset empty?
null :: ByteSet -> Bool

-- | <i>O(1)</i>. Cardinality of the byteset.
size :: ByteSet -> Int

-- | <i>O(1)</i>. Is the value a member of the byteset?
member :: Word8 -> ByteSet -> Bool

-- | <i>O(1)</i>. Is the element not in the set?
notMember :: Word8 -> ByteSet -> Bool

-- | <i>O(1)</i>. The empty byteset.
empty :: ByteSet

-- | <i>O(1)</i>. A byteset of one element.
singleton :: Word8 -> ByteSet

-- | <i>O(1)</i>. Add a value to the byteset.
insert :: Word8 -> ByteSet -> ByteSet

-- | <i>O(1)</i>. Delete a byte in the byteset. Returns the original
--   byteset when the byte was not present.
delete :: Word8 -> ByteSet -> ByteSet

-- | <i>O(1)</i>. The union of two bytesets.
union :: ByteSet -> ByteSet -> ByteSet

-- | The union of a list of bytesets. Just a fold over the list using
--   <a>union</a>.
unions :: [ByteSet] -> ByteSet

-- | <i>O(1)</i>. Difference between two bytesets.
difference :: ByteSet -> ByteSet -> ByteSet

-- | <i>O(1)</i>. The intersection of two bytesets.
intersection :: ByteSet -> ByteSet -> ByteSet

-- | <i>O(n)</i>. Filter all elements that satisfy some predicate.
filter :: (Word8 -> Bool) -> ByteSet -> ByteSet

-- | <i>O(n)</i>. Map a function over a byteset.
map :: (Word8 -> Word8) -> ByteSet -> ByteSet

-- | <i>O(n)</i>. Fold the elements in the byteset using the given
--   right-associative binary operator.
foldr :: (Word8 -> a -> a) -> a -> ByteSet -> a

-- | <i>O(n)</i>. The elements of a byteset in ascending order.
elems :: ByteSet -> [Word8]

-- | <i>O(n)</i>. An alias of <a>elems</a>.
toList :: ByteSet -> [Word8]

-- | <i>O(n)</i>. Create a byteset from a list of bytes.
fromList :: [Word8] -> ByteSet
instance GHC.Generics.Generic Data.ByteSet.ByteSet
instance GHC.Classes.Ord Data.ByteSet.ByteSet
instance GHC.Classes.Eq Data.ByteSet.ByteSet
instance GHC.Show.Show Data.ByteSet.ByteSet
instance Data.Binary.Class.Binary Data.ByteSet.ByteSet
