[commit: base] master: Generalize the type of Foreign.Marshal.Utils.maybeNew; fixes trac #5044 (b27b90f)
Ian Lynagh
igloo at earth.li
Sun Apr 3 17:37:19 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/base
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/b27b90f0e55518313d9611fbc4381b4b73121975
>---------------------------------------------------------------
commit b27b90f0e55518313d9611fbc4381b4b73121975
Author: Ian Lynagh <igloo at earth.li>
Date: Sun Apr 3 14:55:50 2011 +0100
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 at gmail.com>
* Generalize the type of Foreign.Marshal.Utils.maybeNew
This makes it consistent with maybeWith
>---------------------------------------------------------------
Foreign/Marshal/Utils.hs | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
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
More information about the Libraries
mailing list