Skip to content

Commit 5eafd6a

Browse files
committed
fixed Repl
1 parent cae158b commit 5eafd6a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

app/Repl.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import System.Console.Haskeline
2727
import System.Exit (exitSuccess)
2828
import qualified System.IO.Strict as Strict
2929
import Telomare
30-
import Telomare.Eval (EvalError (..), compileUnitTestNoAbort)
30+
import Telomare.Eval (compileUnitTestNoAbort)
3131
import Telomare.Parser (TelomareParser, parseAssignment, parseLongExpr,
3232
parsePrelude)
3333
import Telomare.Possible (deferB, evalPartial')
@@ -110,14 +110,14 @@ printLastExpr eval bindings = do
110110
case lookup "_tmp_" bindings' of
111111
Nothing -> putStrLn "Could not find _tmp_ in bindings"
112112
Just upt -> do
113-
let compile' :: Term3 -> Either String IExpr
113+
let compile' :: Term3 -> Either EvalError IExpr
114114
compile' x = case compileUnitTestNoAbort x of
115-
Left err -> Left . show $ err
115+
Left err -> Left err
116116
Right r -> case toTelomare r of
117117
Just te -> pure $ fromTelomare te
118-
_ -> Left $ "conversion error from compiled expr:\n" <> prettyPrint r
119-
case compile' =<< process (DummyLoc :< LetUPF bindings' upt) of
120-
Left err -> putStrLn err
118+
_ -> Left . RTE . ResultConversionError $ "conversion error from compiled expr:\n" <> prettyPrint r
119+
case compile' =<< first RE (process (DummyLoc :< LetUPF bindings' upt)) of
120+
Left err -> print err
121121
Right iexpr' -> case eval iexpr' of
122122
Left e -> putStrLn $ "error: " <> show e
123123
Right expr' -> print . PrettyIExpr $ expr'

0 commit comments

Comments
 (0)