final revision to GArrow classes
[ghc-base.git] / Foreign / Marshal / Utils.hs
index d800afe..bf9bdb3 100644 (file)
@@ -1,4 +1,5 @@
-{-# OPTIONS_GHC -XNoImplicitPrelude #-}
+{-# LANGUAGE CPP, NoImplicitPrelude, ForeignFunctionInterface #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Foreign.Marshal.Utils
@@ -113,12 +114,12 @@ toBool  = (/= 0)
 -- marshalling of Maybe values
 -- ---------------------------
 
--- |Allocate storage and marshall a storable value wrapped into a 'Maybe'
+-- |Allocate storage and marshal a storable value wrapped into a 'Maybe'
 --
 -- * 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
@@ -158,14 +159,14 @@ withMany withFoo (x:xs) f = withFoo x $ \x' ->
 -- first (destination); the copied areas may /not/ overlap
 --
 copyBytes               :: Ptr a -> Ptr a -> Int -> IO ()
-copyBytes dest src size  = do memcpy dest src (fromIntegral size)
+copyBytes dest src size  = do _ <- memcpy dest src (fromIntegral size)
                               return ()
 
 -- |Copies the given number of bytes from the second area (source) into the
 -- first (destination); the copied areas /may/ overlap
 --
 moveBytes               :: Ptr a -> Ptr a -> Int -> IO ()
-moveBytes dest src size  = do memmove dest src (fromIntegral size)
+moveBytes dest src size  = do _ <- memmove dest src (fromIntegral size)
                               return ()