summaryrefslogtreecommitdiff
path: root/src/runtime/haskell/PGF
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/runtime/haskell/PGF
parenta06351b6250dd456299565f13eba6ed02dd2a07b (diff)
Fix warnings in 16 modules, mostly forward compatibility warnings from GHC 7.8
Diffstat (limited to 'src/runtime/haskell/PGF')
-rw-r--r--src/runtime/haskell/PGF/TypeCheck.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/runtime/haskell/PGF/TypeCheck.hs b/src/runtime/haskell/PGF/TypeCheck.hs
index 0818aeb4a..8860ed17b 100644
--- a/src/runtime/haskell/PGF/TypeCheck.hs
+++ b/src/runtime/haskell/PGF/TypeCheck.hs
@@ -37,6 +37,7 @@ import Data.Map as Map
import Data.IntMap as IntMap
import Data.Maybe as Maybe
import Data.List as List
+import Control.Applicative
import Control.Monad
--import Control.Monad.Identity
import Control.Monad.State
@@ -92,10 +93,18 @@ class Selector s where
splitSelector :: s -> (s,s)
select :: CId -> Scope -> Maybe Int -> TcM s (Expr,TType)
+instance Applicative (TcM s) where
+ pure = return
+ (<*>) = ap
+
instance Monad (TcM s) where
return x = TcM (\abstr k h -> k x)
f >>= g = TcM (\abstr k h -> unTcM f abstr (\x -> unTcM (g x) abstr k h) h)
+instance Selector s => Alternative (TcM s) where
+ empty = mzero
+ (<|>) = mplus
+
instance Selector s => MonadPlus (TcM s) where
mzero = TcM (\abstr k h ms s -> id)
mplus f g = TcM (\abstr k h ms s -> let (s1,s2) = splitSelector s