From b6980f4b0544b7c840d87543b7463f38a71fb925 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 20 Mar 2015 14:09:23 +0000 Subject: started to write new executable for weekly score processing --- src/sariulccron.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/sariulccron.hs diff --git a/src/sariulccron.hs b/src/sariulccron.hs new file mode 100644 index 0000000..fdaf61c --- /dev/null +++ b/src/sariulccron.hs @@ -0,0 +1,20 @@ +import Control.Monad.SariulClocks +import Utils.ScoresFile +import Types.Scores +import Types.Classes +import Control.Monad (liftM, when) + +weeklyCron :: ScoresList -> ScoresList +weeklyCron scores = undefined + +main :: IO () +main = runSariulClocksIO $ do + scores <- readScoresFile + when (isJust scores) $ do + modifyScores weeklyCron + shouldModify <- liftM (((/=) scores) . Just) getScores + when shouldModify writeScoresFile + +isJust :: Maybe a -> Bool +isJust (Just _) = True +isJust _ = False -- cgit v1.2.3