License | BSD-style |
---|---|
Maintainer | Haskell Foundation |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
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 Word256 Source # | |
Storable Word128 Source # | |
Storable IPv6 Source # | |
Storable IPv4 Source # | |
Storable UUID Source # | |
Storable ( Ptr a) Source # | |
Storable ( LE Word16 ) Source # | |
Storable ( LE Word32 ) Source # | |
Storable ( LE Word64 ) Source # | |
Storable ( LE Word256 ) Source # | |
Storable ( LE Word128 ) Source # | |
Storable ( BE Word16 ) Source # | |
Storable ( BE Word32 ) Source # | |
Storable ( BE Word64 ) Source # | |
Storable ( BE Word256 ) Source # | |
Storable ( BE Word128 ) 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
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
a
a
.
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
Generic1 ( URec ( Ptr ()) :: k -> Type ) |
Since: base-4.9.0.0 |
Eq ( Ptr a) |
Since: base-2.1 |
Data a => Data ( Ptr a) |
Since: base-4.8.0.0 |
Defined in Data.Data gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> Ptr a -> c ( Ptr a) Source # gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c ( Ptr a) Source # toConstr :: Ptr a -> Constr Source # dataTypeOf :: Ptr a -> DataType Source # dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c ( Ptr a)) Source # dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c ( Ptr a)) Source # gmapT :: ( forall b. Data b => b -> b) -> Ptr a -> Ptr a Source # gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> Ptr a -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> Ptr a -> r Source # gmapQ :: ( forall d. Data d => d -> u) -> Ptr a -> [u] Source # gmapQi :: Int -> ( forall d. Data d => d -> u) -> Ptr a -> u Source # gmapM :: Monad m => ( forall d. Data d => d -> m d) -> Ptr a -> m ( Ptr a) Source # gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> Ptr a -> m ( Ptr a) Source # gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> Ptr a -> m ( Ptr a) Source # |
|
Ord ( Ptr a) |
Since: base-2.1 |
Defined in GHC.Ptr |
|
Show ( Ptr a) |
Since: base-2.1 |
Foldable ( UAddr :: Type -> Type ) |
Since: base-4.9.0.0 |
Defined in Data.Foldable fold :: Monoid m => UAddr m -> m Source # foldMap :: Monoid m => (a -> m) -> UAddr a -> m Source # foldMap' :: Monoid m => (a -> m) -> UAddr a -> m Source # foldr :: (a -> b -> b) -> b -> UAddr a -> b Source # foldr' :: (a -> b -> b) -> b -> UAddr a -> b Source # foldl :: (b -> a -> b) -> b -> UAddr a -> b Source # foldl' :: (b -> a -> b) -> b -> UAddr a -> b Source # foldr1 :: (a -> a -> a) -> UAddr a -> a Source # foldl1 :: (a -> a -> a) -> UAddr a -> a Source # toList :: UAddr a -> [a] Source # null :: UAddr a -> Bool Source # length :: UAddr a -> Int Source # elem :: Eq a => a -> UAddr a -> Bool Source # maximum :: Ord a => UAddr a -> a Source # minimum :: Ord a => UAddr a -> a Source # |
|
Traversable ( UAddr :: Type -> Type ) |
Since: base-4.9.0.0 |
Storable ( Ptr a) |
Since: base-2.1 |
Defined in Foreign.Storable sizeOf :: Ptr a -> Int Source # alignment :: Ptr a -> Int Source # peekElemOff :: Ptr ( Ptr a) -> Int -> IO ( Ptr a) Source # pokeElemOff :: Ptr ( Ptr a) -> Int -> Ptr a -> IO () Source # peekByteOff :: Ptr b -> Int -> IO ( Ptr a) Source # pokeByteOff :: Ptr b -> Int -> Ptr a -> IO () Source # |
|
NormalForm ( Ptr a) | |
Defined in Basement.NormalForm toNormalForm :: Ptr a -> () Source # |
|
StorableFixed ( Ptr a) Source # | |
Storable ( Ptr a) Source # | |
Functor ( URec ( Ptr ()) :: Type -> Type ) |
Since: base-4.9.0.0 |
Eq ( URec ( Ptr ()) p) |
Since: base-4.9.0.0 |
Ord ( URec ( Ptr ()) p) |
Since: base-4.9.0.0 |
Defined in GHC.Generics compare :: URec ( Ptr ()) p -> URec ( Ptr ()) p -> Ordering Source # (<) :: URec ( Ptr ()) p -> URec ( Ptr ()) p -> Bool Source # (<=) :: URec ( Ptr ()) p -> URec ( Ptr ()) p -> Bool Source # (>) :: URec ( Ptr ()) p -> URec ( Ptr ()) p -> Bool Source # (>=) :: URec ( Ptr ()) p -> URec ( Ptr ()) p -> Bool Source # max :: URec ( Ptr ()) p -> URec ( Ptr ()) p -> URec ( Ptr ()) p Source # min :: URec ( Ptr ()) p -> URec ( Ptr ()) p -> URec ( Ptr ()) p Source # |
|
Generic ( URec ( Ptr ()) p) |
Since: base-4.9.0.0 |
data URec ( Ptr ()) (p :: k) |
Used for marking occurrences of
Since: base-4.9.0.0 |
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 #