diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-20 14:09:23 +0000 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-20 14:09:23 +0000 |
commit | b6980f4b0544b7c840d87543b7463f38a71fb925 (patch) | |
tree | 3d0ef3d240a14d0f972c280d6db9d092e12c5600 /src | |
parent | 5f2c7ae801deb49b55f7f574253d02dbd4b78e5d (diff) | |
download | sariulclocks-b6980f4b0544b7c840d87543b7463f38a71fb925.tar.gz |
started to write new executable for weekly score processing
Diffstat (limited to 'src')
-rw-r--r-- | src/sariulccron.hs | 20 |
1 files changed, 20 insertions, 0 deletions
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 |