@@ -91,14 +91,15 @@ import Data.Scientific (fromFloatDigits)
9191#else
9292import Data.Attoparsec.Number
9393#endif
94+import Control.Monad.Trans.Resource (ResourceT, runResourceT)
9495
9596encode :: ToJSON a => a -> ByteString
9697encode obj = unsafePerformIO $
97− C.runResourceT $ CL.sourceList (objToEvents $ toJSON obj)
98+ runResourceT $ CL.sourceList (objToEvents $ toJSON obj)
9899 C.$$ Y.encode
99100
100101encodeFile :: ToJSON a => FilePath -> a -> IO ()
101−encodeFile fp obj = C.runResourceT
102+encodeFile fp obj = runResourceT
102103 $ CL.sourceList (objToEvents $ toJSON obj)
103104 C.$$ Y.encodeFile fp
104105
@@ -187,7 +188,7 @@ instance MonadTrans PErrorT where
187188instance MonadIO m => MonadIO (PErrorT m) where
188189 liftIO = lift . liftIO
189190
190−type Parse = StateT (Map.Map String Value) (C.ResourceT IO)
191+type Parse = StateT (Map.Map String Value) (ResourceT IO)
191192
192193requireEvent :: Event -> C.Sink Event Parse ()
193194requireEvent e = do
@@ -320,7 +321,7 @@ decodeFileEither
320321 => FilePath
321322 -> IO (Either ParseException a)
322323decodeFileEither fp = do
323− x <- try $ C.runResourceT $ flip evalStateT Map.empty $ Y.decodeFile fp C.$$ parse
324+ x <- try $ runResourceT $ flip evalStateT Map.empty $ Y.decodeFile fp C.$$ parse
324325 case x of
325326 Left e
326327 | Just pe <- fromException e -> return $ Left pe
@@ -356,7 +357,7 @@ decodeHelper :: FromJSON a
356357 => C.Source Parse Y.Event
357358 -> IO (Either ParseException (Either String a))
358359decodeHelper src = do
359− x <- try $ C.runResourceT $ flip evalStateT Map.empty $ src C.$$ parse
360+ x <- try $ runResourceT $ flip evalStateT Map.empty $ src C.$$ parse
360361 case x of
361362 Left e
362363 | Just pe <- fromException e -> return $ Left pe