on master help sign in
Fix some warnings
commitb33dd6fb51322f9ad78b12dc1acd7be09035f838 authorMichael Snoyman <michael@snoyman.com> dateWed 18 Jan 2012, 12:24 (15 years ago) parent1d3b791
1 file changed+2−9
Text/Libyaml.hs+2−9
Text/Libyaml.hs+2−9
@@ -40,7 +40,6 @@ import Foreign.Marshal.Alloc
4040import Data.Data
4141
4242import Control.Monad.IO.Class
43−import Control.Monad.Trans.Class (lift)
4443
4544import Control.Exception (throwIO, Exception, finally)
4645import Control.Applicative
@@ -152,12 +151,6 @@ foreign import ccall unsafe "fclose"
152151foreign import ccall unsafe "fclose_helper"
153152 c_fclose_helper :: File -> IO ()
154153
155−withForeignPtr' :: MonadIO m => ForeignPtr a -> (Ptr a -> m b) -> m b
156−withForeignPtr' fp f = do
157− r <- f $ unsafeForeignPtrToPtr fp
158− liftIO $ touchForeignPtr fp
159− return r
160−
161154foreign import ccall unsafe "yaml_parser_parse"
162155 c_yaml_parser_parse :: Parser -> EventRaw -> IO CInt
163156
@@ -560,7 +553,7 @@ encodeFile :: ResourceIO m
560553 => FilePath
561554 -> C.Sink Event m ()
562555encodeFile filePath = C.Sink $ do
563− (releaseKey, file) <- flip withIO c_fclose $ do
556+ (_releaseKey, file) <- flip withIO c_fclose $ do
564557 file <- liftIO $ withCString filePath $
565558 \filePath' -> withCString "w" $
566559 \w' -> c_fopen filePath' w'
@@ -590,7 +583,7 @@ runEmitter allocI closeI =
590583 c_yaml_emitter_delete emitter
591584 free emitter
592585 push (emitter, _) e = do
593− liftIO $ toEventRaw e $ c_yaml_emitter_emit emitter
586+ _ <- liftIO $ toEventRaw e $ c_yaml_emitter_emit emitter
594587 return C.Processing
595588 close (_, a) = liftIO $ closeI a
596589