summaryrefslogtreecommitdiff
path: root/libraries/base/Foreign
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-04-03 14:55:50 +0100
committerIan Lynagh <igloo@earth.li>2011-04-03 14:55:50 +0100
commit94639222f6a4f86ee3acfa4822e566e190392533 (patch)
tree79ab40c02c3624cea0d68da5a52cef1a981cf5e8 /libraries/base/Foreign
parent5534946929ff20d52b04b582a079860a8d089661 (diff)
downloadhaskell-94639222f6a4f86ee3acfa4822e566e190392533.tar.gz
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 <v.dijk.bas@gmail.com> * Generalize the type of Foreign.Marshal.Utils.maybeNew This makes it consistent with maybeWith
Diffstat (limited to 'libraries/base/Foreign')
-rw-r--r--libraries/base/Foreign/Marshal/Utils.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/libraries/base/Foreign/Marshal/Utils.hs b/libraries/base/Foreign/Marshal/Utils.hs
index 5ae677a19d..bf9bdb3c8b 100644
--- a/libraries/base/Foreign/Marshal/Utils.hs
+++ b/libraries/base/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