RosettaCodeData/Task/Take-notes-on-the-command-line/Haskell/take-notes-on-the-command-line.hs
2023-07-01 13:44:08 -04:00

12 lines
323 B
Haskell

import System.Environment (getArgs)
import System.Time (getClockTime)
main :: IO ()
main = do
args <- getArgs
if null args
then catch (readFile "notes.txt" >>= putStr)
(\_ -> return ())
else
do ct <- getClockTime
appendFile "notes.txt" $ show ct ++ "\n\t" ++ unwords args ++ "\n"