diff options
Diffstat (limited to 'compiler/cmm/CmmLint.hs')
| -rw-r--r-- | compiler/cmm/CmmLint.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/cmm/CmmLint.hs b/compiler/cmm/CmmLint.hs index 92a137b98b..970ce68149 100644 --- a/compiler/cmm/CmmLint.hs +++ b/compiler/cmm/CmmLint.hs @@ -21,6 +21,8 @@ import Outputable import DynFlags import Data.Maybe +import Control.Monad (liftM, ap) +import Control.Applicative (Applicative(..)) -- Things to check: -- - invariant on CmmBlock in CmmExpr (see comment there) @@ -207,6 +209,13 @@ checkCond _ expr newtype CmmLint a = CmmLint { unCL :: DynFlags -> Either SDoc a } +instance Functor CmmLint where + fmap = liftM + +instance Applicative CmmLint where + pure = return + (<*>) = ap + instance Monad CmmLint where CmmLint m >>= k = CmmLint $ \dflags -> case m dflags of |
