summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/src/Minilang
diff options
context:
space:
mode:
authorArnaud Bailly <arnaud@pankzsoft.com>2025-11-05 12:12:16 +0100
committerArnaud Bailly <arnaud@pankzsoft.com>2025-11-05 12:12:16 +0100
commitab1b426b917460c09079a21378848ad68242bc9d (patch)
tree5311f8ef121f84f36753dab3475735ac402f22d5 /lambda-calcul/haskell/src/Minilang
parent10feb2dc8ad775a64b6db4d19c76bd6fa38044a8 (diff)
downloadlambda-nantes-ab1b426b917460c09079a21378848ad68242bc9d.tar.gz
do not display type when piping program
Diffstat (limited to 'lambda-calcul/haskell/src/Minilang')
-rw-r--r--lambda-calcul/haskell/src/Minilang/REPL.hs8
1 files changed, 4 insertions, 4 deletions
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