License | BSD-style |
---|---|
Maintainer | Haskell Foundation |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Foundation.Class.Storable
Contents
- 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 Char # | |
Storable Double # | |
Storable Float # | |
Storable Int8 # | |
Storable Int16 # | |
Storable Int32 # | |
Storable Int64 # | |
Storable Word8 # | |
Storable Word16 # | |
Storable Word32 # | |
Storable Word64 # | |
Storable CChar # | |
Storable CUChar # | |
Storable Word256 # | |
Storable Word128 # | |
Storable IPv4 # | |
Storable IPv6 # | |
Storable UUID # | |
Storable (Ptr a) # | |
Storable (LE Word16) # | |
Storable (LE Word32) # | |
Storable (LE Word64) # | |
Storable (LE Word256) # | |
Storable (LE Word128) # | |
Storable (BE Word16) # | |
Storable (BE Word32) # | |
Storable (BE Word64) # | |
Storable (BE Word256) # | |
Storable (BE Word128) # | |
class Storable a => StorableFixed a where #
Extending the Storable type class to the types that can be sequenced in a structure.
Instances
Ptr
A value of type
represents a pointer to an object, or an
array of objects, which may be marshalled to or from Haskell values
of type Ptr
aa
.
The type a
will often be an instance of class
Storable
which provides the marshalling operations.
However this is not essential, and you can provide your own operations
to access the pointer. For example you might write small foreign
functions to get or set the fields of a C struct
.
Instances
Eq (Ptr a) | |
Data a => Data (Ptr a) | |
Functor (URec (Ptr ())) | |
Ord (Ptr a) | |
Show (Ptr a) | |
Foldable (URec (Ptr ())) | |
Traversable (URec (Ptr ())) | |
Generic1 (URec (Ptr ())) | |
Storable (Ptr a) | |
NormalForm (Ptr a) | |
StorableFixed (Ptr a) # | |
Storable (Ptr a) # | |
Eq (URec (Ptr ()) p) | |
Ord (URec (Ptr ()) p) | |
Generic (URec (Ptr ()) p) | |
type Rep1 (URec (Ptr ())) | |
data URec (Ptr ()) | Used for marking occurrences of |
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 () #