binary-enum-0.1.2.0: Simple wrappers around enum types

Safe HaskellSafe
LanguageHaskell2010

Data.Binary.Enum

Synopsis

Documentation

newtype BitMap t a Source

we can store Enum values inside values we know how to store, so let

Constructors

BitMap [a]

Map lets you encode flags compressing distinct eg. packing 8 diferent flags per byte

Instances

(Enum a, Enum t, Eq a, Eq t, Num t) => Enum (BitMap t a) Source 
Show a => Show (BitMap t a) Source 
(Enum a, Eq a, Eq t, Integral t, Binary t) => Binary (BitMap t a) Source 

newtype BitEnc t a Source

Constructors

BitEnc a

t is a store type, you will need to make sure that your enum fits there eg. you want to store Bool as Word64 field `BitEnc Word64 Bool`

Instances

(Enum a, Enum t, Binary t) => Enum (BitEnc t a) Source 
Show a => Show (BitEnc t a) Source 
(Enum a, Enum t, Binary t) => Binary (BitEnc t a) Source