From: Henning T. <le...@he...> - 2012-09-25 09:11:03
|
I don't know whether I proposed it already ... I wrote a package called enumset. It provides low-level bitsets like they are used by wxWidget. The definition is essentially: newtype EnumSet storage index = EnumSet storage E.g. with data Style = Bold | Italic | Underlined deriving (Enum) the type (EnumSet Word32 Style) represents a subset of {Bold, Italic, Underlined} stored as a bitfield in a Word32. http://hackage.haskell.org/packages/archive/enumset/0.0.4/doc/html/Data-EnumSet.html The other modules can be used to manage bitfields where not individual bits must be processed, but there are groups of bits, where each group represents a value. |