Fix warnings in 16 modules, mostly forward compatibility warnings from GHC 7.8

This commit is contained in:
hallgren
2014-08-13 22:16:18 +00:00
parent a06351b625
commit cd5193b7e1
16 changed files with 91 additions and 34 deletions

View File

@@ -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