-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | FFI domain specific language, on top of hsc2hs.
--   
--   This is a set of macros to be used when writing Haskell FFI. They were
--   designed to be able to fully describe C interfaces, so that hsc2hs can
--   extract from them all Haskell code needed to mimic such interfaces.
--   All Haskell names used are automatically derived from C names,
--   structures are mapped to Haskell instances of Storable, and there are
--   also macros you can use with C code to help write bindings to inline
--   functions or macro functions. Documentation is available at package
--   homepage:
--   
--   <a>https://github.com/jwiegley/bindings-dsl/wiki</a>
--   
--   The extra module Bindings.Utilities will contain tools that may be
--   convenient when working with FFI.
@package bindings-DSL
@version 1.0.24

module Bindings.Utilities

-- | <a>storableCast</a> works like <a>storableCastArray</a>, except that
--   it takes a single value and returns a single value.
storableCast :: (Storable a, Storable b) => a -> IO b

-- | <a>storableCastArray</a> takes a list of values of a first type,
--   stores it at a contiguous memory area (that is first blanked with 0s),
--   and then reads it as if it was a list of a second type, with enough
--   elements to fill at least the same space.
--   
--   <pre>
--   ghci
--   :m + Bindings.Sandbox Data.Int
--   storableCastArray (replicate 13 (1::Int8)) :: IO [Int32]
--           ==&gt; [16843009,16843009,16843009,1]
--   </pre>
storableCastArray :: (Storable a, Storable b) => [a] -> IO [b]
