From 9d8cd55cd5e492ed8996fe86cc1145989f1bf51b Mon Sep 17 00:00:00 2001 From: Andreas Källberg Date: Wed, 9 Sep 2020 11:05:41 +0200 Subject: Import orphan instances of MonadFail for ghc<8 Also upgrade alex/happy so automatic install works --- src/compiler/GF/Command/Interpreter.hs | 4 ++++ src/compiler/GF/Interactive.hs | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/compiler') diff --git a/src/compiler/GF/Command/Interpreter.hs b/src/compiler/GF/Command/Interpreter.hs index bcb15d238..d1fd65a54 100644 --- a/src/compiler/GF/Command/Interpreter.hs +++ b/src/compiler/GF/Command/Interpreter.hs @@ -11,6 +11,9 @@ import GF.Infra.UseIO(putStrLnE) import Control.Monad(when) 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 { commands :: Map.Map String (CommandInfo m), @@ -22,6 +25,7 @@ data CommandEnv m = CommandEnv { mkCommandEnv cmds = CommandEnv cmds Map.empty Map.empty --interpretCommandLine :: CommandEnv -> String -> SIO () +interpretCommandLine :: (Output m, TypeCheckArg m) => CommandEnv m -> String -> m () interpretCommandLine env line = case readCommandLine line of Just [] -> return () diff --git a/src/compiler/GF/Interactive.hs b/src/compiler/GF/Interactive.hs index b68a1bc2f..c292fe944 100644 --- a/src/compiler/GF/Interactive.hs +++ b/src/compiler/GF/Interactive.hs @@ -38,6 +38,9 @@ import GF.Server(server) #endif 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@). mainRunGFI :: Options -> [FilePath] -> IO () @@ -131,7 +134,8 @@ execute1' s0 = "dt":ws -> define_tree ws -- ordinary commands _ -> do env <- gets commandenv - interpretCommandLine env s0 + -- () env s0 + -- interpretCommandLine env s0 continue where continue,stop :: ShellM Bool -- cgit v1.2.3