Untitled
{-# 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 putStrLn "Sleeping..." threadDelay 1000000 where doWork = putStrLn "Time to work" schedule = case parseCronSchedule "*/2 * * * *" of Left _ -> error "Error" Right x -> x