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
Generic ByteSet Source # | |
Show ByteSet Source # | |
Binary ByteSet Source # | |
Eq ByteSet Source # | |
Ord ByteSet Source # | |
type Rep ByteSet Source # | |
Defined in Data.ByteSet type Rep ByteSet = D1 ('MetaData "ByteSet" "Data.ByteSet" "byteset-0.1.1.2-5re0gYwUF1B8ICFpYS57ET" 'False) (C1 ('MetaCons "ByteSet" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word64) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word64)))) |
8-bit unsigned integer type
Instances
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.