diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2019-09-01 00:27:39 +0200 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2019-09-01 00:27:39 +0200 |
commit | 768996a0c92dae7d6df9f0e8dca7dccffa986488 (patch) | |
tree | f5c825c706ba3155e476aa99beec2d2fba1652a0 /src | |
parent | 1ff6303a5a08504a938fd845505323f6a9771977 (diff) | |
download | frotate.hs-768996a0c92dae7d6df9f0e8dca7dccffa986488.tar.gz |
Keep the oldest days so that they can move to other groups
Diffstat (limited to 'src')
-rw-r--r-- | src/Main.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Main.hs b/src/Main.hs index 0ab3259..0f66daa 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -60,6 +60,8 @@ main = do opts <- execParser $ info (parseOptions <**> helper) fullDesc let groups = partitionDays (\n -> floor (base opts ^ (n - 1))) (days opts) case mode opts of - Just Keep -> putStrLn $ unwords . map show . concatMap (take 1) $ groups - Just Delete -> putStrLn $ unwords . map show . concatMap (drop 1) $ groups - Nothing -> mapM_ (hPutStrLn stderr . unwords . map show) groups + Just Keep -> + putStrLn $ unwords . map show . concatMap (take 1 . reverse) $ groups + Just Delete -> + putStrLn $ unwords . map show . concatMap (drop 1 . reverse) $ groups + Nothing -> mapM_ (hPutStrLn stderr . unwords . map show . reverse) groups |