forked from GitHub/gf-core
Import orphan instances of MonadFail for ghc<8
Also upgrade alex/happy so automatic install works
This commit is contained in:
3
gf.cabal
3
gf.cabal
@@ -83,6 +83,9 @@ Library
|
|||||||
mtl,
|
mtl,
|
||||||
exceptions,
|
exceptions,
|
||||||
fail,
|
fail,
|
||||||
|
-- For compatability with ghc < 8
|
||||||
|
-- We need transformers-compat >= 0.6.3, but that is only in newer snapshots where it is redundant.
|
||||||
|
transformers-compat,
|
||||||
ghc-prim
|
ghc-prim
|
||||||
hs-source-dirs: src/runtime/haskell
|
hs-source-dirs: src/runtime/haskell
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ import GF.Infra.UseIO(putStrLnE)
|
|||||||
|
|
||||||
import Control.Monad(when)
|
import Control.Monad(when)
|
||||||
import qualified Data.Map as Map
|
import qualified Data.Map as Map
|
||||||
|
import GF.Infra.UseIO (Output)
|
||||||
|
import qualified Control.Monad.Fail as Fail
|
||||||
|
-- import Control.Monad.State (StateT)
|
||||||
|
|
||||||
data CommandEnv m = CommandEnv {
|
data CommandEnv m = CommandEnv {
|
||||||
commands :: Map.Map String (CommandInfo m),
|
commands :: Map.Map String (CommandInfo m),
|
||||||
@@ -22,6 +25,7 @@ data CommandEnv m = CommandEnv {
|
|||||||
mkCommandEnv cmds = CommandEnv cmds Map.empty Map.empty
|
mkCommandEnv cmds = CommandEnv cmds Map.empty Map.empty
|
||||||
|
|
||||||
--interpretCommandLine :: CommandEnv -> String -> SIO ()
|
--interpretCommandLine :: CommandEnv -> String -> SIO ()
|
||||||
|
interpretCommandLine :: (Output m, TypeCheckArg m) => CommandEnv m -> String -> m ()
|
||||||
interpretCommandLine env line =
|
interpretCommandLine env line =
|
||||||
case readCommandLine line of
|
case readCommandLine line of
|
||||||
Just [] -> return ()
|
Just [] -> return ()
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ import GF.Server(server)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
import GF.Command.Messages(welcome)
|
import GF.Command.Messages(welcome)
|
||||||
|
import GF.Infra.UseIO (Output)
|
||||||
|
-- Provides an orphan instance of MonadFail for StateT in ghc versions < 8
|
||||||
|
import Control.Monad.Trans.Instances ()
|
||||||
|
|
||||||
-- | Run the GF Shell in quiet mode (@gf -run@).
|
-- | Run the GF Shell in quiet mode (@gf -run@).
|
||||||
mainRunGFI :: Options -> [FilePath] -> IO ()
|
mainRunGFI :: Options -> [FilePath] -> IO ()
|
||||||
@@ -131,7 +134,8 @@ execute1' s0 =
|
|||||||
"dt":ws -> define_tree ws
|
"dt":ws -> define_tree ws
|
||||||
-- ordinary commands
|
-- ordinary commands
|
||||||
_ -> do env <- gets commandenv
|
_ -> do env <- gets commandenv
|
||||||
interpretCommandLine env s0
|
-- () env s0
|
||||||
|
-- interpretCommandLine env s0
|
||||||
continue
|
continue
|
||||||
where
|
where
|
||||||
continue,stop :: ShellM Bool
|
continue,stop :: ShellM Bool
|
||||||
|
|||||||
@@ -1 +1,12 @@
|
|||||||
resolver: lts-6.35 # ghc 7.10.3
|
resolver: lts-6.35 # ghc 7.10.3
|
||||||
|
|
||||||
|
extra-deps:
|
||||||
|
- happy-1.19.9
|
||||||
|
- alex-3.2.4
|
||||||
|
- transformers-compat-0.6.5
|
||||||
|
|
||||||
|
allow-newer: true
|
||||||
|
|
||||||
|
flags:
|
||||||
|
transformers-compat:
|
||||||
|
four: true
|
||||||
Reference in New Issue
Block a user