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

Safe Haskell | Safe-Inferred
Language | Haskell98

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

Instances details

(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

- getTuple :: a

#### Instances

Instances details

Arbitrary a => Arbitrary (Tuple a) Source # |
Instance details Defined in Foreign.Storable.Record.Tuple Methods arbitrary :: Gen (Tuple a) Source # shrink :: Tuple a -> [Tuple a] Source #
Storable a => Storable (Tuple a) Source # |

Instance details

Defined in Foreign.Storable.Record.Tuple

Methods

sizeOf :: Tuple a -> Int Source #

alignment :: Tuple a -> Int Source #

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

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

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

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

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

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

Show a => Show (Tuple a) Source # |
Instance details Defined in Foreign.Storable.Record.Tuple Methods showsPrec :: Int -> Tuple a -> ShowS Source # show :: Tuple a -> String Source # showList :: [Tuple a] -> ShowS Source #
Eq a => Eq (Tuple a) Source # |
Instance details Defined in Foreign.Storable.Record.Tuple Methods (==) :: Tuple a -> Tuple a -> Bool Source # (/=) :: Tuple a -> Tuple a -> Bool Source #