summaryrefslogtreecommitdiff
path: root/compiler/stgSyn
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2013-09-11 18:46:54 -0500
committerAustin Seipp <austin@well-typed.com>2013-09-11 18:47:15 -0500
commitb20cf4ecbf244f091f4084c11ae2350d248ce6ef (patch)
treed595c6c632773bb4110468c23467f0b339096538 /compiler/stgSyn
parent1ef941a82eafb8f22c19e2643685679d2454c24a (diff)
downloadhaskell-b20cf4ecbf244f091f4084c11ae2350d248ce6ef.tar.gz
Fix AMP warnings.
Authored-by: David Luposchainsky <dluposchainsky@gmail.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'compiler/stgSyn')
-rw-r--r--compiler/stgSyn/CoreToStg.lhs9
-rw-r--r--compiler/stgSyn/StgLint.lhs8
2 files changed, 17 insertions, 0 deletions
diff --git a/compiler/stgSyn/CoreToStg.lhs b/compiler/stgSyn/CoreToStg.lhs
index c87de4e65f..80b81a68e4 100644
--- a/compiler/stgSyn/CoreToStg.lhs
+++ b/compiler/stgSyn/CoreToStg.lhs
@@ -44,6 +44,8 @@ import ForeignCall
import Demand ( isSingleUsed )
import PrimOp ( PrimCall(..) )
+import Control.Monad (liftM, ap)
+
-- Note [Live vs free]
-- ~~~~~~~~~~~~~~~~~~~
--
@@ -982,6 +984,13 @@ thenLne :: LneM a -> (a -> LneM b) -> LneM b
thenLne m k = LneM $ \env lvs_cont
-> unLneM (k (unLneM m env lvs_cont)) env lvs_cont
+instance Functor LneM where
+ fmap = liftM
+
+instance Applicative LneM where
+ pure = return
+ (<*>) = ap
+
instance Monad LneM where
return = returnLne
(>>=) = thenLne
diff --git a/compiler/stgSyn/StgLint.lhs b/compiler/stgSyn/StgLint.lhs
index 3509a83849..04349db3df 100644
--- a/compiler/stgSyn/StgLint.lhs
+++ b/compiler/stgSyn/StgLint.lhs
@@ -25,6 +25,7 @@ import Util
import SrcLoc
import Outputable
import FastString
+import Control.Applicative ( Applicative(..) )
import Control.Monad
import Data.Function
@@ -319,6 +320,13 @@ initL (LintM m)
Just (vcat (punctuate blankLine (bagToList errs)))
}
+instance Functor LintM where
+ fmap = liftM
+
+instance Applicative LintM where
+ pure = return
+ (<*>) = ap
+
instance Monad LintM where
return a = LintM $ \_loc _scope errs -> (a, errs)
(>>=) = thenL