-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Low-level library bindings, base package. -- -- The bindings-* set of packages contain low level bindings for -- established libraries, and is aimed at developers of higher level -- modules that can use it as foundation. They all mimic the exact names -- and functionality of the original libraries. For a specific library, -- look for package bindings-library_name. @package bindings-common @version 0.1.2 module Bindings.C data Timeval instance Storable Timeval module Bindings.Utilities -- | Haskell FFI imports global variables as pointers. To ease manipulation -- of such pointers they are encapsulated by GlobalVariable so -- that values can be reached directly, much like in an -- Data.IORef. data (Storable a) => GlobalVariable a writeGlobalVariable :: (Storable a) => GlobalVariable a -> a -> IO () readGlobalVariable :: (Storable a) => GlobalVariable a -> IO a -- | When libraries provide types for functions those types are made -- instances of class Callback. That class is used to exchange -- between Haskell functions and a representation (i.e., a hidden -- pointer) that can be used or is provided by foreign code. class (Storable cb) => Callback cb where { type family F cb :: *; { withCallback f c = do { made <- makeCallback f; result <- c made; freeCallback made; return result } } } nullCallback :: (Callback cb) => cb makeCallback :: (Callback cb) => F cb -> IO cb freeCallback :: (Callback cb) => cb -> IO () withCallback :: (Callback cb) => F cb -> (cb -> IO a) -> IO a -- | | Modules under Bindings are supposed to be low level links to -- well-known libraries. All of them follow the same style for -- consistency and predictability. Here are a few rules that have been -- followed: -- -- -- -- These modules are supposed to be used by developers of higher level -- modules, who should have a good understanding of the undeline -- libraries they decide to use. Of course, you can use them directly if -- you know what you are doing. module Bindings