Skip to content

Commit

Permalink
Remove redundant imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaprieto committed Feb 22, 2023
1 parent f93529b commit 4cace44
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 38 deletions.
3 changes: 1 addition & 2 deletions app/Commands/Dev/Geb/Eval.hs
Expand Up @@ -5,7 +5,6 @@ import Commands.Dev.Geb.Eval.Options
import Juvix.Compiler.Backend.Geb.Evaluator qualified as Geb
import Juvix.Compiler.Backend.Geb.Language qualified as Geb
import Juvix.Compiler.Backend.Geb.Pretty qualified as Geb
import Juvix.Compiler.Backend.Geb.Pretty.Values qualified as GebValue
import Juvix.Compiler.Backend.Geb.Translation.FromSource qualified as Geb

runCommand ::
Expand Down Expand Up @@ -51,5 +50,5 @@ evalAndPrint opts = \case
| otherwise ->
case Geb.eval' env morphism of
Left err -> exitJuvixError err
Right m -> renderStdOut (GebValue.ppOut opts' m)
Right m -> renderStdOut (Geb.ppOut opts' m)
Geb.ExpressionObject _ -> error Geb.objNoEvalMsg
3 changes: 1 addition & 2 deletions app/Commands/Dev/Geb/Repl.hs
Expand Up @@ -10,7 +10,6 @@ import Control.Monad.State.Strict qualified as State
import Data.String.Interpolate (i, __i)
import Juvix.Compiler.Backend.Geb qualified as Geb
import Juvix.Compiler.Backend.Geb.Analysis.TypeChecking.Error
import Juvix.Compiler.Backend.Geb.Pretty.Values qualified as GebValue
import Juvix.Data.Error.GenericError qualified as Error
import Juvix.Extra.Version
import Juvix.Prelude.Pretty qualified as P
Expand Down Expand Up @@ -313,6 +312,6 @@ printEvalResult :: Either JuvixError Geb.RunEvalResult -> Repl ()
printEvalResult = \case
Left err -> printError err
Right (Geb.RunEvalResultGebValue v) ->
renderOut (GebValue.ppOut Geb.defaultEvaluatorOptions v)
renderOut (Geb.ppOut Geb.defaultEvaluatorOptions v)
Right (Geb.RunEvalResultMorphism morphism) ->
renderOut (Geb.ppOut Geb.defaultEvaluatorOptions morphism)
7 changes: 3 additions & 4 deletions src/Juvix/Compiler/Backend/Geb/Evaluator/Error.hs
Expand Up @@ -4,8 +4,7 @@ import GHC.Exception qualified as Exception
import GHC.Show qualified as S
import Juvix.Compiler.Backend.Geb.Evaluator.Data.Values
import Juvix.Compiler.Backend.Geb.Language
import Juvix.Compiler.Backend.Geb.Pretty qualified as Geb
import Juvix.Compiler.Backend.Geb.Pretty.Values
import Juvix.Compiler.Backend.Geb.Pretty

data EvalError = EvalError
{ _evalErrorMsg :: !Text,
Expand Down Expand Up @@ -52,7 +51,7 @@ instance Show EvalError where
Nothing -> ""
Just expr ->
"Morphism:\n"
<> fromText (Geb.ppTrace expr)
<> fromText (ppTrace expr)
<> "\n"

evalError ::
Expand Down Expand Up @@ -84,4 +83,4 @@ instance Show QuoteError where
Nothing -> ""
Just expr ->
"GebObject associated:\n"
<> fromText (Geb.ppTrace expr)
<> fromText (ppTrace expr)
28 changes: 0 additions & 28 deletions src/Juvix/Compiler/Backend/Geb/Pretty/Values.hs

This file was deleted.

3 changes: 1 addition & 2 deletions test/BackendGeb/Eval/Base.hs
Expand Up @@ -3,7 +3,6 @@ module BackendGeb.Eval.Base where
import Base
import Data.Text.IO qualified as TIO
import Juvix.Compiler.Backend.Geb qualified as Geb
import Juvix.Compiler.Backend.Geb.Pretty.Values qualified as PrettyGeb
import Juvix.Prelude.Pretty

gebEvalAssertion ::
Expand Down Expand Up @@ -36,7 +35,7 @@ gebEvalAssertion mainFile expectedFile step = do
hClose hout
assertFailure (show (pretty (fromJuvixError @GenericError err)))
Right value -> do
hPutStrLn hout (PrettyGeb.ppPrint value)
hPutStrLn hout (Geb.ppPrint value)
hClose hout
actualOutput <- TIO.readFile (toFilePath outputFile)
expected <- TIO.readFile (toFilePath expectedFile)
Expand Down

0 comments on commit 4cace44

Please sign in to comment.