storable-enum
Version 0.0 revision 0 uploaded by HenningThielemann.
Package meta
- Synopsis
- Wrapper that makes any Enum type Storable
- Description
In foreign function interfaces you will often want to use enumeration types but defining Storable instances is cumbersome. This package provides the type
Enum.Storable.T w e
, where e.g.Enum.Storable.T Word8 Ordering
means that values of type Ordering are stored in a Word8. The Storable methods store the numeric values of the enumeration elements as obtained by fromEnum. E.g. EQ is stored as1
. The type itself stores a Haskell enumeration element, such that GHC can apply all of its optimizations for enumerations. It is not checked, whether the storage typew
is large enough to hold all admissible numeric values ofe
. It is also not checked, whether the storage typew
supports negative values whenever the enumeration ofe
contains ones.See the
bool8
package for the special case of a Bool stored in a Word8.- Author
- Henning Thielemann
- Bug reports
- n/a
- Category
- Foreign
- Copyright
- n/a
- Homepage
- n/a
- Maintainer
- haskell@henning-thielemann.de
- Package URL
- n/a
- Stability
- Stable