taskwarrior-0.3.0.0: Types and aeson instances for taskwarrior tasks
Safe HaskellNone
LanguageHaskell2010

Taskwarrior.IO

Description

This modules contains IO actions to interact with the taskwarrior application. The taskwarrior documentation very explicitly disallows accessing the files by itself. So all functions here work via calling the task binary which needs to be in the PATH.

Synopsis

Documentation

getTasks :: [Text] -> IO [Task] Source #

Uses task export with a given filter like ["description:Milk", "+PENDING"].

saveTasks :: [Task] -> IO () Source #

Uses task import to save the given tasks.

createTask :: Text -> IO Task Source #

This will create a Task. I runs in IO to create a UUID and get the current time. This will not save the Task to taskwarrior. If you want to create a task with certain fields and save it you could do that like this:

newTask <- createTask "Buy Milk"
saveTasks [newTask { tags = ["groceries"] }]

getUUIDs :: [Text] -> IO [UUID] Source #

Gives all uuids matching the given filter (e.g. ["description:Milk", "+PENDING"]). This calls the task binary.

onAdd :: (Task -> IO Task) -> IO () Source #

Like onAddPure with side effects.

onAddPure :: (Task -> Task) -> IO () Source #

Like onModifyPure but for the onAdd hook.

onModify :: (Task -> Task -> IO Task) -> IO () Source #

Like onModifyPure but with side effects.

onModifyPure :: (Task -> Task -> Task) -> IO () Source #

Takes a function f originalTask modifiedTask = taskToSave. The resulting IO action can be run as the `main :: IO ()` of a taskwarrior on-modify hook.