on master help sign in
Drop enclosed-exceptions dep
commit3c727d444167da330262f705260a6b6fc231c771 authorMichael Snoyman <michael@snoyman.com> dateThu 16 Feb 2017, 19:25 (10 years ago) parent74bdc16
2 files changed+5−4
Data/Yaml/Internal.hs+5−3 yaml.cabal−1
Data/Yaml/Internal.hs+5−3
@@ -17,7 +17,6 @@ module Data.Yaml.Internal
1717import Control.Applicative ((<$>), Applicative(..))
1818#endif
1919import Control.Exception
20−import Control.Exception.Enclosed
2120import Control.Monad (liftM, ap, unless)
2221import Control.Monad.IO.Class (MonadIO, liftIO)
2322import Control.Monad.Trans.Class (MonadTrans, lift)
@@ -253,7 +252,10 @@ decodeHelper :: FromJSON a
253252 => C.Source Parse Y.Event
254253 -> IO (Either ParseException (Either String a))
255254decodeHelper src = do
256− x <- tryAny $ runResourceT $ flip evalStateT Map.empty $ src C.$$ parse
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.
258+ x <- try $ runResourceT $ flip evalStateT Map.empty $ src C.$$ parse
257259 case x of
258260 Left e
259261 | Just pe <- fromException e -> return $ Left pe
@@ -265,7 +267,7 @@ decodeHelper_ :: FromJSON a
265267 => C.Source Parse Event
266268 -> IO (Either ParseException a)
267269decodeHelper_ src = do
268− x <- tryAny $ runResourceT $ flip evalStateT Map.empty $ src C.$$ parse
270+ x <- try $ runResourceT $ flip evalStateT Map.empty $ src C.$$ parse
269271 return $ case x of
270272 Left e
271273 | Just pe <- fromException e -> Left pe
yaml.cabal−1
@@ -59,7 +59,6 @@ library
5959 , scientific
6060 , filepath
6161 , directory
62− , enclosed-exceptions
6362 , semigroups
6463 exposed-modules: Text.Libyaml
6564 Data.Yaml