From: Ian Lynagh Date: Sun, 3 Apr 2011 13:55:50 +0000 (+0100) Subject: Generalize the type of Foreign.Marshal.Utils.maybeNew; fixes trac #5044 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b27b90f0e55518313d9611fbc4381b4b73121975;p=ghc-base.git Generalize the type of Foreign.Marshal.Utils.maybeNew; fixes trac #5044 git conversion of: Tue Mar 8 22:31:07 CET 2011 Bas van Dijk * Generalize the type of Foreign.Marshal.Utils.maybeNew This makes it consistent with maybeWith --- diff --git a/Foreign/Marshal/Utils.hs b/Foreign/Marshal/Utils.hs index 5ae677a..bf9bdb3 100644 --- a/Foreign/Marshal/Utils.hs +++ b/Foreign/Marshal/Utils.hs @@ -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