-{-# OPTIONS_GHC -XNoImplicitPrelude #-}
+{-# LANGUAGE CPP, NoImplicitPrelude, ForeignFunctionInterface #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.Marshal.Utils
--
-- * 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