enumset-0.0.3: Sets of enumeration values represented by machine words

Data.EnumSet.PackedEnum

Description

Extract and inject an Enum value into an EnumSet.

Synopsis

Documentation

data T w a b Source

T w a b describes a contiguous set of bit indices into the word type w where the indices are of type a and the set of indices represent a value of type b.

Constructors

Cons w Int 

unpack :: (Integral w, Bits w, Enum a, Enum b) => T w a b -> T w a -> bSource

Extract an enumeration value from the specified index set.

pack :: (Bits w, Enum a, Enum b) => T w a b -> b -> T w aSource

Create an enumeration set, where an value of type b is placed at the specified indices.

clear :: (Bits w, Enum a, Enum b) => T w a b -> T w a -> T w aSource

Clear all bits at the specified indices.

put :: (Bits w, Enum a, Enum b) => T w a b -> b -> T w a -> T w aSource

Overwrite an enumset at the specified indices with the value of type b.