-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Types and aeson instances for taskwarrior tasks -- -- Types and aeson instances for the https://taskwarrior.org task -- import/export feature @package taskwarrior @version 0.6.0.2 -- | The Mask module models the state a recurring parent saves about its -- child tasks. module Taskwarrior.Mask -- | The mask is a newtype to provide Aeson instances from and to a -- JSON string. newtype Mask Mask :: [MaskState] -> Mask [mask] :: Mask -> [MaskState] -- | Represents the state of a child in a Recurring Task. data MaskState instance GHC.Enum.Bounded Taskwarrior.Mask.MaskState instance GHC.Classes.Ord Taskwarrior.Mask.MaskState instance GHC.Read.Read Taskwarrior.Mask.MaskState instance GHC.Enum.Enum Taskwarrior.Mask.MaskState instance GHC.Show.Show Taskwarrior.Mask.MaskState instance GHC.Classes.Eq Taskwarrior.Mask.MaskState instance GHC.Show.Show Taskwarrior.Mask.Mask instance GHC.Classes.Ord Taskwarrior.Mask.Mask instance GHC.Read.Read Taskwarrior.Mask.Mask instance GHC.Classes.Eq Taskwarrior.Mask.Mask instance Data.Aeson.Types.FromJSON.FromJSON Taskwarrior.Mask.Mask instance Data.Aeson.Types.ToJSON.ToJSON Taskwarrior.Mask.Mask -- | This module provides the type for the Priority of a task. module Taskwarrior.Priority -- | Parses a JSON string to a Maybe Priority, fails on -- anything else. parseMay :: Value -> Parser (Maybe Priority) -- | A Task can have the priorities High, Medium, -- Low or none, which is modeled via a Maybe -- Priority. data Priority High :: Priority Medium :: Priority Low :: Priority instance GHC.Enum.Bounded Taskwarrior.Priority.Priority instance GHC.Classes.Ord Taskwarrior.Priority.Priority instance GHC.Enum.Enum Taskwarrior.Priority.Priority instance GHC.Read.Read Taskwarrior.Priority.Priority instance GHC.Show.Show Taskwarrior.Priority.Priority instance GHC.Classes.Eq Taskwarrior.Priority.Priority instance Data.Aeson.Types.ToJSON.ToJSON Taskwarrior.Priority.Priority instance Data.Aeson.Types.FromJSON.FromJSON Taskwarrior.Priority.Priority -- | This Module provides the RecurringChild type with FromJSON and ToJSON -- instances. module Taskwarrior.RecurringChild -- | The RecurringChild type saves information about how a -- Task is child of another Task wich is recurring. data RecurringChild RecurringChild :: Text -> Integer -> UUID -> RecurringChild [recur] :: RecurringChild -> Text [imask] :: RecurringChild -> Integer [parent] :: RecurringChild -> UUID -- | Gathers all fields for a RecurringChild status. parseFromObjectMay :: Object -> Parser (Maybe RecurringChild) -- | Can be used to serialize RecurringChild to JSON. toPairs :: RecurringChild -> [Pair] instance GHC.Classes.Ord Taskwarrior.RecurringChild.RecurringChild instance GHC.Read.Read Taskwarrior.RecurringChild.RecurringChild instance GHC.Show.Show Taskwarrior.RecurringChild.RecurringChild instance GHC.Classes.Eq Taskwarrior.RecurringChild.RecurringChild instance Data.Aeson.Types.FromJSON.FromJSON Taskwarrior.RecurringChild.RecurringChild instance Data.Aeson.Types.ToJSON.ToJSON Taskwarrior.RecurringChild.RecurringChild -- | This module provides no own time type for taskwarrior rather it only -- gives deserialisation and serialisation support. module Taskwarrior.Time -- | Parses a JSON string from the taskwarrior time format. parse :: Value -> Parser UTCTime -- | Converts a time to the taskwarrior time format. toValue :: UTCTime -> Value -- | This module deals with information of a task which is dependent on the -- status. module Taskwarrior.Status -- | A task can be pending, deleted, completed, waiting or recurring. It is -- recommended to access the fields only by pattern matching since the -- getters are partial. data Status Pending :: Status Deleted :: UTCTime -> Status [end] :: Status -> UTCTime Completed :: UTCTime -> Status [end] :: Status -> UTCTime Recurring :: Text -> Mask -> Status [recur] :: Status -> Text [mask] :: Status -> Mask -- | Takes all information that is dependent on the status from a JSON -- object. parseFromObject :: Object -> Parser Status -- | A list of Pairs can be used to construct a JSON object later. The -- result of toPairs is supposed to be combined with the rest of -- the fields of a task. toPairs :: Status -> [Pair] instance GHC.Classes.Ord Taskwarrior.Status.Status instance GHC.Read.Read Taskwarrior.Status.Status instance GHC.Show.Show Taskwarrior.Status.Status instance GHC.Classes.Eq Taskwarrior.Status.Status instance Data.Aeson.Types.FromJSON.FromJSON Taskwarrior.Status.Status instance Data.Aeson.Types.ToJSON.ToJSON Taskwarrior.Status.Status -- | Provides the Annotation type with ToJSON and -- FromJSON instances. module Taskwarrior.Annotation -- | A taskwarrior Task can have multiple annotations. They contain -- a timestamp entry and a description. data Annotation Annotation :: UTCTime -> Text -> Annotation [entry] :: Annotation -> UTCTime [description] :: Annotation -> Text instance GHC.Classes.Ord Taskwarrior.Annotation.Annotation instance GHC.Read.Read Taskwarrior.Annotation.Annotation instance GHC.Show.Show Taskwarrior.Annotation.Annotation instance GHC.Classes.Eq Taskwarrior.Annotation.Annotation instance Data.Aeson.Types.FromJSON.FromJSON Taskwarrior.Annotation.Annotation instance Data.Aeson.Types.ToJSON.ToJSON Taskwarrior.Annotation.Annotation -- | User defined attributes are stored in a Map from Text to -- json Values because we have no type information about them. module Taskwarrior.UDA -- | A field will in practice only be a number or a string. type UDA = Map Text Value -- | This Module exports the main datatype of this library: Task. It is -- provided with FromJSON and ToJSON instances. module Taskwarrior.Task -- | A Task represents a task from taskwarrior. The specification -- demands, that the existence of some fields is dependent on the status -- of the task. Those fields are therefore bundled in Status as a -- sum-type. -- -- All fields in an imported task which are not part of the specification -- will be put in the UDA (user defined attributes) -- 'Data.Map.Strict.Map Data.Text.Text'. -- -- Since the json can have multiple semantically equivalent -- representations of a task first serializing and then deserializing is -- not identity. But deserializing and then serializing should be. (Thus -- making serializing and deserializing idempotent.) data Task Task :: Status -> Maybe RecurringChild -> UUID -> Maybe Integer -> UTCTime -> Text -> Maybe UTCTime -> Maybe UTCTime -> Maybe UTCTime -> Maybe UTCTime -> Maybe UTCTime -> Set Annotation -> Maybe UTCTime -> Maybe Text -> Maybe Priority -> Set UUID -> Set Tag -> Double -> UDA -> Task [status] :: Task -> Status [recurringChild] :: Task -> Maybe RecurringChild [uuid] :: Task -> UUID [id] :: Task -> Maybe Integer [entry] :: Task -> UTCTime [description] :: Task -> Text [start] :: Task -> Maybe UTCTime [modified] :: Task -> Maybe UTCTime [wait] :: Task -> Maybe UTCTime [due] :: Task -> Maybe UTCTime [until] :: Task -> Maybe UTCTime [annotations] :: Task -> Set Annotation [scheduled] :: Task -> Maybe UTCTime [project] :: Task -> Maybe Text [priority] :: Task -> Maybe Priority [depends] :: Task -> Set UUID [tags] :: Task -> Set Tag [urgency] :: Task -> Double [uda] :: Task -> UDA -- | A Tag can be basically any string. But beware: Special symbols work -- but might clash with task cli syntax. As an example you can -- use a space in a Tag. But then you cannot use task -- +my tag on the command line. type Tag = Text -- | Makes a fresh Task with the given mandatory fields uuid, entry time -- and description. See createTask for a non-pure version which needs -- less parameters. makeTask :: UUID -> UTCTime -> Text -> Task instance GHC.Read.Read Taskwarrior.Task.Task instance GHC.Show.Show Taskwarrior.Task.Task instance GHC.Classes.Eq Taskwarrior.Task.Task instance Data.Aeson.Types.FromJSON.FromJSON Taskwarrior.Task.Task instance Data.Aeson.Types.ToJSON.ToJSON Taskwarrior.Task.Task -- | 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. module Taskwarrior.IO -- | Uses task export with a given filter like -- ["description:Milk", "+PENDING"]. getTasks :: [Text] -> IO [Task] -- | Uses task import to save the given tasks. saveTasks :: [Task] -> IO () -- | 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"] }]
--   
createTask :: Text -> IO Task -- | Gives all uuids matching the given filter (e.g. -- ["description:Milk", "+PENDING"]). This calls the -- task binary. getUUIDs :: [Text] -> IO [UUID] -- | Like onAddPure with side effects. onAdd :: (Task -> IO Task) -> IO () -- | Like onModifyPure but for the onAdd hook. onAddPure :: (Task -> Task) -> IO () -- | Like onModifyPure but with side effects. onModify :: (Task -> Task -> IO Task) -> IO () -- | Takes a function f originalTask modifiedTask = taskToSave. -- The resulting IO action can be run as the `main :: IO ()` of a -- taskwarrior on-modify hook. onModifyPure :: (Task -> Task -> Task) -> IO ()