forked from GitHub/gf-core
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
|
else
|
||||||
build-tools: happy, alex>=3
|
build-tools: happy, alex>=3
|
||||||
|
|
||||||
|
if impl(ghc>=7.10)
|
||||||
|
ghc-options: -fno-warn-tabs
|
||||||
|
|
||||||
if os(windows)
|
if os(windows)
|
||||||
build-depends: Win32
|
build-depends: Win32
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ module Data.Binary.Builder (
|
|||||||
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Prelude hiding (empty)
|
||||||
import Foreign(Word,Word8,Ptr,Storable,ForeignPtr,withForeignPtr,poke,plusPtr,sizeOf)
|
import Foreign(Word,Word8,Ptr,Storable,ForeignPtr,withForeignPtr,poke,plusPtr,sizeOf)
|
||||||
import System.IO.Unsafe(unsafePerformIO)
|
import System.IO.Unsafe(unsafePerformIO)
|
||||||
import Data.Monoid
|
import Data.Monoid
|
||||||
@@ -71,7 +72,7 @@ import qualified Data.ByteString.Internal as S
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)
|
#if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)
|
||||||
import GHC.Base
|
import GHC.Base(Int(..),uncheckedShiftRL# )
|
||||||
import GHC.Word (Word32(..),Word16(..),Word64(..))
|
import GHC.Word (Word32(..),Word16(..),Word64(..))
|
||||||
|
|
||||||
#if WORD_SIZE_IN_BITS < 64 && __GLASGOW_HASKELL__ >= 608
|
#if WORD_SIZE_IN_BITS < 64 && __GLASGOW_HASKELL__ >= 608
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
module GF.Compile.CFGtoPGF (cf2pgf) where
|
module GF.Compile.CFGtoPGF (cf2pgf) where
|
||||||
|
|
||||||
import GF.Grammar.CFG
|
import GF.Grammar.CFG
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ delta f vs =
|
|||||||
Occurs -> fromNonExist vs PFalse (ap2 occurs)
|
Occurs -> fromNonExist vs PFalse (ap2 occurs)
|
||||||
ToUpper -> fromNonExist vs NonExist (ap1 (map toUpper))
|
ToUpper -> fromNonExist vs NonExist (ap1 (map toUpper))
|
||||||
ToLower -> fromNonExist vs NonExist (ap1 (map toLower))
|
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))
|
Length -> fromNonExist vs (0::Int) (ap1 (length::String->Int))
|
||||||
Plus -> ap2 ((+)::Int->Int->Int)
|
Plus -> ap2 ((+)::Int->Int->Int)
|
||||||
EqInt -> ap2 ((==)::Int->Int->Bool)
|
EqInt -> ap2 ((==)::Int->Int->Bool)
|
||||||
@@ -131,8 +131,9 @@ delta f vs =
|
|||||||
|
|
||||||
tk i s = take (max 0 (length s - i)) s :: String
|
tk i s = take (max 0 (length s - i)) s :: String
|
||||||
dp i s = drop (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
|
occur s t = isInfixOf (s::String) (t::String)
|
||||||
occurs s t = any (`elem` t) (s::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) []
|
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
|
module GF.Compile.GrammarToPGF (mkCanon2pgf) where
|
||||||
|
|
||||||
--import GF.Compile.Export
|
--import GF.Compile.Export
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
-- exports a GF grammar into a Python module
|
-- exports a GF grammar into a Python module
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
module GF.Compile.PGFtoPython (pgf2python) where
|
module GF.Compile.PGFtoPython (pgf2python) where
|
||||||
|
|
||||||
import PGF(showCId)
|
import PGF(showCId)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
--
|
--
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
module GF.Compile.SubExOpt (subexpModule,unsubexpModule) where
|
module GF.Compile.SubExOpt (subexpModule,unsubexpModule) where
|
||||||
|
|
||||||
import GF.Grammar.Grammar
|
import GF.Grammar.Grammar
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
--
|
--
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
module GF.Grammar.Printer
|
module GF.Grammar.Printer
|
||||||
( -- ** Pretty printing
|
( -- ** Pretty printing
|
||||||
TermPrintQual(..)
|
TermPrintQual(..)
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ checkCond s b = if b then return () else checkError s
|
|||||||
checkWarn :: Message -> Check ()
|
checkWarn :: Message -> Check ()
|
||||||
checkWarn msg = Check $ \{-ctxt-} (es,ws) -> ((es,("Warning:" <+> msg) : ws),Success ())
|
checkWarn msg = Check $ \{-ctxt-} (es,ws) -> ((es,("Warning:" <+> msg) : ws),Success ())
|
||||||
|
|
||||||
checkWarnings = mapM_ checkWarn
|
checkWarnings ms = mapM_ checkWarn ms
|
||||||
|
|
||||||
-- | Report a nonfatal (accumulated) error
|
-- | Report a nonfatal (accumulated) error
|
||||||
checkAccumError :: Message -> Check ()
|
checkAccumError :: Message -> Check ()
|
||||||
|
|||||||
@@ -16,7 +16,11 @@ import GF.System.Directory(doesDirectoryExist,doesFileExist,createDirectory,
|
|||||||
getDirectoryContents,removeFile,removeDirectory,
|
getDirectoryContents,removeFile,removeDirectory,
|
||||||
getModificationTime)
|
getModificationTime)
|
||||||
import Data.Time (getCurrentTime,formatTime)
|
import Data.Time (getCurrentTime,formatTime)
|
||||||
|
#if MIN_VERSION_time(1,5,0)
|
||||||
|
import Data.Time.Format(defaultTimeLocale,rfc822DateFormat)
|
||||||
|
#else
|
||||||
import System.Locale(defaultTimeLocale,rfc822DateFormat)
|
import System.Locale(defaultTimeLocale,rfc822DateFormat)
|
||||||
|
#endif
|
||||||
import System.FilePath(dropExtension,takeExtension,takeFileName,takeDirectory,
|
import System.FilePath(dropExtension,takeExtension,takeFileName,takeDirectory,
|
||||||
(</>),makeRelative)
|
(</>),makeRelative)
|
||||||
#ifndef mingw32_HOST_OS
|
#ifndef mingw32_HOST_OS
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
--
|
--
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
module GF.Speech.SLF (slfPrinter,slfGraphvizPrinter,
|
module GF.Speech.SLF (slfPrinter,slfGraphvizPrinter,
|
||||||
slfSubPrinter,slfSubGraphvizPrinter) where
|
slfSubPrinter,slfSubGraphvizPrinter) where
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ grammar you also have to add the option '-literal=Symb' while compiling.
|
|||||||
For Linux users
|
For Linux users
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
You will need the package: libtool
|
You will need the package: autoconf, libtool
|
||||||
|
|
||||||
The compilation steps are:
|
The compilation steps are:
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
module PGF.Linearize
|
module PGF.Linearize
|
||||||
( linearize
|
( linearize
|
||||||
, linearizeAll
|
, linearizeAll
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{-# LANGUAGE BangPatterns, RankNTypes #-}
|
{-# LANGUAGE BangPatterns, RankNTypes, FlexibleContexts #-}
|
||||||
module PGF.Parse
|
module PGF.Parse
|
||||||
( ParseState
|
( ParseState
|
||||||
, ErrorState
|
, ErrorState
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
module PGF.Printer (ppPGF,ppCat,ppFId,ppFunId,ppSeqId,ppSeq,ppFun) where
|
module PGF.Printer (ppPGF,ppCat,ppFId,ppFunId,ppSeqId,ppSeq,ppFun) where
|
||||||
|
|
||||||
import PGF.CId
|
import PGF.CId
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ module PGF.Tokenizer
|
|||||||
( mkTokenizer
|
( mkTokenizer
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Prelude hiding ((<*>))
|
||||||
--import Data.List (intercalate)
|
--import Data.List (intercalate)
|
||||||
--import Test.QuickCheck
|
--import Test.QuickCheck
|
||||||
import FST.TransducerInterface
|
import FST.TransducerInterface
|
||||||
|
|||||||
@@ -21,7 +21,11 @@ import qualified PGF2 as C
|
|||||||
|
|
||||||
import Data.Time.Clock(UTCTime)
|
import Data.Time.Clock(UTCTime)
|
||||||
import Data.Time.Format(formatTime)
|
import Data.Time.Format(formatTime)
|
||||||
|
#if MIN_VERSION_time(1,5,0)
|
||||||
|
import Data.Time.Format(defaultTimeLocale,rfc822DateFormat)
|
||||||
|
#else
|
||||||
import System.Locale(defaultTimeLocale,rfc822DateFormat)
|
import System.Locale(defaultTimeLocale,rfc822DateFormat)
|
||||||
|
#endif
|
||||||
import Text.JSON
|
import Text.JSON
|
||||||
import Text.PrettyPrint as PP(render, text, (<+>))
|
import Text.PrettyPrint as PP(render, text, (<+>))
|
||||||
import qualified Codec.Binary.UTF8.String as UTF8 (decodeString)
|
import qualified Codec.Binary.UTF8.String as UTF8 (decodeString)
|
||||||
|
|||||||
Reference in New Issue
Block a user