Copyright | (c) GHC Developers |
---|---|
License | BSD-style (see the file libraries/base/LICENSE) |
Maintainer | ffi@haskell.org |
Stability | provisional |
Portability | portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
This module provides typed const
pointers to foreign data. It is part
of the Foreign Function Interface (FFI).
Synopsis
- newtype ConstPtr a = ConstPtr {
- unConstPtr :: Ptr a
Documentation
A pointer with the C const
qualifier. For instance, an argument of type
ConstPtr CInt
would be marshalled as const int*
.
While const
-ness generally does not matter for ccall
imports (since
const
and non-const
pointers typically have equivalent calling
conventions), it does matter for capi
imports. See GHC #22043.
Since: base-4.18.0.0
ConstPtr | |
|
Instances
Data a => Data (ConstPtr a) Source # | Since: base-4.18.0.0 |
Defined in Data.Data gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ConstPtr a -> c (ConstPtr a) Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ConstPtr a) Source # toConstr :: ConstPtr a -> Constr Source # dataTypeOf :: ConstPtr a -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ConstPtr a)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ConstPtr a)) Source # gmapT :: (forall b. Data b => b -> b) -> ConstPtr a -> ConstPtr a Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ConstPtr a -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ConstPtr a -> r Source # gmapQ :: (forall d. Data d => d -> u) -> ConstPtr a -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> ConstPtr a -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ConstPtr a -> m (ConstPtr a) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ConstPtr a -> m (ConstPtr a) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ConstPtr a -> m (ConstPtr a) Source # | |
Storable (ConstPtr a) Source # | |
Defined in Foreign.Storable sizeOf :: ConstPtr a -> Int Source # alignment :: ConstPtr a -> Int Source # peekElemOff :: Ptr (ConstPtr a) -> Int -> IO (ConstPtr a) Source # pokeElemOff :: Ptr (ConstPtr a) -> Int -> ConstPtr a -> IO () Source # peekByteOff :: Ptr b -> Int -> IO (ConstPtr a) Source # pokeByteOff :: Ptr b -> Int -> ConstPtr a -> IO () Source # | |
Show (ConstPtr a) Source # | |
Eq (ConstPtr a) Source # | |
Ord (ConstPtr a) Source # | |
Defined in Foreign.C.ConstPtr compare :: ConstPtr a -> ConstPtr a -> Ordering Source # (<) :: ConstPtr a -> ConstPtr a -> Bool Source # (<=) :: ConstPtr a -> ConstPtr a -> Bool Source # (>) :: ConstPtr a -> ConstPtr a -> Bool Source # (>=) :: ConstPtr a -> ConstPtr a -> Bool Source # |