summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Command/Interpreter.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2012-09-25 19:08:33 +0000
committerhallgren <hallgren@chalmers.se>2012-09-25 19:08:33 +0000
commit43d5016996905cc4fd325ecc739d64eb29aa0aa1 (patch)
tree884685ebebbb2c6966d84bbc2c532232e88b91f3 /src/compiler/GF/Command/Interpreter.hs
parent1adc0ed9f7ef98480f441474353eb39293d988c7 (diff)
Use the SIO monad in the GF shell
+ The restrictions on arbitrary IO when GF is running in restricted mode is now enforced in the types. + This hopefully also solves an intermittent problem when accessing the GF shell through the web API provided by gf -server. This was visible in the Simple Translation Tool and probably caused by some low-level bug in the GHC IO libraries.
Diffstat (limited to 'src/compiler/GF/Command/Interpreter.hs')
-rw-r--r--src/compiler/GF/Command/Interpreter.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/GF/Command/Interpreter.hs b/src/compiler/GF/Command/Interpreter.hs
index 5758c24f4..dd5a05594 100644
--- a/src/compiler/GF/Command/Interpreter.hs
+++ b/src/compiler/GF/Command/Interpreter.hs
@@ -6,6 +6,7 @@ module GF.Command.Interpreter (
interpretPipe,
getCommandOp
) where
+import Prelude hiding (putStrLn)
import GF.Command.Commands
import GF.Command.Abstract
@@ -14,7 +15,7 @@ import PGF
import PGF.Data
import PGF.Morphology
import GF.System.Signal
-import GF.Infra.UseIO
+import GF.Infra.SIO
import GF.Infra.Option
import Text.PrettyPrint
@@ -38,7 +39,7 @@ mkCommandEnv pgf =
emptyCommandEnv :: CommandEnv
emptyCommandEnv = mkCommandEnv emptyPGF
-interpretCommandLine :: CommandEnv -> String -> IO ()
+interpretCommandLine :: CommandEnv -> String -> SIO ()
interpretCommandLine env line =
case readCommandLine line of
Just [] -> return ()
@@ -82,7 +83,7 @@ appCommand xs c@(Command i os arg) = case arg of
EFun x -> EFun x
-- return the trees to be sent in pipe, and the output possibly printed
-interpret :: CommandEnv -> [Expr] -> Command -> IO CommandOutput
+interpret :: CommandEnv -> [Expr] -> Command -> SIO CommandOutput
interpret env trees comm =
case getCommand env trees comm of
Left msg -> do putStrLn ('\n':msg)