Generalize the type of Foreign.Marshal.Utils.maybeNew; fixes trac #5044
authorIan Lynagh <igloo@earth.li>
Sun, 3 Apr 2011 13:55:50 +0000 (14:55 +0100)
committerIan Lynagh <igloo@earth.li>
Sun, 3 Apr 2011 13:55:50 +0000 (14:55 +0100)
git conversion of:
Tue Mar  8 22:31:07 CET 2011  Bas van Dijk <v.dijk.bas@gmail.com>
  * Generalize the type of Foreign.Marshal.Utils.maybeNew
  This makes it consistent with maybeWith

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