From ab1b426b917460c09079a21378848ad68242bc9d Mon Sep 17 00:00:00 2001 From: Arnaud Bailly Date: Wed, 5 Nov 2025 12:12:16 +0100 Subject: do not display type when piping program --- lambda-calcul/haskell/src/Minilang/REPL.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lambda-calcul/haskell/src') diff --git a/lambda-calcul/haskell/src/Minilang/REPL.hs b/lambda-calcul/haskell/src/Minilang/REPL.hs index ae25822..a8d3c77 100644 --- a/lambda-calcul/haskell/src/Minilang/REPL.hs +++ b/lambda-calcul/haskell/src/Minilang/REPL.hs @@ -52,15 +52,15 @@ withHandles hin hout = -- | Simple IO REPL, used to evaluate programs from stdin or file loading withIO :: Handle -> Handle -> IO () withIO hin hout = do - input <- parseProgram <$> Text.hGetContents hin - case input of + programText <- parseProgram <$> Text.hGetContents hin + case programText of Left err -> Text.hPutStrLn hout (Text.pack (show err)) - Right inputs -> case loadProgram Untyped newEnv newContext inputs of + Right prog -> case loadProgram Untyped newEnv newContext prog of Right (results, _, _) -> mapM_ (Text.hPutStrLn hout . render) results Left err -> Text.hPutStrLn hout (Text.pack $ show err) where render :: (Term, Type) -> Text - render (term, typ) = pretty (resugar term) <> " : " <> Unify.pretty typ + render (term, _typ) = pretty (resugar term) -- TODO: handle types <> " : " <> Unify.pretty typ -- * Pure REPL -- cgit v1.3.1