diff options
author | Austin Seipp <austin@well-typed.com> | 2013-09-11 18:46:54 -0500 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2013-09-11 18:47:15 -0500 |
commit | b20cf4ecbf244f091f4084c11ae2350d248ce6ef (patch) | |
tree | d595c6c632773bb4110468c23467f0b339096538 /compiler/ghci | |
parent | 1ef941a82eafb8f22c19e2643685679d2454c24a (diff) | |
download | haskell-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/ghci')
-rw-r--r-- | compiler/ghci/ByteCodeAsm.lhs | 8 | ||||
-rw-r--r-- | compiler/ghci/ByteCodeGen.lhs | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/compiler/ghci/ByteCodeAsm.lhs b/compiler/ghci/ByteCodeAsm.lhs index e3119a7842..dd8bbe4c83 100644 --- a/compiler/ghci/ByteCodeAsm.lhs +++ b/compiler/ghci/ByteCodeAsm.lhs @@ -35,6 +35,7 @@ import Outputable import Platform import Util +import Control.Applicative (Applicative(..)) import Control.Monad import Control.Monad.ST ( runST ) import Control.Monad.Trans.Class @@ -223,6 +224,13 @@ data Assembler a | Emit Word16 [Operand] (Assembler a) | NullAsm a +instance Functor Assembler where + fmap = liftM + +instance Applicative Assembler where + pure = return + (<*>) = ap + instance Monad Assembler where return = NullAsm NullAsm x >>= f = f x diff --git a/compiler/ghci/ByteCodeGen.lhs b/compiler/ghci/ByteCodeGen.lhs index 9c9526de27..ee4895db95 100644 --- a/compiler/ghci/ByteCodeGen.lhs +++ b/compiler/ghci/ByteCodeGen.lhs @@ -55,6 +55,7 @@ import Data.List import Foreign import Foreign.C +import Control.Applicative (Applicative(..)) import Control.Monad import Data.Char @@ -1586,6 +1587,13 @@ thenBc_ (BcM expr) (BcM cont) = BcM $ \st0 -> do returnBc :: a -> BcM a returnBc result = BcM $ \st -> (return (st, result)) +instance Functor BcM where + fmap = liftM + +instance Applicative BcM where + pure = return + (<*>) = ap + instance Monad BcM where (>>=) = thenBc (>>) = thenBc_ |