mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
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.
This commit is contained in:
3
gf.cabal
3
gf.cabal
@@ -297,6 +297,9 @@ Library
|
||||
else
|
||||
build-tools: happy, alex>=3
|
||||
|
||||
if impl(ghc>=7.10)
|
||||
ghc-options: -fno-warn-tabs
|
||||
|
||||
if os(windows)
|
||||
build-depends: Win32
|
||||
else
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
module GF.Compile.CFGtoPGF (cf2pgf) where
|
||||
|
||||
import GF.Grammar.CFG
|
||||
|
||||
@@ -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) []
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE BangPatterns #-}
|
||||
{-# LANGUAGE BangPatterns, FlexibleContexts #-}
|
||||
module GF.Compile.GrammarToPGF (mkCanon2pgf) where
|
||||
|
||||
--import GF.Compile.Export
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
-- exports a GF grammar into a Python module
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
module GF.Compile.PGFtoPython (pgf2python) where
|
||||
|
||||
import PGF(showCId)
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
--
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
module GF.Compile.SubExOpt (subexpModule,unsubexpModule) where
|
||||
|
||||
import GF.Grammar.Grammar
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
--
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
module GF.Grammar.Printer
|
||||
( -- ** Pretty printing
|
||||
TermPrintQual(..)
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
--
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
module GF.Speech.SLF (slfPrinter,slfGraphvizPrinter,
|
||||
slfSubPrinter,slfSubGraphvizPrinter) where
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
module PGF.Linearize
|
||||
( linearize
|
||||
, linearizeAll
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE BangPatterns, RankNTypes #-}
|
||||
{-# LANGUAGE BangPatterns, RankNTypes, FlexibleContexts #-}
|
||||
module PGF.Parse
|
||||
( ParseState
|
||||
, ErrorState
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
module PGF.Printer (ppPGF,ppCat,ppFId,ppFunId,ppSeqId,ppSeq,ppFun) where
|
||||
|
||||
import PGF.CId
|
||||
|
||||
@@ -9,6 +9,7 @@ module PGF.Tokenizer
|
||||
( mkTokenizer
|
||||
) where
|
||||
|
||||
import Prelude hiding ((<*>))
|
||||
--import Data.List (intercalate)
|
||||
--import Test.QuickCheck
|
||||
import FST.TransducerInterface
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user