Commit 6f050d9c authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Add TcRnMonad.unlessXOptM

This usefully joins whenXOptM; there are probably lots of places
we should use it!

This patch does not use new new function at all; but it's preparing
for an upcoming patch when I do use it.
parent 547e4c03
......@@ -19,7 +19,8 @@ module TcRnMonad(
getEnvs, setEnvs,
xoptM, doptM, goptM, woptM,
setXOptM, unsetXOptM, unsetGOptM, unsetWOptM,
whenDOptM, whenGOptM, whenWOptM, whenXOptM,
whenDOptM, whenGOptM, whenWOptM,
whenXOptM, unlessXOptM,
getGhcMode,
withDoDynamicToo,
getEpsVar,
......@@ -499,6 +500,10 @@ whenXOptM :: LangExt.Extension -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
whenXOptM flag thing_inside = do b <- xoptM flag
when b thing_inside
unlessXOptM :: LangExt.Extension -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
unlessXOptM flag thing_inside = do b <- xoptM flag
unless b thing_inside
getGhcMode :: TcRnIf gbl lcl GhcMode
getGhcMode = do { env <- getTopEnv; return (ghcMode (hsc_dflags env)) }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment