-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A library for parsing a chat-based work hour reporting scheme. -- -- Parses a certain format for hour and task reporting in chat/Slack -- form. See README for format. @package work-time @version 0.1.0.0 -- | Main API for WorkTime. This re-exports all functions meant to -- be used. module WorkTime -- | Main data type of the library. Represents an entry in Slack containing -- a Nickname, Timestamp, Datestamp and -- WorkDay that themselves contain several -- TaskDescription. -- -- An entire entry will look as follows: -- --
-- Rickard Andersson [11:16 PM] -- [28.02] 8.5h -- worked on missile guidance system -- cleaned up parsing code ---- -- The first part is represented by a MessageLine and what follows -- is one Workday in this example. -- -- An entry can also look as follows: -- --
-- Rickard Andersson [11:16 PM] -- [28.02] 8.5h -- worked on missile guidance system -- cleaned up parsing code -- [01.03] 6h -- fixed critical bug in missile guidance system -- removed half of parsing code ---- -- In this example we have several Workday in one WorkTime. data WorkTime WorkTime :: MessageLine -> [Workday] -> WorkTime -- | Represents a line like Rickard Andersson [10:48 AM] in Slack. data MessageLine -- | Represents a collection of lines like -- --
-- [28.02] 8.5h -- worked on missile guidance system -- cleaned up parsing code ---- -- in Slack. data Workday -- | Parses a Text either into a [WorkTime] or into an error -- message in the form of a String. The error message may be less -- than informative as it comes straight from the parser -- (Data.Attoparsec.Text). fromText :: Text -> Either String [WorkTime] -- | Extracts the total work hours from a WorkTime entry, from all -- workdays in the entry. workTimeHours :: WorkTime -> Double -- | Extracts the nickname from a WorkTime entry. workTimeNickname :: WorkTime -> Text -- | Takes a text and turns it into a list of a nickname (Text) and -- work hours (Double). hoursFromText :: Text -> Either String [(Text, Double)] -- | Takes a list of WorkTime and creates a map of nickname -- (Text) to work hours (Double). hours :: [WorkTime] -> Map Text Double