Foreign.Storable.Record.Tuple

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 #

Methods

sizeOf :: a -> Int #

alignment :: a -> Int #

peek :: Ptr a -> IO a #

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

#### Instances

Instances details

(Storable a, Storable b) => Storable (a, b) # |
Instance details Defined in Foreign.Storable.Record.Tuple Methods sizeOf :: (a, b) -> Int # alignment :: (a, b) -> Int # peek :: Ptr (a, b) -> IO (a, b) # poke :: Ptr (a, b) -> (a, b) -> IO () #
(Storable a, Storable b, Storable c) => Storable (a, b, c) # |
Instance details Defined in Foreign.Storable.Record.Tuple Methods sizeOf :: (a, b, c) -> Int # alignment :: (a, b, c) -> Int # peek :: Ptr (a, b, c) -> IO (a, b, c) # poke :: Ptr (a, b, c) -> (a, b, c) -> IO () #
(Storable a, Storable b, Storable c, Storable d) => Storable (a, b, c, d) # |
Instance details Defined in Foreign.Storable.Record.Tuple Methods sizeOf :: (a, b, c, d) -> Int # alignment :: (a, b, c, d) -> Int # peek :: Ptr (a, b, c, d) -> IO (a, b, c, d) # poke :: Ptr (a, b, c, d) -> (a, b, c, d) -> IO () #

newtype Tuple a #

Constructors

Tuple |
Fields getTuple :: a

#### Instances

Instances details

Arbitrary a => Arbitrary (Tuple a) # |
Instance details Defined in Foreign.Storable.Record.Tuple Methods arbitrary :: Gen (Tuple a) # shrink :: Tuple a -> [Tuple a] #
Storable a => Storable (Tuple a) # |
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 () #
Show a => Show (Tuple a) # |
Instance details Defined in Foreign.Storable.Record.Tuple Methods showsPrec :: Int -> Tuple a -> ShowS # show :: Tuple a -> String # showList :: [Tuple a] -> ShowS #
Eq a => Eq (Tuple a) # |
Instance details Defined in Foreign.Storable.Record.Tuple Methods (==) :: Tuple a -> Tuple a -> Bool # (/=) :: Tuple a -> Tuple a -> Bool #