@@ -4,8 +4,6 @@
44{-# LANGUAGE FlexibleContexts #-}
55{-# LANGUAGE FlexibleInstances #-}
66{-# LANGUAGE MultiParamTypeClasses #-}
7−{-# LANGUAGE PackageImports #-}
8−{-# LANGUAGE GeneralizedNewtypeDeriving #-}
97{-# LANGUAGE RankNTypes #-}
108{-# LANGUAGE CPP #-}
119{-# LANGUAGE TypeFamilies #-}
@@ -48,13 +46,12 @@ import Data.Data
4846
4947import Control.Monad.IO.Class
5048
51−import Control.Exception (throwIO, Exception, finally)
49+import Control.Exception (mask_, throwIO, Exception, finally)
5250#if !MIN_VERSION_base(4,8,0)
5351import Control.Applicative
5452#endif
5553import Control.Monad.Trans.Resource
5654import Data.Conduit hiding (Source, Sink, Conduit)
57−import Control.Exception (mask_)
5855
5956data Event =
6057 EventStreamStart
@@ -267,20 +264,20 @@ getEvent er = do
267264 yanchor <- c_get_scalar_anchor er
268265 anchor <- if yanchor == nullPtr
269266 then return Nothing
270− else fmap Just $ peekCString yanchor
267+ else Just <$> peekCString yanchor
271268 return $ Just $ EventScalar bs (bsToTag tagbs) style anchor
272269 YamlSequenceStartEvent -> do
273270 yanchor <- c_get_sequence_start_anchor er
274271 anchor <- if yanchor == nullPtr
275272 then return Nothing
276− else fmap Just $ peekCString yanchor
273+ else Just <$> peekCString yanchor
277274 return $ Just $ EventSequenceStart anchor
278275 YamlSequenceEndEvent -> return $ Just EventSequenceEnd
279276 YamlMappingStartEvent -> do
280277 yanchor <- c_get_mapping_start_anchor er
281278 anchor <- if yanchor == nullPtr
282279 then return Nothing
283− else fmap Just $ peekCString yanchor
280+ else Just <$> peekCString yanchor
284281 return $ Just $ EventMappingStart anchor
285282 YamlMappingEndEvent -> return $ Just EventMappingEnd
286283
@@ -605,7 +602,7 @@ encodeFile filePath =
605602 file <- withCString filePath $
606603 \filePath' -> withCString "w" $
607604 \w' -> c_fopen filePath' w'
608− if (file == nullPtr)
605+ if file == nullPtr
609606 then throwIO $ YamlException $ "could not open file for write: " ++ filePath
610607 else return file
611608