byteset-0.1.1.1: Set of bytes.
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Types

data ByteSet Source #

Set of bytes (Word8). Note that NF and WHNF are equivalent for values of type ByteSet.

Instances

Instances details
Generic ByteSet Source # 
Instance details

Defined in Data.ByteSet

Associated Types

type Rep ByteSet :: Type -> Type #

Methods

from :: ByteSet -> Rep ByteSet x #

to :: Rep ByteSet x -> ByteSet #

Show ByteSet Source # 
Instance details

Defined in Data.ByteSet

Binary ByteSet Source # 
Instance details

Defined in Data.ByteSet

Methods

put :: ByteSet -> Put #

get :: Get ByteSet #

putList :: [ByteSet] -> Put #

Eq ByteSet Source # 
Instance details

Defined in Data.ByteSet

Methods

(==) :: ByteSet -> ByteSet -> Bool #

(/=) :: ByteSet -> ByteSet -> Bool #

Ord ByteSet Source # 
Instance details

Defined in Data.ByteSet

type Rep ByteSet Source # 
Instance details

Defined in Data.ByteSet

data Word8 #

8-bit unsigned integer type

Instances

Instances details
Bits Word8

Since: base-2.1

Instance details

Defined in GHC.Word

FiniteBits Word8

Since: base-4.6.0.0

Instance details

Defined in GHC.Word

Bounded Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Enum Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Ix Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Num Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Integral Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Real Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Methods

toRational :: Word8 -> Rational #

Show Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Methods

showsPrec :: Int -> Word8 -> ShowS #

show :: Word8 -> String #

showList :: [Word8] -> ShowS #

Binary Word8 
Instance details

Defined in Data.Binary.Class

Methods

put :: Word8 -> Put #

get :: Get Word8 #

putList :: [Word8] -> Put #

Eq Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Methods

(==) :: Word8 -> Word8 -> Bool #

(/=) :: Word8 -> Word8 -> Bool #

Ord Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Methods

compare :: Word8 -> Word8 -> Ordering #

(<) :: Word8 -> Word8 -> Bool #

(<=) :: Word8 -> Word8 -> Bool #

(>) :: Word8 -> Word8 -> Bool #

(>=) :: Word8 -> Word8 -> Bool #

max :: Word8 -> Word8 -> Word8 #

min :: Word8 -> Word8 -> Word8 #

Lift Word8 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => Word8 -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Word8 -> Code m Word8 #

Query

null :: ByteSet -> Bool Source #

O(1). Is the byteset empty?

size :: ByteSet -> Int Source #

O(1). Cardinality of the byteset.

member :: Word8 -> ByteSet -> Bool Source #

O(1). Is the value a member of the byteset?

notMember :: Word8 -> ByteSet -> Bool Source #

O(1). Is the element not in the set?

Construction

empty :: ByteSet Source #

O(1). The empty byteset.

singleton :: Word8 -> ByteSet Source #

O(1). A byteset of one element.

insert :: Word8 -> ByteSet -> ByteSet Source #

O(1). Add a value to the byteset.

delete :: Word8 -> ByteSet -> ByteSet Source #

O(1). Delete a byte in the byteset. Returns the original byteset when the byte was not present.

Combine

union :: ByteSet -> ByteSet -> ByteSet Source #

O(1). The union of two bytesets.

unions :: [ByteSet] -> ByteSet Source #

The union of a list of bytesets. Just a fold over the list using union.

difference :: ByteSet -> ByteSet -> ByteSet Source #

O(1). Difference between two bytesets.

intersection :: ByteSet -> ByteSet -> ByteSet Source #

O(1). The intersection of two bytesets.

Filter

filter :: (Word8 -> Bool) -> ByteSet -> ByteSet Source #

O(n). Filter all elements that satisfy some predicate.

Map

map :: (Word8 -> Word8) -> ByteSet -> ByteSet Source #

O(n). Map a function over a byteset.

Folds

foldr :: (Word8 -> a -> a) -> a -> ByteSet -> a Source #

O(n). Fold the elements in the byteset using the given right-associative binary operator.

List conversion

elems :: ByteSet -> [Word8] Source #

O(n). The elements of a byteset in ascending order.

toList :: ByteSet -> [Word8] Source #

O(n). An alias of elems.

fromList :: [Word8] -> ByteSet Source #

O(n). Create a byteset from a list of bytes.