lens
Copyright(C) 2012-2016 Edward Kmett (C) 2017 Ryan Scott
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Lens.Internal.CTypes

Description

In Control.Lens.Wrapped, we need to muck around with the internals of the newtypes in Foreign.C.Types. Unfortunately, the exact types used varies wildly from platform to platform, so trying to manage the imports necessary to bring these types in scope can be unwieldy.

To make things easier, we use this module as a way to import everything carte blanche that might be used internally in Foreign.C.Types. For now, this consists of all the exports from the Data.Int and Data.Word modules, as well as the Ptr type.

Synopsis

Documentation

module Data.Int

data Ptr a #

A value of type Ptr a represents a pointer to an object, or an array of objects, which may be marshalled to or from Haskell values of type 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

Instances details
NFData1 Ptr #

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

liftRnf :: (a -> ()) -> Ptr a -> () #

IArray UArray (Ptr a) # 
Instance details

Defined in Data.Array.Base

Methods

bounds :: Ix i => UArray i (Ptr a) -> (i, i) #

numElements :: Ix i => UArray i (Ptr a) -> Int #

unsafeArray :: Ix i => (i, i) -> [(Int, Ptr a)] -> UArray i (Ptr a) #

unsafeAt :: Ix i => UArray i (Ptr a) -> Int -> Ptr a #

unsafeReplace :: Ix i => UArray i (Ptr a) -> [(Int, Ptr a)] -> UArray i (Ptr a) #

unsafeAccum :: Ix i => (Ptr a -> e' -> Ptr a) -> UArray i (Ptr a) -> [(Int, e')] -> UArray i (Ptr a) #

unsafeAccumArray :: Ix i => (Ptr a -> e' -> Ptr a) -> Ptr a -> (i, i) -> [(Int, e')] -> UArray i (Ptr a) #

