|Portability|| non-portable (GHC Extensions)|
|GHC Extensions: this is the Approved Way to get at GHC-specific extensions.
|Representations of some basic types|
|data Int |
|A fixed-precision integer type with at least the range [-2^29
.. 2^29-1]. The exact range for a given implementation can be
determined by using minBound and maxBound from the Bounded
|data Word |
|A Word is an unsigned integral type, with the same size as Int.|
|data Float |
|Single-precision floating point numbers.|
|data Double |
|Double-precision floating point numbers.|
|data Integer |
|J# Int# ByteArray#|
|data Char |
The character type Char is an enumeration whose values represent
Unicode (or equivalently ISO 10646) characters.
This set extends the ISO 8859-1 (Latin-1) character set
(the first 256 charachers), which is itself an extension of the ASCII
character set (the first 128 characters).
A character literal in Haskell has type Char.
To convert a Char to or from the corresponding Int value defined
by Unicode, use toEnum and fromEnum from the
Enum class respectively (or equivalently ord and chr).
|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.
|data FunPtr a|
A value of type FunPtr a is a pointer to a function callable
from foreign code. The type a will normally be a foreign type,
a function type with zero or more arguments where
- the argument types are marshallable foreign types,
i.e. Char, Int, Double, Float,
Bool, Int8, Int16, Int32,
Int64, Word8, Word16,
Word32, Word64, Ptr a, FunPtr a,
StablePtr a or a renaming of any of these
- the return type is either a marshallable foreign type or has the form
IO t where t is a marshallable foreign type or ().
A value of type FunPtr a may be a pointer to a foreign function,
either returned by another foreign function or imported with a
a static address import like
foreign import ccall "stdlib.h &free"
p_free :: FunPtr (Ptr a -> IO ())
or a pointer to a Haskell function created using a wrapper stub
declared to produce a FunPtr of the correct type. For example:
type Compare = Int -> Int -> Bool
foreign import ccall "wrapper"
mkCompare :: Compare -> IO (FunPtr Compare)
Calls to wrapper stubs like mkCompare allocate storage, which
should be released with freeHaskellFunPtr when no
To convert FunPtr values to corresponding Haskell functions, one
can define a dynamic stub for the specific foreign type, e.g.
type IntFunction = CInt -> IO ()
foreign import ccall "dynamic"
mkFun :: FunPtr IntFunction -> IntFunction
|shiftL# :: Word# -> Int# -> Word#|
|shiftRL# :: Word# -> Int# -> Word#|
|iShiftL# :: Int# -> Int# -> Int#|
|iShiftRA# :: Int# -> Int# -> Int#|
|iShiftRL# :: Int# -> Int# -> Int#|
|build :: forall a . (forall b . (a -> b -> b) -> b -> b) -> [a]|
|augment :: forall a . (forall b . (a -> b -> b) -> b -> b) -> [a] -> [a]|
|Linear implicit parameter support|
|class Splittable t where|
|Produced by Haddock version 0.6|