Skip to content

Commit

Permalink
Added version to state sav.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Goller committed Mar 20, 2016
1 parent 400825e commit 3a53d9c
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/Todo/Todo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ import Control.Exception (SomeException, try)

-- | Overall task management state
data TaskStat = TaskStat {
_taskVer :: String,
_actives :: [ActiveTask],
_pool :: [PooledTask],
_today :: Day,
Expand Down Expand Up @@ -123,6 +124,23 @@ makeLenses ''PooledTask
makeLenses ''Task


--showStat :: TaskStat -> String
--showStat ts = "htodo 0.1\n" ++
-- (ts ^. taskVer) ++ "\n" ++
-- show (ts ^. actives) ++ "\n" ++
-- show (ts ^. pool) ++ "\n"
--
--instance Show TaskStat where
-- show = showStat
--
--
--readStat :: Int -> String -> [(Stat, String)]
--readStat n str =
-- let [(version, str')] = readsPrec




-- | Adding days using an 'Int'
addDays :: Int -> Day -> Day
addDays i = Time.addDays $ toInteger i
Expand All @@ -137,7 +155,7 @@ zeroDay = read "2010-01-01"
-- The random generator is initialized with seed 0 and will always produce
-- the same values. Please set to new value before you use it.
emptyTaskStat :: TaskStat
emptyTaskStat = TaskStat [] [] zeroDay (mkStdGen 0)
emptyTaskStat = TaskStat "0.1" [] [] zeroDay (mkStdGen 0)

-- | Add an active task to the state
addActiveTaskM:: (String, String, Float, Int) -> State TaskStat ()
Expand Down

0 comments on commit 3a53d9c

Please sign in to comment.