Foreign.C.Types (original) (raw)

Contents

Description

Mapping of C types to corresponding Haskell types.

Synopsis

Representations of C types

newtype CUChar Source #

Haskell type representing the C unsigned char type.(The concrete types of Foreign.C.Types are platform-specific.)

newtype CUInt Source #

Haskell type representing the C unsigned int type.(The concrete types of Foreign.C.Types are platform-specific.)

newtype CULong Source #

Haskell type representing the C unsigned long type.(The concrete types of Foreign.C.Types are platform-specific.)

newtype CSigAtomic Source #

Haskell type representing the C sig_atomic_t type.(The concrete types of Foreign.C.Types are platform-specific.) See Note [Lack of signals on wasm32-wasi].

newtype CULLong Source #

Haskell type representing the C unsigned long long type.(The concrete types of Foreign.C.Types are platform-specific.)

newtype CBool Source #

Haskell type representing the C bool type.(The concrete types of Foreign.C.Types are platform-specific.)

Since: base-4.10.0.0

Numeric types

These types are represented as newtypes of basic foreign types, and are instances of[Eq](Prelude.html#v:Eq "Prelude"), [Ord](Prelude.html#v:Ord "Prelude"), [Num](Prelude.html#v:Num "Prelude"), [Read](Prelude.html#v:Read "Prelude"),[Show](Prelude.html#v:Show "Prelude"), [Enum](Prelude.html#v:Enum "Prelude"), [Typeable](Data-Typeable.html#v:Typeable "Data.Typeable") andStorable.

newtype CUSeconds Source #

Haskell type representing the C useconds_t type.(The concrete types of Foreign.C.Types are platform-specific.)

Since: base-4.4.0.0

newtype CSUSeconds Source #

Haskell type representing the C suseconds_t type.(The concrete types of Foreign.C.Types are platform-specific.)

Since: base-4.4.0.0

To convert [CTime](Foreign-C-Types.html#t:CTime "Foreign.C.Types") to [UTCTime](Data-Time.html#v:UTCTime "Data.Time"), use the following:

\t -> posixSecondsToUTCTime (realToFrac t :: POSIXTime)

Floating types

These types are represented as newtypes of[Float](Prelude.html#v:Float "Prelude") and [Double](Prelude.html#v:Double "Prelude"), and are instances of[Eq](Prelude.html#v:Eq "Prelude"), [Ord](Prelude.html#v:Ord "Prelude"), [Num](Prelude.html#v:Num "Prelude"), [Read](Prelude.html#v:Read "Prelude"),[Show](Prelude.html#v:Show "Prelude"), [Enum](Prelude.html#v:Enum "Prelude"), [Typeable](Data-Typeable.html#v:Typeable "Data.Typeable"), Storable,[Real](Prelude.html#v:Real "Prelude"), [Fractional](Prelude.html#v:Fractional "Prelude"), [Floating](Prelude.html#v:Floating "Prelude"),[RealFrac](Prelude.html#v:RealFrac "Prelude") and [RealFloat](Prelude.html#v:RealFloat "Prelude"). That does mean that [CFloat](Foreign-C-Types.html#t:CFloat "Foreign.C.Types")'s (respectively [CDouble](Foreign-C-Types.html#t:CDouble "Foreign.C.Types")'s) instances of[Eq](Prelude.html#v:Eq "Prelude"), [Ord](Prelude.html#v:Ord "Prelude"), [Num](Prelude.html#v:Num "Prelude") and[Fractional](Prelude.html#v:Fractional "Prelude") are as badly behaved as [Float](Prelude.html#v:Float "Prelude")'s (respectively [Double](Prelude.html#v:Double "Prelude")'s).

Other types