Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.ByteSet
Description
Inspired in the Data.IntSet
API, a similar API where the elements
of the set are bytes (values of type Word8
).
Synopsis
- data ByteSet
- data Word8
- null :: ByteSet -> Bool
- size :: ByteSet -> Int
- member :: Word8 -> ByteSet -> Bool
- notMember :: Word8 -> ByteSet -> Bool
- empty :: ByteSet
- singleton :: Word8 -> ByteSet
- insert :: Word8 -> ByteSet -> ByteSet
- delete :: Word8 -> ByteSet -> ByteSet
- union :: ByteSet -> ByteSet -> ByteSet
- unions :: [ByteSet] -> ByteSet
- difference :: ByteSet -> ByteSet -> ByteSet
- intersection :: ByteSet -> ByteSet -> ByteSet
- filter :: (Word8 -> Bool) -> ByteSet -> ByteSet
- map :: (Word8 -> Word8) -> ByteSet -> ByteSet
- foldr :: (Word8 -> a -> a) -> a -> ByteSet -> a
- elems :: ByteSet -> [Word8]
- toList :: ByteSet -> [Word8]
- fromList :: [Word8] -> ByteSet
Types
Instances
8-bit unsigned integer type
Instances
Data Word8 | Since: base-4.0.0.0 |
Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word8 -> c Word8 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word8 # dataTypeOf :: Word8 -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word8) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word8) # gmapT :: (forall b. Data b => b -> b) -> Word8 -> Word8 # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word8 -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word8 -> r # gmapQ :: (forall d. Data d => d -> u) -> Word8 -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word8 -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word8 -> m Word8 # | |
Storable Word8 | Since: base-2.1 |
Bits Word8 | Since: base-2.1 |
Defined in GHC.Word Methods (.&.) :: Word8 -> Word8 -> Word8 # (.|.) :: Word8 -> Word8 -> Word8 # xor :: Word8 -> Word8 -> Word8 # complement :: Word8 -> Word8 # shift :: Word8 -> Int -> Word8 # rotate :: Word8 -> Int -> Word8 # setBit :: Word8 -> Int -> Word8 # clearBit :: Word8 -> Int -> Word8 # complementBit :: Word8 -> Int -> Word8 # testBit :: Word8 -> Int -> Bool # bitSizeMaybe :: Word8 -> Maybe Int # shiftL :: Word8 -> Int -> Word8 # unsafeShiftL :: Word8 -> Int -> Word8 # shiftR :: Word8 -> Int -> Word8 # unsafeShiftR :: Word8 -> Int -> Word8 # rotateL :: Word8 -> Int -> Word8 # | |
FiniteBits Word8 | Since: base-4.6.0.0 |
Defined in GHC.Word Methods finiteBitSize :: Word8 -> Int # countLeadingZeros :: Word8 -> Int # countTrailingZeros :: Word8 -> Int # | |
Bounded Word8 | Since: base-2.1 |
Enum Word8 | Since: base-2.1 |
Ix Word8 | Since: base-2.1 |
Num Word8 | Since: base-2.1 |
Read Word8 | Since: base-2.1 |
Integral Word8 | Since: base-2.1 |
Real Word8 | Since: base-2.1 |
Defined in GHC.Word Methods toRational :: Word8 -> Rational # | |
Show Word8 | Since: base-2.1 |
PrintfArg Word8 | Since: base-2.1 |
Defined in Text.Printf | |
Binary Word8 | |
NFData Word8 | |
Defined in Control.DeepSeq | |
Eq Word8 | Since: base-2.1 |
Ord Word8 | Since: base-2.1 |
Lift Word8 | |
Query
Construction
delete :: Word8 -> ByteSet -> ByteSet Source #
O(1). Delete a byte in the byteset. Returns the original byteset when the byte was not present.
Combine
unions :: [ByteSet] -> ByteSet Source #
The union of a list of bytesets. Just a fold over the list using union
.
Filter
filter :: (Word8 -> Bool) -> ByteSet -> ByteSet Source #
O(n). Filter all elements that satisfy some predicate.
Map
Folds
foldr :: (Word8 -> a -> a) -> a -> ByteSet -> a Source #
O(n). Fold the elements in the byteset using the given right-associative binary operator.