summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/app/Main.hs
diff options
context:
space:
mode:
authorArnaud Bailly <arnaud@pankzsoft.com>2025-10-28 20:14:16 +0100
committerArnaud Bailly <arnaud@pankzsoft.com>2025-10-28 20:14:16 +0100
commit1d1f0efc7de1eaa0c8a6b503892c2f950008fde6 (patch)
treebd2e2ea5963d8a208d302854502f580d8ffd73cb /lambda-calcul/haskell/app/Main.hs
parenta210419fd60c00d011f70fb1b968031621e4c01a (diff)
downloadlambda-nantes-1d1f0efc7de1eaa0c8a6b503892c2f950008fde6.tar.gz
wip: port REPL from minilang
Diffstat (limited to 'lambda-calcul/haskell/app/Main.hs')
-rw-r--r--lambda-calcul/haskell/app/Main.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/lambda-calcul/haskell/app/Main.hs b/lambda-calcul/haskell/app/Main.hs
index 5b48c01..0b40f60 100644
--- a/lambda-calcul/haskell/app/Main.hs
+++ b/lambda-calcul/haskell/app/Main.hs
@@ -1,6 +1,12 @@
-import Minilang.IO
+import Minilang.IO (runEval)
import System.IO (stdin, stdout)
+import System.Posix.Terminal (queryTerminal)
+import System.Posix (stdInput)
+import Minilang.REPL (withTerminal)
main :: IO ()
-main =
- runEval stdin stdout
+main = do
+ hasTty <- queryTerminal stdInput
+ if hasTty
+ then withTerminal
+ else runEval stdin stdout