\section[Simplify]{The main module of the simplifier}
\begin{code}
+{-# OPTIONS -w #-}
+-- The above warning supression flag is a temporary kludge.
+-- While working on this module you are encouraged to remove it and fix
+-- any warnings in the module. See
+-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
+-- for details
+
module Simplify ( simplTopBinds, simplExpr ) where
#include "HsVersions.h"
-- See notes with SimplMonad.inlineMode
simplNote env InlineMe e cont
- | contIsRhsOrArg cont -- Totally boring continuation; see notes above
+ | Just (inside, outside) <- splitInlineCont cont -- Boring boring continuation; see notes above
= do { -- Don't inline inside an INLINE expression
- e' <- simplExpr (setMode inlineMode env) e
- ; rebuild env (mkInlineMe e') cont }
+ e' <- simplExprC (setMode inlineMode env) e inside
+ ; rebuild env (mkInlineMe e') outside }
| otherwise -- Dissolve the InlineMe note if there's
-- an interesting context of any kind to combine with