diff options
Diffstat (limited to 'compiler/codeGen/StgCmmExtCode.hs')
-rw-r--r-- | compiler/codeGen/StgCmmExtCode.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/codeGen/StgCmmExtCode.hs b/compiler/codeGen/StgCmmExtCode.hs index e710204222..df1733978f 100644 --- a/compiler/codeGen/StgCmmExtCode.hs +++ b/compiler/codeGen/StgCmmExtCode.hs @@ -48,6 +48,9 @@ import Module import UniqFM import Unique +import Control.Monad (liftM, ap) +import Control.Applicative (Applicative(..)) + -- | The environment contains variable definitions or blockids. data Named @@ -76,6 +79,13 @@ returnExtFC a = EC $ \_ s -> return (s, a) thenExtFC :: CmmParse a -> (a -> CmmParse b) -> CmmParse b thenExtFC (EC m) k = EC $ \e s -> do (s',r) <- m e s; unEC (k r) e s' +instance Functor CmmParse where + fmap = liftM + +instance Applicative CmmParse where + pure = return + (<*>) = ap + instance Monad CmmParse where (>>=) = thenExtFC return = returnExtFC |