Reorganize

This commit is contained in:
Joscha 2018-10-23 13:30:32 +00:00
parent 36e90895f0
commit 15c547fe5e
9 changed files with 343 additions and 166 deletions

View file

@ -21,6 +21,8 @@ module TaskMachine.Task
, Description
, Snippet(..)
-- * Misc stuff
, emptyTask
, newTask
, compareTasks
-- * Formatting
, formatTask
@ -313,6 +315,13 @@ pTasks = many pTask <* eof
{- Misc stuff -}
emptyTask :: Task
emptyTask = Task Incomplete Nothing Nothing Nothing []
-- | Create a new task with empty description and the given date as creation date
newTask :: Day -> Task
newTask day = Task Incomplete Nothing Nothing (Just day) []
compareTasks :: Task -> Task -> Ordering
compareTasks a b = mconcat
[ compare (taskCompletion a) (taskCompletion b)