storable-record-0.0.5: Elegant definition of Storable instances for records

Safe HaskellSafe
LanguageHaskell98

Foreign.Storable.Record.Tuple

Description

Custom class for storing tuples and wrapper for storing tuples in standard Storable class. These two solutions do not need orphan instances. The package storable-tuple makes use of this implementation.

Documentation

class Storable a where Source #

Methods

sizeOf :: a -> Int Source #

alignment :: a -> Int Source #

peek :: Ptr a -> IO a Source #

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

Instances
(Storable a, Storable b) => Storable (a, b) Source # 
Instance details

Defined in Foreign.Storable.Record.Tuple

Methods

sizeOf :: (a, b) -> Int Source #

alignment :: (a, b) -> Int Source #

peek :: Ptr (a, b) -> IO (a, b) Source #

poke :: Ptr (a, b) -> (a, b) -> IO () Source #

(Storable a, Storable b, Storable c) => Storable (a, b, c) Source # 
Instance details

Defined in Foreign.Storable.Record.Tuple

Methods

sizeOf :: (a, b, c) -> Int Source #

alignment :: (a, b, c) -> Int Source #

peek :: Ptr (a, b, c) -> IO (a, b, c) Source #

poke :: Ptr (a, b, c) -> (a, b, c) -> IO () Source #

(Storable a, Storable b, Storable c, Storable d) => Storable (a, b, c, d) Source # 
Instance details

Defined in Foreign.Storable.Record.Tuple

Methods

sizeOf :: (a, b, c, d) -> Int Source #

alignment :: (a, b, c, d) -> Int Source #

peek :: Ptr (a, b, c, d) -> IO (a, b, c, d) Source #

poke :: Ptr (a, b, c, d) -> (a, b, c, d) -> IO () Source #

newtype Tuple a Source #

Constructors

Tuple 

Fields

Instances
Eq a => Eq (Tuple a) Source # 
Instance details

Defined in Foreign.Storable.Record.Tuple

Methods

(==) :: Tuple a -> Tuple a -> Bool #

(/=) :: Tuple a -> Tuple a -> Bool #

Show a => Show (Tuple a) Source # 
Instance details

Defined in Foreign.Storable.Record.Tuple

Methods

showsPrec :: Int -> Tuple a -> ShowS #

show :: Tuple a -> String #

showList :: [Tuple a] -> ShowS #

Storable a => Storable (Tuple a) Source # 
Instance details

Defined in Foreign.Storable.Record.Tuple

Methods

sizeOf :: Tuple a -> Int #

alignment :: Tuple a -> Int #

peekElemOff :: Ptr (Tuple a) -> Int -> IO (Tuple a) #

pokeElemOff :: Ptr (Tuple a) -> Int -> Tuple a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Tuple a) #

pokeByteOff :: Ptr b -> Int -> Tuple a -> IO () #

peek :: Ptr (Tuple a) -> IO (Tuple a) #

poke :: Ptr (Tuple a) -> Tuple a -> IO () #