| License | BSD-style |
|---|---|
| Maintainer | Haskell Foundation |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| 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
class Storable a where Source #
Storable type of self determined size.
Instances
| Storable Char Source # | |
| Storable Double Source # | |
| Storable Float Source # | |
| Storable Int8 Source # | |
| Storable Int16 Source # | |
| Storable Int32 Source # | |
| Storable Int64 Source # | |
| Storable Word8 Source # | |
| Storable Word16 Source # | |
| Storable Word32 Source # | |
| Storable Word64 Source # | |
| Storable CChar Source # | |
| Storable CUChar Source # | |
| Storable Word128 Source # | |
| Storable Word256 Source # | |
| Storable IPv6 Source # | |
| Storable IPv4 Source # | |
| Storable UUID Source # | |
| Storable (Ptr a) Source # | |
| Storable (BE Word16) Source # | |
| Storable (BE Word32) Source # | |
| Storable (BE Word64) Source # | |
| Storable (BE Word128) Source # | |
| Storable (BE Word256) Source # | |
| Storable (LE Word16) Source # | |
| Storable (LE Word32) Source # | |
| Storable (LE Word64) Source # | |
| Storable (LE Word128) Source # | |
| Storable (LE Word256) Source # | |
class Storable a => StorableFixed a where Source #
Extending the Storable type class to the types that can be sequenced in a structure.
Instances
Ptr
Instances
| Generic1 (URec (Ptr ()) :: k -> Type) | |
| Eq (Ptr a) | |
| 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) | |
| Ord (Ptr a) | |
| Show (Ptr a) | |
| NormalForm (Ptr a) | |
Defined in Basement.NormalForm Methods toNormalForm :: Ptr a -> () # | |
| Storable (Ptr a) | |
| StorableFixed (Ptr a) Source # | |
| Storable (Ptr a) Source # | |
| Functor (URec (Ptr ()) :: Type -> Type) | |
| Foldable (URec (Ptr ()) :: Type -> Type) | |
Defined in Data.Foldable Methods fold :: Monoid m => URec (Ptr ()) m -> m foldMap :: Monoid m => (a -> m) -> URec (Ptr ()) a -> m foldMap' :: Monoid m => (a -> m) -> URec (Ptr ()) a -> m foldr :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b foldr' :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b foldl :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b foldl' :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b foldr1 :: (a -> a -> a) -> URec (Ptr ()) a -> a foldl1 :: (a -> a -> a) -> URec (Ptr ()) a -> a toList :: URec (Ptr ()) a -> [a] null :: URec (Ptr ()) a -> Bool length :: URec (Ptr ()) a -> Int elem :: Eq a => a -> URec (Ptr ()) a -> Bool maximum :: Ord a => URec (Ptr ()) a -> a minimum :: Ord a => URec (Ptr ()) a -> a | |
| Traversable (URec (Ptr ()) :: Type -> Type) | |
Defined in Data.Traversable | |
| 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 # | |
| Generic (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) | |
Defined in GHC.Generics | |
offset based helper
pokeOff :: StorableFixed a => Ptr a -> Offset a -> a -> IO () Source #
like poke but at a given offset.
Collection
peekArray :: (Buildable col, StorableFixed (Element col)) => CountOf (Element col) -> Ptr (Element col) -> IO col Source #
peekArrayEndedBy :: (Buildable col, StorableFixed (Element col), Eq (Element col), Show (Element col)) => Element col -> Ptr (Element col) -> IO col Source #
pokeArray :: (Sequential col, StorableFixed (Element col)) => Ptr (Element col) -> col -> IO () Source #
pokeArrayEndedBy :: (Sequential col, StorableFixed (Element col)) => Element col -> Ptr (Element col) -> col -> IO () Source #