-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | A small library for parsing IRC messages.
--   
--   A set of combinators and types for parsing IRC messages.
@package irc
@version 0.6.1.0

-- | Datatypes for representing IRC messages, as well as formatting them.
module Network.IRC.Base
type Parameter = ByteString
type ServerName = ByteString
type UserName = ByteString
type RealName = ByteString
type Command = ByteString

-- | The optional beginning of an IRC messages
data Prefix

-- | Server Prefix
Server :: ServerName -> Prefix

-- | Nickname Prefix
NickName :: ByteString -> (Maybe UserName) -> (Maybe ServerName) -> Prefix

-- | IRC messages are parsed as: [ : prefix space ] command {
--   space param } crlf
data Message
Message :: Maybe Prefix -> Command -> [Parameter] -> Message
[msg_prefix] :: Message -> Maybe Prefix
[msg_command] :: Message -> Command
[msg_params] :: Message -> [Parameter]

-- | Encode a message to its string representation
encode :: Message -> ByteString
showMessage :: Message -> ByteString
showPrefix :: Prefix -> ByteString
showParameters :: [Parameter] -> ByteString

-- | Translate a reply into its text description. If no text is available,
--   the argument is returned.
translateReply :: Command -> ByteString
replyTable :: [(ByteString, ByteString)]

-- | This is the deprecated version of encode
render :: Message -> ByteString
instance GHC.Classes.Eq Network.IRC.Base.Message
instance GHC.Read.Read Network.IRC.Base.Message
instance GHC.Show.Show Network.IRC.Base.Message
instance GHC.Classes.Eq Network.IRC.Base.Prefix
instance GHC.Read.Read Network.IRC.Base.Prefix
instance GHC.Show.Show Network.IRC.Base.Prefix

module Network.IRC.Commands
type Channel = ByteString
type Password = ByteString
nick :: UserName -> Message
user :: UserName -> ServerName -> ServerName -> RealName -> Message
joinChan :: Channel -> Message
part :: Channel -> Message
quit :: Maybe ByteString -> Message
privmsg :: ByteString -> ByteString -> Message
kick :: Channel -> UserName -> Maybe Reason -> Message
pong :: ServerName -> Message

-- | Parsec parsers and a general parsing interface for IRC messages
module Network.IRC.Parser

-- | Parse a String into a Message.
decode :: ByteString -> Maybe Message

-- | Parse a Prefix
prefix :: Parser Prefix

-- | Parse a Server prefix
serverPrefix :: Parser Prefix

-- | Parse a NickName prefix
nicknamePrefix :: Parser Prefix

-- | Parse a command. Either a string of capital letters, or 3 digits.
command :: Parser Command

-- | Parse a command parameter.
parameter :: Parser Parameter

-- | Parse a Message
message :: Parser Message

-- | Parse a cr lf
crlf :: Parser ()

-- | Consume only spaces, tabs, or the bell character
spaces :: Parser ()

-- | The deprecated version of decode
parseMessage :: ByteString -> Maybe Message

-- | library for parsing IRC messages
module Network.IRC
