W3cubDocs

/Haskell 9

Foreign.C.ConstPtr

Copyright (c) GHC Developers
License BSD-style (see the file libraries/base/LICENSE)
Maintainer [email protected]
Stability provisional
Portability portable
Safe Haskell Safe
Language Haskell2010

Description

This module provides typed const pointers to foreign data. It is part of the Foreign Function Interface (FFI).

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

Instances
Instances details
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

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

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.12.1/docs/libraries/base-4.21.0.0-8e62/Foreign-C-ConstPtr.html