gstorable-0.1.0.3: Generic implementation of Storable

Safe HaskellSafe
LanguageHaskell98

Foreign.Storable.Generic

Contents

Synopsis

Generic Storable class

class GStorable f where Source #

Generic Storable class

Minimal complete definition

gsizeOf, gpeek, gpoke

Methods

gsizeOf :: f a -> Int Source #

galignment :: f a -> Int Source #

gpeek :: Ptr (f a) -> IO (f a) Source #

gpeekByteOff :: Ptr (f a) -> Int -> IO (f a) Source #

gpeekElemOff :: Ptr (f a) -> Int -> IO (f a) Source #

gpoke :: Ptr (f a) -> f a -> IO () Source #

gpokeByteOff :: Ptr (f a) -> Int -> f a -> IO () Source #

gpokeElemOff :: Ptr (f a) -> Int -> f a -> IO () Source #

Instances

GStorable (U1 *) Source # 

Methods

gsizeOf :: U1 * a -> Int Source #

galignment :: U1 * a -> Int Source #

gpeek :: Ptr (U1 * a) -> IO (U1 * a) Source #

gpeekByteOff :: Ptr (U1 * a) -> Int -> IO (U1 * a) Source #

gpeekElemOff :: Ptr (U1 * a) -> Int -> IO (U1 * a) Source #

gpoke :: Ptr (U1 * a) -> U1 * a -> IO () Source #

gpokeByteOff :: Ptr (U1 * a) -> Int -> U1 * a -> IO () Source #

gpokeElemOff :: Ptr (U1 * a) -> Int -> U1 * a -> IO () Source #

Storable a => GStorable (K1 * i a) Source # 

Methods

gsizeOf :: K1 * i a a -> Int Source #

galignment :: K1 * i a a -> Int Source #

gpeek :: Ptr (K1 * i a a) -> IO (K1 * i a a) Source #

gpeekByteOff :: Ptr (K1 * i a a) -> Int -> IO (K1 * i a a) Source #

gpeekElemOff :: Ptr (K1 * i a a) -> Int -> IO (K1 * i a a) Source #

gpoke :: Ptr (K1 * i a a) -> K1 * i a a -> IO () Source #

gpokeByteOff :: Ptr (K1 * i a a) -> Int -> K1 * i a a -> IO () Source #

gpokeElemOff :: Ptr (K1 * i a a) -> Int -> K1 * i a a -> IO () Source #

(GStorable a, GStorable b) => GStorable ((:+:) * a b) Source # 

Methods

gsizeOf :: (* :+: a) b a -> Int Source #

galignment :: (* :+: a) b a -> Int Source #

gpeek :: Ptr ((* :+: a) b a) -> IO ((* :+: a) b a) Source #

gpeekByteOff :: Ptr ((* :+: a) b a) -> Int -> IO ((* :+: a) b a) Source #

gpeekElemOff :: Ptr ((* :+: a) b a) -> Int -> IO ((* :+: a) b a) Source #

gpoke :: Ptr ((* :+: a) b a) -> (* :+: a) b a -> IO () Source #

gpokeByteOff :: Ptr ((* :+: a) b a) -> Int -> (* :+: a) b a -> IO () Source #

gpokeElemOff :: Ptr ((* :+: a) b a) -> Int -> (* :+: a) b a -> IO () Source #

(GStorable a, GStorable b) => GStorable ((:*:) * a b) Source # 

Methods

gsizeOf :: (* :*: a) b a -> Int Source #

galignment :: (* :*: a) b a -> Int Source #

gpeek :: Ptr ((* :*: a) b a) -> IO ((* :*: a) b a) Source #

gpeekByteOff :: Ptr ((* :*: a) b a) -> Int -> IO ((* :*: a) b a) Source #

gpeekElemOff :: Ptr ((* :*: a) b a) -> Int -> IO ((* :*: a) b a) Source #

gpoke :: Ptr ((* :*: a) b a) -> (* :*: a) b a -> IO () Source #

gpokeByteOff :: Ptr ((* :*: a) b a) -> Int -> (* :*: a) b a -> IO () Source #

gpokeElemOff :: Ptr ((* :*: a) b a) -> Int -> (* :*: a) b a -> IO () Source #

GStorable a => GStorable (M1 * i c a) Source # 

Methods

gsizeOf :: M1 * i c a a -> Int Source #

galignment :: M1 * i c a a -> Int Source #

gpeek :: Ptr (M1 * i c a a) -> IO (M1 * i c a a) Source #

gpeekByteOff :: Ptr (M1 * i c a a) -> Int -> IO (M1 * i c a a) Source #

gpeekElemOff :: Ptr (M1 * i c a a) -> Int -> IO (M1 * i c a a) Source #

gpoke :: Ptr (M1 * i c a a) -> M1 * i c a a -> IO () Source #

gpokeByteOff :: Ptr (M1 * i c a a) -> Int -> M1 * i c a a -> IO () Source #

gpokeElemOff :: Ptr (M1 * i c a a) -> Int -> M1 * i c a a -> IO () Source #

Default functions

peekDefault :: (Generic a, GStorable (Rep a)) => Ptr a -> IO a Source #

pokeDefault :: (Generic a, GStorable (Rep a)) => Ptr a -> a -> IO () Source #

pokeByteOffDefault :: (Generic a, GStorable (Rep a)) => Ptr a -> Int -> a -> IO () Source #

pokeElemOffDefault :: (Generic a, GStorable (Rep a)) => Ptr a -> Int -> a -> IO () Source #

Wrapper