Untitled

mail@pastecode.io avatar
unknown
haskell
a year ago
458 B
5
Indexable
Never
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE OverloadedStrings #-}

module Main (main) where

import Control.Monad
import Data.Time
import System.Cron
import Control.Concurrent

main :: IO ()
main =   
  forever do 
    now <- getCurrentTime 
    -- when (scheduleMatches schedule now) doWork 
    print (now, nextMatch schedule now)
    putStrLn "Sleeping..."
    threadDelay 1000000
  where 
    doWork = putStrLn "Time to work"
    schedule = everyMinute