Skip to content

Instantly share code, notes, and snippets.

@christianwish
Created February 16, 2019 20:18
Show Gist options
  • Save christianwish/8e3e8bcf8bb2479c04c7a4c7f5559a30 to your computer and use it in GitHub Desktop.
Save christianwish/8e3e8bcf8bb2479c04c7a4c7f5559a30 to your computer and use it in GitHub Desktop.
module Main where
import System.Environment
grey = "\x1b[2m"
noColor = "\x1b[0m"
replLine 0 = (grey ++ "> Hi!" ++ noColor)
replLine _ = (grey ++ ">" ++ noColor)
repl :: Int -> IO ()
repl round = do
putStrLn $ replLine round
a <- getLine
if a == "exit"
then putStrLn $ grey ++ "> Bye Bye"
else repl 1
main = do
(c:_) <- getArgs
if c == "repl"
then repl 0
else putStrLn "?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment