Skip to content

Commit

Permalink
fix repl log
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Nov 1, 2024
1 parent 84b59d4 commit b25cd9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/Commands/Repl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 ()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Juvix/Compiler/Pipeline/Repl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ compileReplInputIO fp txt = do
runError
. runConcurrent
. runReader defaultPipelineOptions
. runLoggerIO defaultLoggerOptions
. runLoggerIO replLoggerOptions
. runReader defaultNumThreads
. evalInternet hasInternet
. ignoreHighlightBuilder
Expand Down

0 comments on commit b25cd9f

Please sign in to comment.