{-# LANGUAGE FlexibleContexts #-} module Villefort.Summary where import Villefort.Database import Control.Monad.Reader import Villefort.Todo import Villefort.Stats import Villefort.Definitions f :: [[String]] -> Int f x = sum $ map (\x -> read $ x !! 1 :: Int) x getSummary :: (MonadReader VConfig m, MonadIO m) => m String getSummary = do dat <- getDone header <- liftIO $ getHeader return ( header ++ (makeTable ["Subject","Time"] $ dat ++ [["Total", show$ f dat]])) --2017-07-26