Foreign.C.ConstPtr

base-4.22.0.0: Core data structures and operations

Copyright | (c) GHC Developers
License | BSD-style (see the file libraries/base/LICENSE)
Maintainer | ffi@haskell.org
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

Foreign.C.ConstPtr

Description

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

newtype ConstPtr a Source #

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

Constructors

ConstPtr |
Fields unConstPtr :: Ptr a

#### Instances

Instances details

Eq (ConstPtr a) Source # |
Instance details Defined in GHC.Internal.Foreign.C.ConstPtr Methods (==) :: ConstPtr a -> ConstPtr a -> Bool Source # (/=) :: ConstPtr a -> ConstPtr a -> Bool Source #
Ord (ConstPtr a) Source # |
Instance details Defined in GHC.Internal.Foreign.C.ConstPtr Methods 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 # max :: ConstPtr a -> ConstPtr a -> ConstPtr a Source # min :: ConstPtr a -> ConstPtr a -> ConstPtr a Source #
Data a => Data (ConstPtr a) Source # | Since: base-4.18.0.0
Instance details Defined in GHC.Internal.Data.Data Methods 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 # |
Instance details Defined in GHC.Internal.Foreign.Storable Methods 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 # peek :: Ptr (ConstPtr a) -> IO (ConstPtr a) Source # poke :: Ptr (ConstPtr a) -> ConstPtr a -> IO () Source #
Show (ConstPtr a) Source # |
Instance details Defined in GHC.Internal.Foreign.C.ConstPtr Methods showsPrec :: Int -> ConstPtr a -> ShowS Source # show :: ConstPtr a -> String Source # showList :: [ConstPtr a] -> ShowS Source #