The storable-record package

[Tags: bsd3, library]

With this package you can build a Storable instance of a record type from Storable instances of its elements in an elegant way. It does not do any magic, just a bit arithmetic to compute the right offsets, that would be otherwise done manually or by a preprocessor like C2HS. I cannot promise that the generated memory layout is compatible with that of a corresponding C struct. However, the module generates the smallest layout that is possible with respect to the alignment of the record elements. If you encounter, that a record does not have a compatible layout, we should fix that. But also without C compatibility this package is useful e.g. in connection with StorableVector.

We provide Storable instance support for several cases:

Note however that the Storable instances defined with this package are quite slow in (up to) GHC-6.12.1. I'm afraid this is due to incomplete inlining, but we have still to investigate the problem.

For examples see packages storable-tuple and sample-frame.


Properties

Versions0.0.1, 0.0.2, 0.0.2.1, 0.0.2.2, 0.0.2.3, 0.0.2.4, 0.0.2.5, 0.0.3
Dependenciesbase (>=1.0 && <2), special-functors (==1.0.*), transformers (>=0.2 && <0.4), utility-ht (>=0.0.1 && <0.1) or
base (>=3 && <6), transformers (>=0.2 && <0.4), utility-ht (>=0.0.1 && <0.1)
LicenseBSD3
AuthorHenning Thielemann <storable@henning-thielemann.de>
MaintainerHenning Thielemann <storable@henning-thielemann.de>
StabilityExperimental
CategoryData, Foreign
Home pagehttp://code.haskell.org/~thielema/storable-record/
Source repositoryhead: darcs get http://code.haskell.org/~thielema/storable-record/
this: darcs get http://code.haskell.org/~thielema/storable-record/ --tag 0.0.2.5
Executablesstorable-record-speed
Upload dateTue Apr 10 19:30:49 UTC 2012
Uploaded byHenningThielemann
DistributionsNixOS:0.0.3
Downloads2053 total (157 in last 30 days)

Modules

[Index]

Flags

NameDescriptionDefault
splitbaseChoose the new smaller, split-up base package.Enabled
buildtestsBuild speed testDisabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees