storable-enum: Wrapper that makes any Enum type Storable

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

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 as 1. 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 type w is large enough to hold all admissible numeric values of e. It is also not checked, whether the storage type w supports negative values whenever the enumeration of e contains ones.

See the bool8 package for the special case of a Bool stored in a Word8.


Versions 0.0, 0.0
Change log None available
Dependencies base (>=3 && <5), prelude-compat (>=0.0 && <0.0.1) [details]
License BSD-3-Clause
Author Henning Thielemann
Category Foreign
Source repo this: darcs get --tag 0.0
head: darcs get
Uploaded by HenningThielemann at 2019-10-08T15:50:51Z


[Index] [Quick Jump]


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees