c-storable-deriving-0.1.3: Generate C-like storable instances from datatypes

Safe HaskellSafe
LanguageHaskell98

Foreign.CStorable

Description

This primarily exports the CStorable typeclass, which may have its methods automatically defaulted if it has a Generic instance. Then, this instance can be transfered via the Storable constructor.

Synopsis

Documentation

class CStorable a where Source #

This typeclass is basically just a duplicate of Storable. It exists because I can't easily modify Storable, as it is part of base.

Methods

cPeek :: Ptr a -> IO a Source #

cPeek :: (Generic a, GCStorable (Rep a)) => Ptr a -> IO a Source #

cPoke :: Ptr a -> a -> IO () Source #

cPoke :: (Generic a, GCStorable (Rep a)) => Ptr a -> a -> IO () Source #

cAlignment :: a -> Int Source #

cAlignment :: (Generic a, GCStorable (Rep a)) => a -> Int Source #

cSizeOf :: a -> Int Source #

cSizeOf :: (Generic a, GCStorable (Rep a)) => a -> Int Source #

Instances

Storable a => CStorable (StorableWrap a) Source #

Translates a Storable instance to a CStorable instance

newtype StorableWrap a Source #

Applying the Storable constructor to something which is Storable gives it a corresponding CStorable instance.

Constructors

Storable a 

Instances

Storable a => CStorable (StorableWrap a) Source #

Translates a Storable instance to a CStorable instance