Safe Haskell | None |
---|---|
Language | Haskell98 |
Template Haskell utils for declaring flags instances.
Documentation
dataBitsAsBoundedFlags :: Name -> Q [Dec] Source #
Produces Flags
and BoundedFlags
instances declarations for the specified instance of Bits
.
:: String | Wrapping type name. |
-> Name | Wrapped type name. |
-> [Name] | Types to derive automatically. |
-> [(String, Integer)] | Individual flags. |
-> Q [Dec] |
Declare a newtype wrapper around the specified integral type and make
it an instance of BoundedFlags
. For each individual
flag declare a constant. If a Show
instance wasn't requested for
automatic derivation, declare one with
show flags = "WrappingTypeName [IndividualFlags in flags]"