Generalize the type of Foreign.Marshal.Utils.maybeNew; fixes trac #5044
[ghc-base.git] / Foreign / Marshal / Utils.hs
index 5ae677a..bf9bdb3 100644 (file)
@@ -118,8 +118,8 @@ toBool  = (/= 0)
 --
 -- * 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