GEq1 v (UAddr :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Classes.Generic.Internal

Methods

gliftEq :: Eq1Args v a b -> UAddr a -> UAddr b -> Bool Source #

GOrd1 v (UAddr :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Classes.Generic.Internal

Methods

gliftCompare :: Ord1Args v a b -> UAddr a -> UAddr b -> Ordering Source #

MArray IOUArray (Ptr a) IO # 
Instance details

Defined in Data.Array.IO.Internals

Methods

getBounds :: Ix i => IOUArray i (Ptr a) -> IO (i, i) #

getNumElements :: Ix i => IOUArray i (Ptr a) -> IO Int #

newArray :: Ix i => (i, i) -> Ptr a -> IO (IOUArray i (Ptr a)) #

newArray_ :: Ix i => (i, i) -> IO (IOUArray i (Ptr a)) #

unsafeNewArray_ :: Ix i => (i, i) -> IO (IOUArray i (Ptr a)) #

unsafeRead :: Ix i => IOUArray i (Ptr a) -> Int -> IO (Ptr a) #

unsafeWrite :: Ix i => IOUArray i (Ptr a) -> Int -> Ptr a -> IO () #

Generic1 (URec (Ptr ()) :: k -> Type) # 
Instance details

Defined in GHC.Internal.Generics

Associated Types

type Rep1 (URec (Ptr ()) :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Generics

type Rep1 (URec (Ptr ()) :: k -> Type) = D1 ('MetaData "URec" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "UAddr" 'PrefixI 'True) (S1 ('MetaSel ('Just "uAddr#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UAddr :: k -> Type)))

Methods

from1 :: forall (a :: k). URec (Ptr ()) a -> Rep1 (URec (Ptr ()) :: k -> Type) a #

to1 :: forall (a :: k). Rep1 (URec (Ptr ()) :: k -> Type) a -> URec (Ptr ()) a #

Eq1 (UAddr :: Type -> Type) #

Since: base-4.21.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> UAddr a -> UAddr b -> Bool #

Ord1 (UAddr :: Type -> Type) #

Since: base-4.21.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> UAddr a -> UAddr b -> Ordering #

Show1 (UAddr :: Type -> Type) #

Since: base-4.21.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> UAddr a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [UAddr a] -> ShowS #

NFData (Ptr a) #

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Ptr a -> () #

Data a => Data (Ptr a) #

Since: base-4.8.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) -> Ptr a -> c (Ptr a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Ptr a) #

toConstr :: Ptr a -> Constr #

dataTypeOf :: Ptr a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Ptr a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Ptr a)) #

gmapT :: (forall b. Data b => b -> b) -> Ptr a -> Ptr a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ptr a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ptr a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Ptr a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Ptr a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ptr a -> m (Ptr a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ptr a -> m (Ptr a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ptr a -> m (Ptr a) #

Foldable (UAddr :: Type -> Type) #

Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Foldable

Methods

fold :: Monoid m => UAddr m -> m #

foldMap :: Monoid m => (a -> m) -> UAddr a -> m #

foldMap' :: Monoid m => (a -> m) -> UAddr a -> m #

foldr :: (a -> b -> b) -> b -> UAddr a -> b #

foldr' :: (a -> b -> b) -> b -> UAddr a -> b #

foldl :: (b -> a -> b) -> b -> UAddr a -> b #

foldl' :: (b -> a -> b) -> b -> UAddr a -> b #

foldr1 :: (a -> a -> a) -> UAddr a -> a #

foldl1 :: (a -> a -> a) -> UAddr a -> a #

toList :: UAddr a -> [a] #

null :: UAddr a -> Bool #

length :: UAddr a -> Int #

elem :: Eq a => a -> UAddr a -> Bool #

maximum :: Ord a => UAddr a -> a #

minimum :: Ord a => UAddr a -> a #

sum :: Num a => UAddr a -> a #

product :: Num a => UAddr a -> a #

Traversable (UAddr :: Type -> Type) #

Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> UAddr a -> f (UAddr b) #

sequenceA :: Applicative f => UAddr (f a) -> f (UAddr a) #

mapM :: Monad m => (a -> m b) -> UAddr a -> m (UAddr b) #

sequence :: Monad m => UAddr (m a) -> m (UAddr a) #

Storable (Ptr a) #

Since: base-2.1

Instance details

Defined in GHC.Internal.Foreign.Storable

Methods

sizeOf :: Ptr a -> Int #

alignment :: Ptr a -> Int #

peekElemOff :: Ptr (Ptr a) -> Int -> IO (Ptr a) #

pokeElemOff :: Ptr (Ptr a) -> Int -> Ptr a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Ptr a) #

pokeByteOff :: Ptr b -> Int -> Ptr a -> IO () #

peek :: Ptr (Ptr a) -> IO (Ptr a) #

poke :: Ptr (Ptr a) -> Ptr a -> IO () #

Show (Ptr a) #

Since: base-2.1

Instance details

Defined in GHC.Internal.Ptr

Methods

showsPrec :: Int -> Ptr a -> ShowS #

show :: Ptr a -> String #

showList :: [Ptr a] -> ShowS #

Eq (Ptr a) #

Since: base-2.1

Instance details

Defined in GHC.Internal.Ptr

Methods

(==) :: Ptr a -> Ptr a -> Bool #

(/=) :: Ptr a -> Ptr a -> Bool #

Ord (Ptr a) #

Since: base-2.1

Instance details

Defined in GHC.Internal.Ptr

Methods

compare :: Ptr a -> Ptr a -> Ordering #

(<) :: Ptr a -> Ptr a -> Bool #

(<=) :: Ptr a -> Ptr a -> Bool #

(>) :: Ptr a -> Ptr a -> Bool #

(>=) :: Ptr a -> Ptr a -> Bool #

max :: Ptr a -> Ptr a -> Ptr a #

min :: Ptr a -> Ptr a -> Ptr a #

Hashable (Ptr a) Source # 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Ptr a -> Int Source #

hash :: Ptr a -> Int Source #

Prim (Ptr a) Source # 
Instance details

Defined in Data.Primitive.Types

MArray (STUArray s) (Ptr a) (ST s) # 
Instance details

Defined in Data.Array.Base

Methods

getBounds :: Ix i => STUArray s i (Ptr a) -> ST s (i, i) #

getNumElements :: Ix i => STUArray s i (Ptr a) -> ST s Int #

newArray :: Ix i => (i, i) -> Ptr a -> ST s (STUArray s i (Ptr a)) #

newArray_ :: Ix i => (i, i) -> ST s (STUArray s i (Ptr a)) #

unsafeNewArray_ :: Ix i => (i, i) -> ST s (STUArray s i (Ptr a)) #

unsafeRead :: Ix i => STUArray s i (Ptr a) -> Int -> ST s (Ptr a) #

unsafeWrite :: Ix i => STUArray s i (Ptr a) -> Int -> Ptr a -> ST s () #

Functor (URec (Ptr ()) :: Type -> Type) #

Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Generics

Methods

fmap :: (a -> b) -> URec (Ptr ()) a -> URec (Ptr ()) b #

(<$) :: a -> URec (Ptr ()) b -> URec (Ptr ()) a #

Show (UAddr p) #

Since: base-4.21.0.0

Instance details

Defined in GHC.Internal.Generics

Methods

showsPrec :: Int -> UAddr p -> ShowS #

show :: UAddr p -> String #

showList :: [UAddr p] -> ShowS #

GEq (UAddr p) Source # 
Instance details

Defined in Data.Functor.Classes.Generic.Internal

Methods

geq :: UAddr p -> UAddr p -> Bool Source #

GOrd (UAddr p) Source # 
Instance details

Defined in Data.Functor.Classes.Generic.Internal

Methods

gcompare :: UAddr p -> UAddr p -> Ordering Source #

Generic (URec (Ptr ()) p) # 
Instance details

Defined in GHC.Internal.Generics

Associated Types

type Rep (URec (Ptr ()) p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Generics

type Rep (URec (Ptr ()) p) = D1 ('MetaData "URec" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "UAddr" 'PrefixI 'True) (S1 ('MetaSel ('Just "uAddr#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UAddr :: Type -> Type)))

Methods

from :: URec (Ptr ()) p -> Rep (URec (Ptr ()) p) x #

to :: Rep (URec (Ptr ()) p) x -> URec (Ptr ()) p #

Eq (URec (Ptr ()) p) #

Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Generics

Methods

(==) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(/=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

Ord (URec (Ptr ()) p) #

Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Generics

Methods

compare :: URec (Ptr ()) p -> URec (Ptr ()) p -> Ordering #

(<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p #

min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p #

data URec (Ptr ()) (p :: k) #

Used for marking occurrences of Addr#

Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Generics

data URec (Ptr ()) (p :: k) = UAddr {}
type Rep1 (URec (Ptr ()) :: k -> Type) #

Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Generics

type Rep1 (URec (Ptr ()) :: k -> Type) = D1 ('MetaData "URec" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "UAddr" 'PrefixI 'True) (S1 ('MetaSel ('Just "uAddr#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UAddr :: k -> Type)))
type Rep (URec (Ptr ()) p) #

Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Generics

type Rep (URec (Ptr ()) p) = D1 ('MetaData "URec" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "UAddr" 'PrefixI 'True) (S1 ('MetaSel ('Just "uAddr#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UAddr :: Type -> Type)))

module Data.Word