diff --git a/app/Commands/Repl.hs b/app/Commands/Repl.hs index 1ad4d6e9c5..8b35def495 100644 --- a/app/Commands/Repl.hs +++ b/app/Commands/Repl.hs @@ -190,7 +190,7 @@ replCommand opts input_ = catchAll $ do compileString :: Repl (Maybe Core.Node) compileString = do - (artifacts, res) <- liftIO $ compileReplInputIO' ctx (strip (pack s)) + (artifacts, res) <- compileReplInputIO' ctx (strip (pack s)) res' <- replFromEither res State.modify (over (replStateContext . _Just) (set replContextArtifacts artifacts)) return res' @@ -199,7 +199,7 @@ core :: String -> Repl () core input_ = do ctx <- replGetContext opts <- Reader.asks (^. replOptions) - compileRes <- liftIO (compileReplInputIO' ctx (strip (pack input_))) >>= replFromEither . snd + compileRes <- compileReplInputIO' ctx (strip (pack input_)) >>= replFromEither . snd whenJust compileRes (renderOutLn . Core.ppOut opts) dev :: String -> Repl () @@ -484,7 +484,7 @@ replTabComplete = Prefix (wordCompleter optsCompleter) defaultMatcher printRoot :: String -> Repl () printRoot _ = do r <- State.gets (^. replStateRoot . rootRootDir) - liftIO $ putStrLn (pack (toFilePath r)) + putStrLn (pack (toFilePath r)) runCommand :: (Members '[EmbedIO, App, TaggedLock] r) => ReplOptions -> Sem r () runCommand opts = do @@ -570,7 +570,7 @@ replExpressionUpToTyped txt = do $ expressionUpToTyped P.replPath txt replFromEither x -compileReplInputIO' :: ReplContext -> Text -> IO (Artifacts, (Either JuvixError (Maybe Core.Node))) +compileReplInputIO' :: (MonadIO m) => ReplContext -> Text -> m (Artifacts, (Either JuvixError (Maybe Core.Node))) compileReplInputIO' ctx txt = runM . runState (ctx ^. replContextArtifacts) diff --git a/src/Juvix/Compiler/Pipeline/Repl.hs b/src/Juvix/Compiler/Pipeline/Repl.hs index cadd34fb44..e968146490 100644 --- a/src/Juvix/Compiler/Pipeline/Repl.hs +++ b/src/Juvix/Compiler/Pipeline/Repl.hs @@ -164,7 +164,7 @@ compileReplInputIO fp txt = do runError . runConcurrent . runReader defaultPipelineOptions - . runLoggerIO defaultLoggerOptions + . runLoggerIO replLoggerOptions . runReader defaultNumThreads . evalInternet hasInternet . ignoreHighlightBuilder