From 4fcef0cb2b7c51963b990773a5bbec8a3f73adef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Wed, 13 Aug 2014 18:04:37 +0200 Subject: [PATCH] Reset DynFlags properly in `withCmdFlags` teardown --- Language/Haskell/GhcMod/DynFlags.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Language/Haskell/GhcMod/DynFlags.hs b/Language/Haskell/GhcMod/DynFlags.hs index 74c3ee5..5cf9153 100644 --- a/Language/Haskell/GhcMod/DynFlags.hs +++ b/Language/Haskell/GhcMod/DynFlags.hs @@ -88,8 +88,8 @@ withCmdFlags :: GhcMonad m => [GHCOption] -> m a -> m a withCmdFlags flags body = G.gbracket setup teardown (\_ -> body) where setup = do - dflags <- G.getSessionDynFlags >>= addCmdOpts flags - void $ G.setSessionDynFlags dflags + dflags <- G.getSessionDynFlags + void $ G.setSessionDynFlags =<< addCmdOpts flags dflags return dflags teardown = void . G.setSessionDynFlags