FFI
Types
C string (null-terminated).
C string with length.
Type Classes
Methods
sizeOf :: a -> Int
alignment :: a -> Int
peek :: (Ptr a) -> IO a
poke :: (Ptr a) -> a -> IO ()
peekByteOff :: (Ptr b) -> Int -> IO a
pokeByteOff :: (Ptr b) -> Int -> a -> IO ()
peekElemOff :: (Ptr a) -> Int -> IO a
pokeElemOff :: (Ptr a) -> Int -> a -> IO ()
Class for types that can be stored in memory.
Constraint for types callable from C.
Constraint for types returnable to C.
Functions
The null function pointer.
Cast pointer to different type.
Cast function pointer to different type.
Advance pointer by offset bytes.
Compute byte difference between pointers.
Align pointer to alignment boundary.
Create foreign pointer with finalizer.
Create foreign pointer without finalizer.
Execute action with foreign pointer.
Keep foreign pointer alive.
Cast foreign pointer to different type.
Allocate foreign memory for Storable value.
Allocate foreign memory of given size.
Allocate foreign array.
Add finalizer to foreign pointer.
Run finalizers immediately.
Allocate memory for a Storable value.
Allocate memory of given size.
Allocate array of Storable values.
Allocate zero-initialized memory.
Allocate zero-initialized bytes.
Allocate zero-initialized array.
Resize allocated memory.
Resize to given size.
Resize array.
Free allocated memory.
Free allocated bytes.
Allocate pinned memory (won't be moved by GC).
Allocate pinned bytes.
Allocate pinned array.
Allocate with specific alignment.
Check if memory is pinned.
Allocate temporary memory for Storable.
Allocate temporary bytes.
Allocate temporary array.
Allocate and initialize with value.
Allocate and initialize array.
Allocate array with length.
Allocate null-terminated array.
Copy array elements.
Move array elements (may overlap).
Find length of null-terminated array.
Advance pointer by element count.
Read array from memory.
Read null-terminated array.
Write array to memory.
Write null-terminated array.
Allocate and initialize new array.
Allocate null-terminated array.
Read C string to Haskell String.
Read C string with length.
Create new C string.
Create C string with length.
Execute with temporary C string.
Execute with temporary C string and length.
Convert Char to CChar.
Convert CChar to Char.
Create stable pointer.
Dereference stable pointer.
Free stable pointer.
Cast stable pointer to raw pointer.
Cast raw pointer to stable pointer.
Free function pointer wrapper.
Call function pointer dynamically.
Get current errno.
Reset errno to zero.
Throw IO error based on errno.
Throw if predicate holds.
Throw if result is -1.
Throw if result is null.
Throw with path information.
Throw with path if predicate holds.
Import C function (compile-time).
Export Haskell function to C (compile-time).
Perform IO unsafely.
Interleave IO lazily.
Perform IO unsafely (may be duplicated).
Create local mutable state.