diff options
Diffstat (limited to 'app/Main.hs')
| -rw-r--r-- | app/Main.hs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/Main.hs b/app/Main.hs index 3e92547..6115252 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -2,6 +2,7 @@ module Main (main) where import System.Environment import Control.Monad.Except import Control.Monad.Reader +import System.Console.Haskeline import Types import Lib @@ -16,6 +17,16 @@ parseArgs config args = config { configShowHelp = True } rest _ -> config +repl :: InputT IO () +repl = do + minput <- getInputLine "> " + case minput of + Nothing -> return () + Just "exit" -> return () + Just input -> do + outputStrLn $ "Input was: " ++ input + repl + main :: IO () main = do args <- getArgs @@ -44,6 +55,6 @@ main = do case result of Left (LException ex) -> putStrLn $ "Error: " ++ ex Right () -> return () - Nothing -> error "TODO REPL" - + Nothing -> do + runInputT defaultSettings repl return () |
