-{-# OPTIONS_GHC -XNoImplicitPrelude #-}
+{-# LANGUAGE CPP, NoImplicitPrelude, ForeignFunctionInterface #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.Marshal.Utils
-- marshalling of Maybe values
-- ---------------------------
--- |Allocate storage and marshall a storable value wrapped into a 'Maybe'
+-- |Allocate storage and marshal a storable value wrapped into a 'Maybe'
--
-- * the 'nullPtr' is used to represent 'Nothing'
--
-maybeNew :: ( a -> IO (Ptr a))
- -> (Maybe a -> IO (Ptr a))
+maybeNew :: ( a -> IO (Ptr b))
+ -> (Maybe a -> IO (Ptr b))
maybeNew = maybe (return nullPtr)
-- |Converts a @withXXX@ combinator into one marshalling a value wrapped