License | BSD-style |
---|---|
Maintainer | Haskell Foundation |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Foundation.Class.Storable
Contents
Synopsis
- class Storable a where
- class Storable a => StorableFixed a where
- data Ptr a
- plusPtr :: StorableFixed a => Ptr a -> CountOf a -> Ptr a
- castPtr :: Ptr a -> Ptr b
- peekOff :: StorableFixed a => Ptr a -> Offset a -> IO a
- pokeOff :: StorableFixed a => Ptr a -> Offset a -> a -> IO ()
- peekArray :: (Buildable col, StorableFixed (Element col)) => CountOf (Element col) -> Ptr (Element col) -> IO col
- peekArrayEndedBy :: (Buildable col, StorableFixed (Element col), Eq (Element col), Show (Element col)) => Element col -> Ptr (Element col) -> IO col
- pokeArray :: (Sequential col, StorableFixed (Element col)) => Ptr (Element col) -> col -> IO ()
- pokeArrayEndedBy :: (Sequential col, StorableFixed (Element col)) => Element col -> Ptr (Element col) -> col -> IO ()
Documentation
Storable type of self determined size.
Instances
Storable CChar # | |
Storable CUChar # | |
Storable Int16 # | |
Storable Int32 # | |
Storable Int64 # | |
Storable Int8 # | |
Storable Word16 # | |
Storable Word32 # | |
Storable Word64 # | |
Storable Word8 # | |
Storable Word128 # | |
Storable Word256 # | |
Storable IPv4 # | |
Storable IPv6 # | |
Storable UUID # | |
Storable Char # | |
Storable Double # | |
Storable Float # | |
Storable (Ptr a) # | |
Storable (BE Word16) # | |
Storable (BE Word32) # | |
Storable (BE Word64) # | |
Storable (BE Word128) # | |
Storable (BE Word256) # | |
Storable (LE Word16) # | |
Storable (LE Word32) # | |
Storable (LE Word64) # | |
Storable (LE Word128) # | |
Storable (LE Word256) # | |
class Storable a => StorableFixed a where #
Extending the Storable type class to the types that can be sequenced in a structure.
Instances
Ptr
Instances
Generic1 (URec (Ptr ()) :: k -> Type) | |
Data a => Data (Ptr a) | |
Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ptr a -> c (Ptr a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Ptr a) # dataTypeOf :: Ptr a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Ptr a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Ptr a)) # gmapT :: (forall b. Data b => b -> b) -> Ptr a -> Ptr a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ptr a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ptr a -> r # gmapQ :: (forall d. Data d => d -> u) -> Ptr a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ptr a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ptr a -> m (Ptr a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ptr a -> m (Ptr a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ptr a -> m (Ptr a) # | |
Foldable (UAddr :: Type -> Type) | |
Defined in Data.Foldable Methods fold :: Monoid m => UAddr m -> m foldMap :: Monoid m => (a -> m) -> UAddr a -> m foldMap' :: Monoid m => (a -> m) -> UAddr a -> m foldr :: (a -> b -> b) -> b -> UAddr a -> b foldr' :: (a -> b -> b) -> b -> UAddr a -> b foldl :: (b -> a -> b) -> b -> UAddr a -> b foldl' :: (b -> a -> b) -> b -> UAddr a -> b foldr1 :: (a -> a -> a) -> UAddr a -> a foldl1 :: (a -> a -> a) -> UAddr a -> a toList :: UAddr a -> [a] elem :: Eq a => a -> UAddr a -> Bool maximum :: Ord a => UAddr a -> a minimum :: Ord a => UAddr a -> a sum :: Num a => UAddr a -> a product :: Num a => UAddr a -> a | |
Traversable (UAddr :: Type -> Type) | |
Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> UAddr a -> f (UAddr b) sequenceA :: Applicative f => UAddr (f a) -> f (UAddr a) | |
Storable (Ptr a) | |
Show (Ptr a) | |
NormalForm (Ptr a) | |
Defined in Basement.NormalForm Methods toNormalForm :: Ptr a -> () # | |
Storable (Ptr a) # | |
StorableFixed (Ptr a) # | |
Eq (Ptr a) | |
Ord (Ptr a) | |
Functor (URec (Ptr ()) :: Type -> Type) | |
Generic (URec (Ptr ()) p) | |
Eq (URec (Ptr ()) p) | |
Ord (URec (Ptr ()) p) | |
Defined in GHC.Generics Methods compare :: URec (Ptr ()) p -> URec (Ptr ()) p -> Ordering # (<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p # min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p # | |
data URec (Ptr ()) (p :: k) | |
Defined in GHC.Generics | |
type Rep1 (URec (Ptr ()) :: k -> Type) | |
Defined in GHC.Generics | |
type Rep (URec (Ptr ()) p) | |
offset based helper
Collection
peekArray :: (Buildable col, StorableFixed (Element col)) => CountOf (Element col) -> Ptr (Element col) -> IO col #
peekArrayEndedBy :: (Buildable col, StorableFixed (Element col), Eq (Element col), Show (Element col)) => Element col -> Ptr (Element col) -> IO col #
pokeArray :: (Sequential col, StorableFixed (Element col)) => Ptr (Element col) -> col -> IO () #
pokeArrayEndedBy :: (Sequential col, StorableFixed (Element col)) => Element col -> Ptr (Element col) -> col -> IO () #