summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Infra
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2014-08-13 22:16:18 +0000
committerhallgren <hallgren@chalmers.se>2014-08-13 22:16:18 +0000
commitcd5193b7e19e7ff5e49cdeafe149fdeec8e19fb0 (patch)
treec006a3b453b8b290b09379cf5cb2777421558e70 /src/compiler/GF/Infra
parenta06351b6250dd456299565f13eba6ed02dd2a07b (diff)
Fix warnings in 16 modules, mostly forward compatibility warnings from GHC 7.8
Diffstat (limited to 'src/compiler/GF/Infra')
-rw-r--r--src/compiler/GF/Infra/CheckM.hs7
-rw-r--r--src/compiler/GF/Infra/SIO.hs9
-rw-r--r--src/compiler/GF/Infra/UseIO.hs5
3 files changed, 18 insertions, 3 deletions
diff --git a/src/compiler/GF/Infra/CheckM.hs b/src/compiler/GF/Infra/CheckM.hs
index 24fbc3644..80f2409fa 100644
--- a/src/compiler/GF/Infra/CheckM.hs
+++ b/src/compiler/GF/Infra/CheckM.hs
@@ -28,7 +28,8 @@ import qualified Data.Map as Map
import GF.Text.Pretty
import System.FilePath(makeRelative)
import Control.Parallel.Strategies(parList,rseq,using)
-import Control.Monad(liftM)
+import Control.Monad(liftM,ap)
+import Control.Applicative(Applicative(..))
type Message = Doc
type Error = Message
@@ -50,6 +51,10 @@ instance Monad Check where
(ws,Success x) -> unCheck (g x) {-ctxt-} ws
(ws,Fail msg) -> (ws,Fail msg)
+instance Applicative Check where
+ pure = return
+ (<*>) = ap
+
instance ErrorMonad Check where
raise s = checkError (pp s)
handle f h = handle' f (h . render)
diff --git a/src/compiler/GF/Infra/SIO.hs b/src/compiler/GF/Infra/SIO.hs
index ff2072987..39c3da489 100644
--- a/src/compiler/GF/Infra/SIO.hs
+++ b/src/compiler/GF/Infra/SIO.hs
@@ -19,10 +19,11 @@ module GF.Infra.SIO(
restricted,restrictedSystem
) where
import Prelude hiding (putStrLn,print)
-import Control.Monad(liftM)
+import Control.Applicative(Applicative(..))
+import Control.Monad(liftM,ap)
import System.IO(hPutStrLn,hFlush,stdout)
import GF.System.Catch(try)
-import System.Cmd(system)
+import System.Process(system)
import System.Environment(getEnv)
import Control.Concurrent.Chan(newChan,writeChan,getChanContents)
import qualified System.CPUTime as IO(getCPUTime)
@@ -39,6 +40,10 @@ newtype SIO a = SIO {unS::PutStrLn->IO a}
instance Functor SIO where fmap = liftM
+instance Applicative SIO where
+ pure = return
+ (<*>) = ap
+
instance Monad SIO where
return x = SIO (const (return x))
SIO m1 >>= xm2 = SIO $ \ h -> m1 h >>= \ x -> unS (xm2 x) h
diff --git a/src/compiler/GF/Infra/UseIO.hs b/src/compiler/GF/Infra/UseIO.hs
index 17894c682..a0a36ad52 100644
--- a/src/compiler/GF/Infra/UseIO.hs
+++ b/src/compiler/GF/Infra/UseIO.hs
@@ -31,6 +31,7 @@ import System.Exit
import System.CPUTime
--import System.Cmd
import Text.Printf
+import Control.Applicative(Applicative(..))
import Control.Monad
import Control.Monad.Trans(MonadIO(..))
import Control.Exception(evaluate)
@@ -150,6 +151,10 @@ instance ErrorMonad IOE where
instance Functor IOE where fmap = liftM
+instance Applicative IOE where
+ pure = return
+ (<*>) = ap
+
instance Monad IOE where
return a = ioe (return (return a))
IOE c >>= f = IOE $ do