Foreign.C.Types
| Copyright | (c) The FFI task force 2001 |
|---|---|
| License | BSD-style (see the file libraries/base/LICENSE) |
| Maintainer | ffi@haskell.org |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Description
Mapping of C types to corresponding Haskell types.
Representations of C types
Haskell type representing the C char type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C signed char type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C unsigned char type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C short type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C unsigned short type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C int type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C unsigned int type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C long type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C unsigned long type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C ptrdiff_t type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C size_t type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C wchar_t type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
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].
Constructors
| CSigAtomic Int32 |
Instances
Haskell type representing the C long long type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C unsigned long long type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C bool type. (The concrete types of Foreign.C.Types are platform-specific.)
Since: base-4.10.0.0
Instances
Instances
Instances
Instances
Instances
Numeric types
These types are represented as newtypes of basic foreign types, and are instances of Eq, Ord, Num, Read, Show, Enum, Typeable and Storable.
Haskell type representing the C clock_t type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C time_t type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
| Eq CTime Source | |
| Ord CTime Source | |
Defined in GHC.Internal.Foreign.C.Types | |
| Enum CTime Source | |
| Storable CTime Source | |
Defined in GHC.Internal.Foreign.C.Types | |
| Num CTime Source | |
| Read CTime Source | |
| Real CTime Source | |
Defined in GHC.Internal.Foreign.C.Types MethodstoRational :: CTime -> Rational Source | |
| Show CTime 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
Instances
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
Constructors
| CSUSeconds Int64 |
Instances
To convert CTime to UTCTime, use the following:
\t -> posixSecondsToUTCTime (realToFrac t :: POSIXTime)
Floating types
These types are represented as newtypes of Float and Double, and are instances of Eq, Ord, Num, Read, Show, Enum, Typeable, Storable, Real, Fractional, Floating, RealFrac and RealFloat. That does mean that CFloat's (respectively CDouble's) instances of Eq, Ord, Num and Fractional are as badly behaved as Float's (respectively Double's).
Haskell type representing the C float type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Haskell type representing the C double type. (The concrete types of Foreign.C.Types are platform-specific.)
Instances
Other types
Haskell type representing the C FILE type. (The concrete types of Foreign.C.Types are platform-specific.)
Haskell type representing the C fpos_t type. (The concrete types of Foreign.C.Types are platform-specific.)
Haskell type representing the C jmp_buf type. (The concrete types of Foreign.C.Types are platform-specific.)
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.14.1/docs/libraries/base-4.22.0.0-66f8/Foreign-C-Types.html