on master help sign in
Drop enclosed-exceptions dep
3c727d4Michael Snoyman
Data/Yaml/Internal.hs+5−3
@@ -17,7 +17,6 @@ module Data.Yaml.Internal
17import Control.Applicative ((<$>), Applicative(..))
17import Control.Applicative ((<$>), Applicative(..))
18#endif
18#endif
19import Control.Exception
19import Control.Exception
20−import Control.Exception.Enclosed
21import Control.Monad (liftM, ap, unless)
20import Control.Monad (liftM, ap, unless)
22import Control.Monad.IO.Class (MonadIO, liftIO)
21import Control.Monad.IO.Class (MonadIO, liftIO)
23import Control.Monad.Trans.Class (MonadTrans, lift)
22import Control.Monad.Trans.Class (MonadTrans, lift)
@@ -253,7 +252,10 @@ decodeHelper :: FromJSON a
253 => C.Source Parse Y.Event
252 => C.Source Parse Y.Event
254 -> IO (Either ParseException (Either String a))
253 -> IO (Either ParseException (Either String a))
255decodeHelper src = do
254decodeHelper src = do
255+ -- This used to be tryAny, but the fact is that catching async
256+ -- exceptions is fine here. We'll rethrow them immediately in the
257+ -- otherwise clause.
256− x <- tryAny $ runResourceT $ flip evalStateT Map.empty $ src C.$$ parse
258+ x <- try $ runResourceT $ flip evalStateT Map.empty $ src C.$$ parse
257 case x of
259 case x of
258 Left e
260 Left e
259 | Just pe <- fromException e -> return $ Left pe
261 | Just pe <- fromException e -> return $ Left pe
@@ -265,7 +267,7 @@ decodeHelper_ :: FromJSON a
265 => C.Source Parse Event
267 => C.Source Parse Event
266 -> IO (Either ParseException a)
268 -> IO (Either ParseException a)
267decodeHelper_ src = do
269decodeHelper_ src = do
268− x <- tryAny $ runResourceT $ flip evalStateT Map.empty $ src C.$$ parse
270+ x <- try $ runResourceT $ flip evalStateT Map.empty $ src C.$$ parse
269 return $ case x of
271 return $ case x of
270 Left e
272 Left e
271 | Just pe <- fromException e -> Left pe
273 | Just pe <- fromException e -> Left pe
yaml.cabal−1
@@ -59,7 +59,6 @@ library
59 , scientific
59 , scientific
60 , filepath
60 , filepath
61 , directory
61 , directory
62− , enclosed-exceptions
63 , semigroups
62 , semigroups
64 exposed-modules: Text.Libyaml
63 exposed-modules: Text.Libyaml
65 Data.Yaml
64 Data.Yaml