-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Parse IRC logs such as the #haskell logs on tunes.org
--
-- Use this library to parse IRC logs saved by the clog bot on
-- Freenode. This includes the logs of #haskell which are
-- available from http://tunes.org/~nef/logs/haskell/.
--
-- Suggestions and patches are welcome.
@package clogparse
@version 0.1
-- | Represents events in an IRC channel. These do not correspond precisely
-- to messages of the IRC protocol. They provide a somewhat higher-level
-- view.
module Data.IRC.Event
-- | IRC nicks.
newtype Nick
Nick :: Text -> Nick
-- | Events in an IRC channel.
data Event
-- | User joined.
Join :: Nick -> Text -> Event
-- | User left the channel.
Part :: Nick -> Text -> Event
-- | User quit the server.
Quit :: Nick -> Text -> Event
-- | User changed from one to another nick.
ReNick :: Nick -> Nick -> Event
-- | User spoke (PRIVMSG).
Talk :: Nick -> Text -> Event
-- | User spoke (NOTICE).
Notice :: Nick -> Text -> Event
-- | User acted (CTCP ACTION).
Act :: Nick -> Text -> Event
-- | User was kicked by user.
Kick :: Nick -> Nick -> Text -> Event
-- | User set mode on the channel.
Mode :: Nick -> Text -> Event
-- | Logging started or stopped.
Log :: Text -> Event
-- | Topic listing or change.
Topic :: Text -> Event
-- | Users list.
Names :: Text -> Event
-- | Event with timestamp.
data EventAt
-- | Event with timestamp.
EventAt :: UTCTime -> Event -> EventAt
-- | Unparsable line.
NoParse :: Text -> EventAt
instance Show Event
instance Eq Event
instance Ord Event
instance Show Nick
instance Eq Nick
instance Ord Nick
instance Show EventAt
instance Eq EventAt
instance Ord EventAt
-- | Parse events from clog output, such as the files at
-- http://tunes.org/~nef/logs/haskell/.
--
-- IRC has no single standard character encoding. This module decodes
-- messages as UTF-8 following common practice on Freenode.
module Data.IRC.CLog.Parse
-- | Parse a log file. The file name (after any directory) is significant.
-- It is used to set the date for timestamps. It should have the form
-- YY.MM.DD, as do the files on tunes.org.
parseLog :: Config -> FilePath -> IO [EventAt]
-- | Configuring the parser.
data Config
Config :: String -> FilePath -> Config
-- | Timestamp time zone; an Olson time zone name.
timeZone :: Config -> String
-- | Directory for time zone files; $TZDIR overrides.
zoneInfo :: Config -> FilePath
-- | Config value suitable for parsing #haskell
-- logs on Linux.
haskellConfig :: Config
instance Show Config