mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-08 20:59:30 -06:00
Merge pull request #148 from anka-213/fix-ghc-7.10-build
Fix ghc-7.10 build
This commit is contained in:
2
gf.cabal
2
gf.cabal
@@ -85,6 +85,8 @@ library
|
||||
|
||||
if impl(ghc<8.0)
|
||||
build-depends:
|
||||
-- We need this in order for ghc-7.10 to build
|
||||
transformers-compat >= 0.6.3 && < 0.7,
|
||||
fail >= 4.9.0 && < 4.10
|
||||
|
||||
hs-source-dirs: src/runtime/haskell
|
||||
|
||||
@@ -38,6 +38,10 @@ import GF.Server(server)
|
||||
#endif
|
||||
|
||||
import GF.Command.Messages(welcome)
|
||||
#if !(MIN_VERSION_base(4,9,0))
|
||||
-- Needed to make it compile on GHC < 8
|
||||
import Control.Monad.Trans.Instances ()
|
||||
#endif
|
||||
|
||||
-- | Run the GF Shell in quiet mode (@gf -run@).
|
||||
mainRunGFI :: Options -> [FilePath] -> IO ()
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DeriveFunctor #-}
|
||||
-- BNF Converter: Error Monad
|
||||
-- Copyright (C) 2004 Author: Aarne Ranta
|
||||
|
||||
@@ -6,12 +8,17 @@ module GFCC.ErrM where
|
||||
|
||||
-- Control.Monad.Fail import will become redundant in GHC 8.8+
|
||||
import qualified Control.Monad.Fail as Fail
|
||||
import Control.Monad (ap)
|
||||
|
||||
|
||||
-- the Error monad: like Maybe type with error msgs
|
||||
|
||||
data Err a = Ok a | Bad String
|
||||
deriving (Read, Show, Eq)
|
||||
deriving (Read, Show, Eq, Functor)
|
||||
|
||||
instance Applicative Err where
|
||||
pure = Ok
|
||||
(<*>) = ap
|
||||
|
||||
instance Monad Err where
|
||||
return = Ok
|
||||
|
||||
Reference in New Issue
Block a user