Skip to content
Browse files

Don't always infer entries

Don't run inferEntries as part of entriesWithin.  Doing so prevents
anyone from accessing the un-inferred entries which might be useful in
some cases.
  • Loading branch information...
1 parent 7ff52b1 commit 03a51795ccc248f50ff17f0c97b572ea220beeba @mndrix committed Jan 18, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 App/Clk/Command/Ls.hs
  2. +1 −1 App/Clk/Command/Report.hs
  3. +1 −1 App/Clk/Entry.hs
View
2 App/Clk/Command/Ls.hs
@@ -24,7 +24,7 @@ main args = do
let formatter = findFormatter flags
tz <- getCurrentTimeZone
- entries <- entriesWithin period
+ entries <- entriesWithin period >>= inferEntries
putStrLn $ intercalate "\n" $ map (formatter tz) $ entries
findPeriodPhrase :: [Flag] -> String
View
2 App/Clk/Command/Report.hs
@@ -20,7 +20,7 @@ main args = do
period <- parsePeriod periodPhrase
let p e = all ($e) [ hasDuration, isClockedIn, isWithin period ]
- entries <- fmap (filter p) $ entriesWithin period
+ entries <- fmap (filter p) $ (entriesWithin period >>= inferEntries)
-- putStrLn $ intercalate "\n" $ map show entries
let f = \s e -> Map.insertWith (+) (client e) (maybe 0 id $ dur e) s
View
2 App/Clk/Entry.hs
@@ -106,7 +106,7 @@ entriesWithin :: Period -> IO [Entry]
entriesWithin p = do
monthFiles <- fmap (filter isKeeper) allMonthFiles
entries <- mapM monthFileEntries monthFiles
- inferEntries $ filter (isWithin p) $ concat entries
+ return $ filter (isWithin p) $ concat entries
where isKeeper = overlaps p . period
monthFileEntries :: MonthFile -> IO [Entry]

0 comments on commit 03a5179

Please sign in to comment.
Something went wrong with that request. Please try again.