summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2015-02-16 15:05:06 +0000
committerhallgren <hallgren@chalmers.se>2015-02-16 15:05:06 +0000
commit54ae70a81e338fd05397ab22890b3ca36284be54 (patch)
treec6757f0c7f0d90a39329a2180ad1df33a99e384b /src
parent2b8fe8ea7a4f40445889b80bd7f737d0078e7598 (diff)
Changes for compatibility with ghc-7.10-rc2
2 modules: Name clashes caused by Applicative-Monad change in Prelude 2 modules: Ambiguities caused by Foldable/Traversable in Prelude 2 modules: Backwards incompatible changes in time-1.5 for defaultTimeLocale 9 modules: {-# LANGUAGE FlexibleContexts #-} (because GHC checks inferred types now, in addition to explicitly given type signatures) Also silenced warnings about tab characters in source files.
Diffstat (limited to 'src')
-rw-r--r--src/binary/Data/Binary/Builder.hs3
-rw-r--r--src/compiler/GF/Compile/CFGtoPGF.hs1
-rw-r--r--src/compiler/GF/Compile/Compute/Predef.hs7
-rw-r--r--src/compiler/GF/Compile/GrammarToPGF.hs2
-rw-r--r--src/compiler/GF/Compile/PGFtoPython.hs1
-rw-r--r--src/compiler/GF/Compile/SubExOpt.hs1
-rw-r--r--src/compiler/GF/Grammar/Printer.hs1
-rw-r--r--src/compiler/GF/Infra/CheckM.hs2
-rw-r--r--src/compiler/GF/Server.hs4
-rw-r--r--src/compiler/GF/Speech/SLF.hs1
-rw-r--r--src/runtime/c/INSTALL2
-rw-r--r--src/runtime/haskell/PGF/Linearize.hs1
-rw-r--r--src/runtime/haskell/PGF/Parse.hs2
-rw-r--r--src/runtime/haskell/PGF/Printer.hs1
-rw-r--r--src/runtime/haskell/PGF/Tokenizer.hs1
-rw-r--r--src/server/PGFService.hs4
16 files changed, 26 insertions, 8 deletions
diff --git a/src/binary/Data/Binary/Builder.hs b/src/binary/Data/Binary/Builder.hs
index 18b45763c..bc172d976 100644
--- a/src/binary/Data/Binary/Builder.hs
+++ b/src/binary/Data/Binary/Builder.hs
@@ -54,6 +54,7 @@ module Data.Binary.Builder (
) where
+import Prelude hiding (empty)
import Foreign(Word,Word8,Ptr,Storable,ForeignPtr,withForeignPtr,poke,plusPtr,sizeOf)
import System.IO.Unsafe(unsafePerformIO)
import Data.Monoid
@@ -71,7 +72,7 @@ import qualified Data.ByteString.Internal as S
#endif
#if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)
-import GHC.Base
+import GHC.Base(Int(..),uncheckedShiftRL# )
import GHC.Word (Word32(..),Word16(..),Word64(..))
#if WORD_SIZE_IN_BITS < 64 && __GLASGOW_HASKELL__ >= 608
diff --git a/src/compiler/GF/Compile/CFGtoPGF.hs b/src/compiler/GF/Compile/CFGtoPGF.hs
index aebf918bb..5f8ddebb6 100644
--- a/src/compiler/GF/Compile/CFGtoPGF.hs
+++ b/src/compiler/GF/Compile/CFGtoPGF.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE FlexibleContexts #-}
module GF.Compile.CFGtoPGF (cf2pgf) where
import GF.Grammar.CFG
diff --git a/src/compiler/GF/Compile/Compute/Predef.hs b/src/compiler/GF/Compile/Compute/Predef.hs
index ba215ba30..768dc2e6b 100644
--- a/src/compiler/GF/Compile/Compute/Predef.hs
+++ b/src/compiler/GF/Compile/Compute/Predef.hs
@@ -93,7 +93,7 @@ delta f vs =
Occurs -> fromNonExist vs PFalse (ap2 occurs)
ToUpper -> fromNonExist vs NonExist (ap1 (map toUpper))
ToLower -> fromNonExist vs NonExist (ap1 (map toLower))
- IsUpper -> fromNonExist vs PFalse (ap1 (all isUpper))
+ IsUpper -> fromNonExist vs PFalse (ap1 (all' isUpper))
Length -> fromNonExist vs (0::Int) (ap1 (length::String->Int))
Plus -> ap2 ((+)::Int->Int->Int)
EqInt -> ap2 ((==)::Int->Int->Bool)
@@ -131,8 +131,9 @@ delta f vs =
tk i s = take (max 0 (length s - i)) s :: String
dp i s = drop (max 0 (length s - i)) s :: String
- occur s t = isInfixOf (s::String) t
- occurs s t = any (`elem` t) (s::String)
+ occur s t = isInfixOf (s::String) (t::String)
+ occurs s t = any (`elem` (t::String)) (s::String)
+ all' = all :: (a->Bool) -> [a] -> Bool
boolV b = VCApp (cPredef,if b then cPTrue else cPFalse) []
diff --git a/src/compiler/GF/Compile/GrammarToPGF.hs b/src/compiler/GF/Compile/GrammarToPGF.hs
index ba400bc82..989b651bb 100644
--- a/src/compiler/GF/Compile/GrammarToPGF.hs
+++ b/src/compiler/GF/Compile/GrammarToPGF.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE BangPatterns, FlexibleContexts #-}
module GF.Compile.GrammarToPGF (mkCanon2pgf) where
--import GF.Compile.Export
diff --git a/src/compiler/GF/Compile/PGFtoPython.hs b/src/compiler/GF/Compile/PGFtoPython.hs
index 01b6437ac..10ff5a7cc 100644
--- a/src/compiler/GF/Compile/PGFtoPython.hs
+++ b/src/compiler/GF/Compile/PGFtoPython.hs
@@ -6,6 +6,7 @@
-- exports a GF grammar into a Python module
-----------------------------------------------------------------------------
+{-# LANGUAGE FlexibleContexts #-}
module GF.Compile.PGFtoPython (pgf2python) where
import PGF(showCId)
diff --git a/src/compiler/GF/Compile/SubExOpt.hs b/src/compiler/GF/Compile/SubExOpt.hs
index d1c7842ad..09ec3e568 100644
--- a/src/compiler/GF/Compile/SubExOpt.hs
+++ b/src/compiler/GF/Compile/SubExOpt.hs
@@ -21,6 +21,7 @@
--
-----------------------------------------------------------------------------
+{-# LANGUAGE FlexibleContexts #-}
module GF.Compile.SubExOpt (subexpModule,unsubexpModule) where
import GF.Grammar.Grammar
diff --git a/src/compiler/GF/Grammar/Printer.hs b/src/compiler/GF/Grammar/Printer.hs
index 0bf6ce504..341ff3863 100644
--- a/src/compiler/GF/Grammar/Printer.hs
+++ b/src/compiler/GF/Grammar/Printer.hs
@@ -7,6 +7,7 @@
--
-----------------------------------------------------------------------------
+{-# LANGUAGE FlexibleContexts #-}
module GF.Grammar.Printer
( -- ** Pretty printing
TermPrintQual(..)
diff --git a/src/compiler/GF/Infra/CheckM.hs b/src/compiler/GF/Infra/CheckM.hs
index 43c43ba27..3b6833f0f 100644
--- a/src/compiler/GF/Infra/CheckM.hs
+++ b/src/compiler/GF/Infra/CheckM.hs
@@ -75,7 +75,7 @@ checkCond s b = if b then return () else checkError s
checkWarn :: Message -> Check ()
checkWarn msg = Check $ \{-ctxt-} (es,ws) -> ((es,("Warning:" <+> msg) : ws),Success ())
-checkWarnings = mapM_ checkWarn
+checkWarnings ms = mapM_ checkWarn ms
-- | Report a nonfatal (accumulated) error
checkAccumError :: Message -> Check ()
diff --git a/src/compiler/GF/Server.hs b/src/compiler/GF/Server.hs
index ce1c1fd0c..34a8c6e57 100644
--- a/src/compiler/GF/Server.hs
+++ b/src/compiler/GF/Server.hs
@@ -16,7 +16,11 @@ import GF.System.Directory(doesDirectoryExist,doesFileExist,createDirectory,
getDirectoryContents,removeFile,removeDirectory,
getModificationTime)
import Data.Time (getCurrentTime,formatTime)
+#if MIN_VERSION_time(1,5,0)
+import Data.Time.Format(defaultTimeLocale,rfc822DateFormat)
+#else
import System.Locale(defaultTimeLocale,rfc822DateFormat)
+#endif
import System.FilePath(dropExtension,takeExtension,takeFileName,takeDirectory,
(</>),makeRelative)
#ifndef mingw32_HOST_OS
diff --git a/src/compiler/GF/Speech/SLF.hs b/src/compiler/GF/Speech/SLF.hs
index d93d1b362..1992baaec 100644
--- a/src/compiler/GF/Speech/SLF.hs
+++ b/src/compiler/GF/Speech/SLF.hs
@@ -9,6 +9,7 @@
--
-----------------------------------------------------------------------------
+{-# LANGUAGE FlexibleContexts #-}
module GF.Speech.SLF (slfPrinter,slfGraphvizPrinter,
slfSubPrinter,slfSubGraphvizPrinter) where
diff --git a/src/runtime/c/INSTALL b/src/runtime/c/INSTALL
index e2bae218a..7f2e1a6ee 100644
--- a/src/runtime/c/INSTALL
+++ b/src/runtime/c/INSTALL
@@ -12,7 +12,7 @@ grammar you also have to add the option '-literal=Symb' while compiling.
For Linux users
---------------
-You will need the package: libtool
+You will need the package: autoconf, libtool
The compilation steps are:
diff --git a/src/runtime/haskell/PGF/Linearize.hs b/src/runtime/haskell/PGF/Linearize.hs
index 3f11f93d1..2393010b7 100644
--- a/src/runtime/haskell/PGF/Linearize.hs
+++ b/src/runtime/haskell/PGF/Linearize.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE FlexibleContexts #-}
module PGF.Linearize
( linearize
, linearizeAll
diff --git a/src/runtime/haskell/PGF/Parse.hs b/src/runtime/haskell/PGF/Parse.hs
index 11705f326..c62522c1e 100644
--- a/src/runtime/haskell/PGF/Parse.hs
+++ b/src/runtime/haskell/PGF/Parse.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE BangPatterns, RankNTypes #-}
+{-# LANGUAGE BangPatterns, RankNTypes, FlexibleContexts #-}
module PGF.Parse
( ParseState
, ErrorState
diff --git a/src/runtime/haskell/PGF/Printer.hs b/src/runtime/haskell/PGF/Printer.hs
index 2013a3c9c..5022cbb82 100644
--- a/src/runtime/haskell/PGF/Printer.hs
+++ b/src/runtime/haskell/PGF/Printer.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE FlexibleContexts #-}
module PGF.Printer (ppPGF,ppCat,ppFId,ppFunId,ppSeqId,ppSeq,ppFun) where
import PGF.CId
diff --git a/src/runtime/haskell/PGF/Tokenizer.hs b/src/runtime/haskell/PGF/Tokenizer.hs
index ec75853aa..2fa6bcd48 100644
--- a/src/runtime/haskell/PGF/Tokenizer.hs
+++ b/src/runtime/haskell/PGF/Tokenizer.hs
@@ -9,6 +9,7 @@ module PGF.Tokenizer
( mkTokenizer
) where
+import Prelude hiding ((<*>))
--import Data.List (intercalate)
--import Test.QuickCheck
import FST.TransducerInterface
diff --git a/src/server/PGFService.hs b/src/server/PGFService.hs
index b2fd4fc89..c1431fbd9 100644
--- a/src/server/PGFService.hs
+++ b/src/server/PGFService.hs
@@ -21,7 +21,11 @@ import qualified PGF2 as C
import Data.Time.Clock(UTCTime)
import Data.Time.Format(formatTime)
+#if MIN_VERSION_time(1,5,0)
+import Data.Time.Format(defaultTimeLocale,rfc822DateFormat)
+#else
import System.Locale(defaultTimeLocale,rfc822DateFormat)
+#endif
import Text.JSON
import Text.PrettyPrint as PP(render, text, (<+>))
import qualified Codec.Binary.UTF8.String as UTF8 (decodeString)