packages feed

Monadoro-0.3.0.0: src/ConsoleDisplay.lhs

#!/usr/bin/env stack
> --stack --install-ghc runghc

Unified interface for displaying the remaining time on the screen.

> module ConsoleDisplay (display) where
>
> import Control.Concurrent  (threadDelay)
>
> display :: String -> IO ()
> display s = putStr $ "\r" ++ s
>
> waitASecond :: IO()
> waitASecond = threadDelay $ 10^6

> main :: IO ()
> main = do
>     display "00:01" >> waitASecond >> display "00:00"