-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An IRC client library and text client -- -- This package provides an IRC connection library as well as a -- console-based IRC client that uses the library. -- -- Library module breakdown -- --
-- :prefix COMMAND param0 param1 param2 .. paramN --data RawIrcMsg [RawIrcMsg] :: Maybe UTCTime -> Maybe UserInfo -> ByteString -> [ByteString] -> RawIrcMsg [msgTime] :: RawIrcMsg -> Maybe UTCTime [msgPrefix] :: RawIrcMsg -> Maybe UserInfo [msgCommand] :: RawIrcMsg -> ByteString [msgParams] :: RawIrcMsg -> [ByteString] -- | Attempt to split an IRC protocol message without its trailing newline -- information into a structured message. parseRawIrcMsg :: ByteString -> Maybe RawIrcMsg -- | Serialize a structured IRC protocol message back into its wire format. -- This command adds the required trailing newline. renderRawIrcMsg :: RawIrcMsg -> ByteString -- | Split up a hostmask into a nickname, username, and hostname. The -- username and hostname might not be defined but are delimited by a -- ! and @ respectively. parseUserInfo :: ByteString -> UserInfo -- | Take the bytes up to the next space delimiter. If the first character -- of this token is a : then take the whole remaining bytestring -- -- Render UserInfo as nick!username@hostname renderUserInfo :: UserInfo -> ByteString -- | Case insensitive identifier representing channels and nicknames data Identifier -- | Construct an Identifier from a ByteString mkId :: ByteString -> Identifier -- | Returns the original ByteString of an Identifier idBytes :: Identifier -> ByteString -- | Returns the case-normalized ByteString of an Identifier -- which is suitable for comparison. idDenote :: Identifier -> ByteString asUtf8 :: ByteString -> Text -- | Capitalize a string according to RFC 2812 Latin letters are -- capitalized and {|}~ are mapped to []^ ircFoldCase :: ByteString -> ByteString instance Show RawIrcMsg instance Read RawIrcMsg instance Show UserInfo instance Read UserInfo instance Show Identifier instance Read Identifier instance Eq Identifier instance Ord Identifier instance IsString Identifier -- | This module provides functions for constructing outgoing IRC messages -- from the client to the server. -- -- Note: These functions add the required trailing newline characters. module Irc.Cmd -- | Construct a PASS command. This is used in the initial handshake to -- specify a password for the connection. -- --
-- PASS password --passCmd :: ByteString -> ByteString -- | Construct a NICK command. This is used to specify the initial nickname -- as well as to change it. -- --
-- NICK nickname --nickCmd :: Identifier -> ByteString -- | Construct a USER command. This is used in the initial handshake to -- specify username and realname. -- --
-- USER username 0 * realname --userCmd :: ByteString -> ByteString -> ByteString -- | Construct an OPER command. -- --
-- OPER name password --operCmd :: ByteString -> ByteString -> ByteString -- | Construct a MODE command -- --
-- MODE target *(mode) *(modeparams) --modeCmd :: Identifier -> [ByteString] -> ByteString -- | Construct a QUIT command. -- --
-- QUIT quit_message --quitCmd :: ByteString -> ByteString -- | Construct a JOIN command. A join command can support multiple channels -- separated by commas, and takes an optional channel key. -- --
-- JOIN channel [key] --joinCmd :: Identifier -> Maybe ByteString -> ByteString -- | Construct a PART command. -- --
-- PART channel message --partCmd :: Identifier -> ByteString -> ByteString -- | Construct a TOPIC command. This is used to lookup the current topic or -- to change it. -- --
-- TOPIC channel message --topicCmd :: Identifier -> ByteString -> ByteString -- | Construct a NAMES command. -- --
-- NAMES [ channel *("," channel)
--
namesCmd :: [Identifier] -> ByteString
-- | Construct a LIST command.
--
--
-- LIST channel *("," channel)
--
listCmd :: [Identifier] -> ByteString
-- | Construct a INVITE command.
--
-- -- INVITE nickanme channel --inviteCmd :: Identifier -> Identifier -> ByteString -- | Construct a KICK command -- -- @KICK channel nick msg kickCmd :: Identifier -> Identifier -> ByteString -> ByteString -- | Construct a PRIVMSG command. This send normal chat messages to both -- users as well as channels. -- --
-- PRIVMSG target message --privMsgCmd :: Identifier -> ByteString -> ByteString ctcpRequestCmd :: Identifier -> ByteString -> ByteString -> ByteString ctcpResponseCmd :: Identifier -> ByteString -> ByteString -> ByteString -- | Construct a NOTICE command. This send notice chat messages to both -- users as well as channels. -- --
-- NOTICE target message --noticeCmd :: Identifier -> ByteString -> ByteString -- | Construct a WHOIS command. -- --
-- WHOIS user --whoisCmd :: Identifier -> ByteString -- | Construct a WHOWAS command. -- --
-- WHOWAS user --whowasCmd :: Identifier -> ByteString -- | Construct a WHO command. -- --
-- WHO mask --whoCmd :: ByteString -> ByteString -- | Construct a PONG command. This is used to respond to the PING command -- to keep a connection alive. -- --
-- PONG token --pongCmd :: ByteString -> ByteString -- | Construct a PING command. This is used to respond to the PING command -- to keep a connection alive. -- --
-- PONG token --pingCmd :: ByteString -> ByteString -- | Construct a CAP LS command. This is used during the inital connection -- to request a list of extensions that are supported by the server. It -- should be followed by CAP REQ and eventually CAP END commands. -- --
-- CAP LS --capLsCmd :: ByteString -- | Construct a CAP REQ command. This is used to request a subset of the -- capabilities returned in response to a CAP LS command. -- --
-- CAP REQ :cap0 cap1 .. capN --capReqCmd :: [ByteString] -> ByteString -- | Construct a CAP END command. This terminates the capability -- negotiation portion of the initial connection. -- --
-- CAP END --capEndCmd :: ByteString -- | Construct an AUTHENTICATE command. -- --
-- AUTHENTICATE message --authenticateCmd :: ByteString -> ByteString -- | Construct an AWAY command. -- --
-- AWAY away_message --awayCmd :: ByteString -> ByteString -- | Construct a HELP command. -- --
-- HELP topic --helpCmd :: ByteString -> ByteString -- | Construct a REMOVE command -- -- @REMOVE channel nick msg removeCmd :: Identifier -> Identifier -> ByteString -> ByteString -- | Construct a KNOCK command. -- --
-- KNOCK channel --knockCmd :: Identifier -> ByteString -- | Construct an ACCEPT command. -- --
-- ACCEPT nick --acceptCmd :: ByteString -> ByteString -- | Construct an TIME command. -- --
-- TIME [server]> --timeCmd :: Maybe ByteString -> ByteString -- | Construct an ADMIN command. -- --
-- ADMIN [server]> --adminCmd :: Maybe ByteString -> ByteString -- | Construct a STATS command. -- --
-- STATS letter [server]> --statsCmd :: Char -> Maybe ByteString -> ByteString -- | This module provides a bridge between the low-level text protocol that -- IRC uses and the high-level events in the Irc.Model module. module Irc.Core -- | MsgFromServer provides a typed view of the various IRC protocol -- messages. There are more messages defined for IRC (and many of those -- overlap) than are in common use. Please report a bug if a common -- message is missing from this type. data MsgFromServer -- | 001 "Welcome to the Internet Relay Network -- <nick>!<user>@<host>" [RplWelcome] :: ByteString -> MsgFromServer -- | 002 "Your host is <servername>, running version <ver>" [RplYourHost] :: ByteString -> MsgFromServer -- | 003 "This server was created <date>" [RplCreated] :: ByteString -> MsgFromServer -- | 004 servername version *(modes) [RplMyInfo] :: ByteString -> ByteString -> [ByteString] -> MsgFromServer -- | 005 *(KEY=VALUE) [RplISupport] :: [(ByteString, ByteString)] -> MsgFromServer -- | 008 snomask [RplSnoMask] :: ByteString -> MsgFromServer -- | 042 unique-id [RplYourId] :: ByteString -> MsgFromServer -- | 211 arguments [RplStatsLinkInfo] :: [ByteString] -> MsgFromServer -- | 212 arguments [RplStatsCommands] :: [ByteString] -> MsgFromServer -- | 213 arguments [RplStatsCLine] :: [ByteString] -> MsgFromServer -- | 214 arguments [RplStatsNLine] :: [ByteString] -> MsgFromServer -- | 215 arguments [RplStatsILine] :: [ByteString] -> MsgFromServer -- | 216 arguments [RplStatsKLine] :: [ByteString] -> MsgFromServer -- | 217 arguments [RplStatsQLine] :: [ByteString] -> MsgFromServer -- | 218 arguments [RplStatsYLine] :: [ByteString] -> MsgFromServer -- | 219 mode [RplEndOfStats] :: Char -> MsgFromServer -- | 220 arguments [RplStatsPLine] :: [ByteString] -> MsgFromServer -- | 221 modes *(params) [RplUmodeIs] :: ByteString -> [ByteString] -> MsgFromServer -- | 225 [RplStatsDLine] :: [ByteString] -> MsgFromServer -- | 240 [RplStatsVLine] :: [ByteString] -> MsgFromServer -- | 241 [RplStatsLLine] :: [ByteString] -> MsgFromServer -- | 242 [RplStatsUptime] :: ByteString -> MsgFromServer -- | 243 [RplStatsOLine] :: [ByteString] -> MsgFromServer -- | 244 [RplStatsHLine] :: [ByteString] -> MsgFromServer -- | 245 [RplStatsSLine] :: [ByteString] -> MsgFromServer -- | 246 [RplStatsPing] :: [ByteString] -> MsgFromServer -- | 247 [RplStatsXLine] :: [ByteString] -> MsgFromServer -- | 248 [RplStatsULine] :: [ByteString] -> MsgFromServer -- | 249 [RplStatsDebug] :: [ByteString] -> MsgFromServer -- | 250 connection [RplStatsConn] :: ByteString -> MsgFromServer -- | 251 "There are <integer> users and <integer> services on -- <integer> servers" [RplLuserClient] :: ByteString -> MsgFromServer -- | 252 number-of-ops [RplLuserOp] :: ByteString -> MsgFromServer -- | 253 number-of-unknown [RplLuserUnknown] :: ByteString -> MsgFromServer -- | 254 number-of-channels [RplLuserChannels] :: ByteString -> MsgFromServer -- | 255 "I have <integer> clients and <integer> servers" [RplLuserMe] :: ByteString -> MsgFromServer -- | 256 server [RplLuserAdminMe] :: ByteString -> MsgFromServer -- | 257 admin-info-1 [RplLuserAdminLoc1] :: ByteString -> MsgFromServer -- | 258 admin-info-2 [RplLuserAdminLoc2] :: ByteString -> MsgFromServer -- | 259 admin-email [RplLuserAdminEmail] :: ByteString -> MsgFromServer -- | 263 command [RplLoadTooHigh] :: ByteString -> MsgFromServer -- | 265 [local] [max] txt [RplLocalUsers] :: [ByteString] -> MsgFromServer -- | 266 [global] [max] txt [RplGlobalUsers] :: [ByteString] -> MsgFromServer -- | 270 privstring [RplPrivs] :: ByteString -> MsgFromServer -- | 276 nick txt [RplWhoisCertFp] :: Identifier -> ByteString -> MsgFromServer -- | 281 [RplAcceptList] :: Identifier -> MsgFromServer -- | 282 [RplEndOfAccept] :: MsgFromServer -- | 301 nick away_message [RplAway] :: Identifier -> ByteString -> MsgFromServer -- | 302 *(user hosts) [RplUserHost] :: [ByteString] -> MsgFromServer -- | 303 *(nick) [RplIsOn] :: [Identifier] -> MsgFromServer -- | (inspircd) 304 text [RplSyntax] :: ByteString -> MsgFromServer -- | 305 [RplUnAway] :: MsgFromServer -- | 306 [RplNowAway] :: MsgFromServer -- | 311 nick user host realname [RplWhoisUser] :: Identifier -> ByteString -> ByteString -> ByteString -> MsgFromServer -- | 312 nick server serverinfo [RplWhoisServer] :: Identifier -> ByteString -> ByteString -> MsgFromServer -- | 313 nick "is an IRC operator" [RplWhoisOperator] :: Identifier -> ByteString -> MsgFromServer -- | 314 nick user host realname [RplWhoWasUser] :: Identifier -> ByteString -> ByteString -> ByteString -> MsgFromServer -- | 315 channel [RplEndOfWho] :: Identifier -> MsgFromServer -- | 317 nick idle signon [RplWhoisIdle] :: Identifier -> Integer -> (Maybe UTCTime) -> MsgFromServer -- | 318 nick [RplEndOfWhois] :: Identifier -> MsgFromServer -- | 319 nick channels [RplWhoisChannels] :: Identifier -> ByteString -> MsgFromServer -- | 321 [RplListStart] :: MsgFromServer -- | 322 channel usercount topic [RplList] :: Identifier -> Integer -> ByteString -> MsgFromServer -- | 323 [RplListEnd] :: MsgFromServer -- | 324 channel modes *(params) [RplChannelModeIs] :: Identifier -> ByteString -> [ByteString] -> MsgFromServer -- | 331 channel [RplNoTopicSet] :: Identifier -> MsgFromServer -- | 332 channel topic [RplTopic] :: Identifier -> ByteString -> MsgFromServer -- | 328 channel url [RplChannelUrl] :: Identifier -> ByteString -> MsgFromServer -- | 329 channel timestamp [RplCreationTime] :: Identifier -> UTCTime -> MsgFromServer -- | 330 nick account [RplWhoisAccount] :: Identifier -> ByteString -> MsgFromServer -- | 333 channel nickname timestamp [RplTopicWhoTime] :: Identifier -> ByteString -> UTCTime -> MsgFromServer -- | 341 nick channel [RplInviting] :: Identifier -> Identifier -> MsgFromServer -- | 346 channel mask who timestamp [RplInviteList] :: Identifier -> ByteString -> ByteString -> UTCTime -> MsgFromServer -- | 347 channel [RplEndOfInviteList] :: Identifier -> MsgFromServer -- | 348 channel mask who timestamp [RplExceptionList] :: Identifier -> ByteString -> ByteString -> UTCTime -> MsgFromServer -- | 349 channel [RplEndOfExceptionList] :: Identifier -> MsgFromServer -- | 351 version server comments [RplVersion] :: [ByteString] -> MsgFromServer -- | 352 channel user host server nick flags txt [RplWhoReply] :: Identifier -> ByteString -> ByteString -> ByteString -> Identifier -> ByteString -> ByteString -> MsgFromServer -- | 353 channeltype channel names [RplNameReply] :: ChannelType -> Identifier -> [ByteString] -> MsgFromServer -- | 364 mask server info [RplLinks] :: ByteString -> ByteString -> ByteString -> MsgFromServer -- | 365 mask [RplEndOfLinks] :: ByteString -> MsgFromServer -- | 366 channel [RplEndOfNames] :: Identifier -> MsgFromServer -- | 367 channel banned banner timestamp [RplBanList] :: Identifier -> ByteString -> ByteString -> UTCTime -> MsgFromServer -- | 368 channel [RplEndOfBanList] :: Identifier -> MsgFromServer -- | 369 nick [RplEndOfWhoWas] :: Identifier -> MsgFromServer -- | 372 line-of-motd [RplMotd] :: ByteString -> MsgFromServer -- | 375 [RplMotdStart] :: MsgFromServer -- | 376 [RplEndOfMotd] :: MsgFromServer -- | 391 server "<string showing server's local time>" [RplTime] :: ByteString -> ByteString -> MsgFromServer -- | 371 info [RplInfo] :: ByteString -> MsgFromServer -- | 374 [RplEndOfInfo] :: MsgFromServer -- | 378 nick host [RplWhoisHost] :: Identifier -> ByteString -> MsgFromServer -- | 379 nick modes *(args) [RplWhoisModes] :: Identifier -> ByteString -> [ByteString] -> MsgFromServer -- | 381 text [RplYoureOper] :: ByteString -> MsgFromServer -- | 396 hostname [RplHostHidden] :: ByteString -> MsgFromServer [Err] :: Identifier -> IrcError -> MsgFromServer -- | 671 nick [RplWhoisSecure] :: Identifier -> MsgFromServer -- | 704 topic text [RplHelpStart] :: ByteString -> ByteString -> MsgFromServer -- | 705 topic text [RplHelp] :: ByteString -> ByteString -> MsgFromServer -- | 706 topic text [RplEndOfHelp] :: ByteString -> MsgFromServer -- | 710 channel [RplKnock] :: Identifier -> UserInfo -> MsgFromServer -- | 711 channel [RplKnockDelivered] :: Identifier -> MsgFromServer -- | 717 nick [RplTargNotify] :: Identifier -> MsgFromServer -- | 718 nick mask [RplUmodeGMsg] :: Identifier -> ByteString -> MsgFromServer -- | 728 channel mode mask who timestamp [RplQuietList] :: Identifier -> Char -> ByteString -> ByteString -> UTCTime -> MsgFromServer -- | 729 channel mode [RplEndOfQuietList] :: Identifier -> Char -> MsgFromServer -- | 900 account [RplLoggedIn] :: ByteString -> MsgFromServer -- | 901 [RplLoggedOut] :: MsgFromServer -- | 902 [RplNickLocked] :: MsgFromServer -- | 903 [RplSaslSuccess] :: MsgFromServer -- | 904 [RplSaslFail] :: MsgFromServer -- | 905 [RplSaslTooLong] :: MsgFromServer -- | 906 [RplSaslAborted] :: MsgFromServer -- | 907 [RplSaslAlready] :: MsgFromServer -- | 908 comma-sep-mechs [RplSaslMechs] :: ByteString -> MsgFromServer [Away] :: UserInfo -> (Maybe ByteString) -> MsgFromServer [Ping] :: ByteString -> MsgFromServer [Pong] :: ByteString -> (Maybe ByteString) -> MsgFromServer [Notice] :: UserInfo -> Identifier -> ByteString -> MsgFromServer [Topic] :: UserInfo -> Identifier -> ByteString -> MsgFromServer [PrivMsg] :: UserInfo -> Identifier -> ByteString -> MsgFromServer [ExtJoin] :: UserInfo -> Identifier -> (Maybe ByteString) -> ByteString -> MsgFromServer [Join] :: UserInfo -> Identifier -> MsgFromServer [Nick] :: UserInfo -> Identifier -> MsgFromServer [Mode] :: UserInfo -> Identifier -> [ByteString] -> MsgFromServer [Quit] :: UserInfo -> ByteString -> MsgFromServer [Cap] :: ByteString -> ByteString -> MsgFromServer [Kick] :: UserInfo -> Identifier -> Identifier -> ByteString -> MsgFromServer [Part] :: UserInfo -> Identifier -> ByteString -> MsgFromServer [Invite] :: UserInfo -> Identifier -> MsgFromServer [Error] :: ByteString -> MsgFromServer [Authenticate] :: ByteString -> MsgFromServer [Account] :: UserInfo -> (Maybe ByteString) -> MsgFromServer data IrcError -- | 401 [ErrNoSuchNick] :: IrcError -- | 402 server [ErrNoSuchServer] :: ByteString -> IrcError -- | 403 [ErrNoSuchChannel] :: IrcError -- | 404 [ErrCannotSendToChan] :: IrcError -- | 405 [ErrTooManyChannels] :: IrcError -- | 406 [ErrWasNoSuchNick] :: IrcError -- | 407 [ErrTooManyTargets] :: IrcError -- | 409 [ErrNoOrigin] :: IrcError -- | 411 [ErrNoRecipient] :: IrcError -- | 412 [ErrNoTextToSend] :: IrcError -- | 421 command [ErrUnknownCommand] :: ByteString -> IrcError -- | 422 [ErrNoMotd] :: IrcError -- | 423 server [ErrNoAdminInfo] :: ByteString -> IrcError -- | 431 [ErrNoNicknameGiven] :: IrcError -- | 432 badnick [ErrErroneousNickname] :: ByteString -> IrcError -- | 433 nick [ErrNicknameInUse] :: Identifier -> IrcError -- | 435 [ErrBanNickChange] :: IrcError -- | 437 [ErrUnavailResource] :: IrcError -- | 438 [ErrNickTooFast] :: IrcError -- | 440 [ErrServicesDown] :: IrcError -- | 441 nick [ErrUserNotInChannel] :: Identifier -> IrcError -- | 442 channel [ErrNotOnChannel] :: IrcError -- | 443 nick [ErrUserOnChannel] :: Identifier -> IrcError -- | 451 [ErrNotRegistered] :: IrcError -- | 456 [ErrAcceptFull] :: IrcError -- | 457 [ErrAcceptExist] :: IrcError -- | 458 [ErrAcceptNot] :: IrcError -- | 461 command [ErrNeedMoreParams] :: ByteString -> IrcError -- | 462 [ErrAlreadyRegistered] :: IrcError -- | 463 [ErrNoPermForHost] :: IrcError -- | 464 [ErrPasswordMismatch] :: IrcError -- | 465 [ErrYoureBannedCreep] :: IrcError -- | 470 dstchannel [ErrLinkChannel] :: Identifier -> IrcError -- | 471 channel [ErrChannelFull] :: IrcError -- | 472 mode [ErrUnknownMode] :: Char -> IrcError -- | 473 [ErrInviteOnlyChan] :: IrcError -- | 474 [ErrBannedFromChan] :: IrcError -- | 475 [ErrBadChannelKey] :: IrcError -- | 477 [ErrNeedReggedNick] :: IrcError -- | 478 mode [ErrBanListFull] :: Char -> IrcError -- | 479 name [ErrBadChanName] :: ByteString -> IrcError -- | 480 [ErrThrottle] :: IrcError -- | 481 [ErrNoPrivileges] :: IrcError -- | 482 [ErrChanOpPrivsNeeded] :: IrcError -- | 483 [ErrCantKillServer] :: IrcError -- | 484 nick [ErrIsChanService] :: Identifier -> IrcError -- | 486 [ErrNoNonReg] :: IrcError -- | 489 [ErrVoiceNeeded] :: IrcError -- | 491 [ErrNoOperHost] :: IrcError -- | 494 [ErrOwnMode] :: IrcError -- | 501 mode [ErrUnknownUmodeFlag] :: Char -> IrcError -- | 502 [ErrUsersDontMatch] :: IrcError -- | 524 topic [ErrHelpNotFound] :: ByteString -> IrcError -- | 713 [ErrTooManyKnocks] :: IrcError -- | 713 [ErrChanOpen] :: IrcError -- | 714 [ErrKnockOnChan] :: IrcError -- | 716 [ErrTargUmodeG] :: IrcError -- | 723 priv [ErrNoPrivs] :: ByteString -> IrcError -- | 742 mode setting [ErrMlockRestricted] :: Char -> ByteString -> IrcError ircMsgToServerMsg :: RawIrcMsg -> Maybe MsgFromServer instance Show MsgFromServer instance Read MsgFromServer instance Show ChannelType instance Read ChannelType instance Show IrcError instance Read IrcError -- | Automatically generated Prisms for all of the types in -- MsgFromServer module Irc.Core.Prisms _Account :: Prism' MsgFromServer (UserInfo, Maybe ByteString) _Authenticate :: Prism' MsgFromServer ByteString _Error :: Prism' MsgFromServer ByteString _Invite :: Prism' MsgFromServer (UserInfo, Identifier) _Part :: Prism' MsgFromServer (UserInfo, Identifier, ByteString) _Kick :: Prism' MsgFromServer (UserInfo, Identifier, Identifier, ByteString) _Cap :: Prism' MsgFromServer (ByteString, ByteString) _Quit :: Prism' MsgFromServer (UserInfo, ByteString) _Mode :: Prism' MsgFromServer (UserInfo, Identifier, [ByteString]) _Nick :: Prism' MsgFromServer (UserInfo, Identifier) _Join :: Prism' MsgFromServer (UserInfo, Identifier) _ExtJoin :: Prism' MsgFromServer (UserInfo, Identifier, Maybe ByteString, ByteString) _PrivMsg :: Prism' MsgFromServer (UserInfo, Identifier, ByteString) _Topic :: Prism' MsgFromServer (UserInfo, Identifier, ByteString) _Notice :: Prism' MsgFromServer (UserInfo, Identifier, ByteString) _Pong :: Prism' MsgFromServer (ByteString, Maybe ByteString) _Ping :: Prism' MsgFromServer ByteString _Away :: Prism' MsgFromServer (UserInfo, Maybe ByteString) _RplSaslMechs :: Prism' MsgFromServer ByteString _RplSaslAlready :: Prism' MsgFromServer () _RplSaslAborted :: Prism' MsgFromServer () _RplSaslTooLong :: Prism' MsgFromServer () _RplSaslFail :: Prism' MsgFromServer () _RplSaslSuccess :: Prism' MsgFromServer () _RplNickLocked :: Prism' MsgFromServer () _RplLoggedOut :: Prism' MsgFromServer () _RplLoggedIn :: Prism' MsgFromServer ByteString _RplEndOfQuietList :: Prism' MsgFromServer (Identifier, Char) _RplQuietList :: Prism' MsgFromServer (Identifier, Char, ByteString, ByteString, UTCTime) _RplUmodeGMsg :: Prism' MsgFromServer (Identifier, ByteString) _RplTargNotify :: Prism' MsgFromServer Identifier _RplKnockDelivered :: Prism' MsgFromServer Identifier _RplKnock :: Prism' MsgFromServer (Identifier, UserInfo) _RplEndOfHelp :: Prism' MsgFromServer ByteString _RplHelp :: Prism' MsgFromServer (ByteString, ByteString) _RplHelpStart :: Prism' MsgFromServer (ByteString, ByteString) _RplWhoisSecure :: Prism' MsgFromServer Identifier _Err :: Prism' MsgFromServer (Identifier, IrcError) _RplHostHidden :: Prism' MsgFromServer ByteString _RplYoureOper :: Prism' MsgFromServer ByteString _RplWhoisModes :: Prism' MsgFromServer (Identifier, ByteString, [ByteString]) _RplWhoisHost :: Prism' MsgFromServer (Identifier, ByteString) _RplEndOfInfo :: Prism' MsgFromServer () _RplInfo :: Prism' MsgFromServer ByteString _RplTime :: Prism' MsgFromServer (ByteString, ByteString) _RplEndOfMotd :: Prism' MsgFromServer () _RplMotdStart :: Prism' MsgFromServer () _RplMotd :: Prism' MsgFromServer ByteString _RplEndOfWhoWas :: Prism' MsgFromServer Identifier _RplEndOfBanList :: Prism' MsgFromServer Identifier _RplBanList :: Prism' MsgFromServer (Identifier, ByteString, ByteString, UTCTime) _RplEndOfNames :: Prism' MsgFromServer Identifier _RplEndOfLinks :: Prism' MsgFromServer ByteString _RplLinks :: Prism' MsgFromServer (ByteString, ByteString, ByteString) _RplNameReply :: Prism' MsgFromServer (ChannelType, Identifier, [ByteString]) _RplWhoReply :: Prism' MsgFromServer (Identifier, ByteString, ByteString, ByteString, Identifier, ByteString, ByteString) _RplVersion :: Prism' MsgFromServer [ByteString] _RplEndOfExceptionList :: Prism' MsgFromServer Identifier _RplExceptionList :: Prism' MsgFromServer (Identifier, ByteString, ByteString, UTCTime) _RplEndOfInviteList :: Prism' MsgFromServer Identifier _RplInviteList :: Prism' MsgFromServer (Identifier, ByteString, ByteString, UTCTime) _RplInviting :: Prism' MsgFromServer (Identifier, Identifier) _RplTopicWhoTime :: Prism' MsgFromServer (Identifier, ByteString, UTCTime) _RplWhoisAccount :: Prism' MsgFromServer (Identifier, ByteString) _RplCreationTime :: Prism' MsgFromServer (Identifier, UTCTime) _RplChannelUrl :: Prism' MsgFromServer (Identifier, ByteString) _RplTopic :: Prism' MsgFromServer (Identifier, ByteString) _RplNoTopicSet :: Prism' MsgFromServer Identifier _RplChannelModeIs :: Prism' MsgFromServer (Identifier, ByteString, [ByteString]) _RplListEnd :: Prism' MsgFromServer () _RplList :: Prism' MsgFromServer (Identifier, Integer, ByteString) _RplListStart :: Prism' MsgFromServer () _RplWhoisChannels :: Prism' MsgFromServer (Identifier, ByteString) _RplEndOfWhois :: Prism' MsgFromServer Identifier _RplWhoisIdle :: Prism' MsgFromServer (Identifier, Integer, Maybe UTCTime) _RplEndOfWho :: Prism' MsgFromServer Identifier _RplWhoWasUser :: Prism' MsgFromServer (Identifier, ByteString, ByteString, ByteString) _RplWhoisOperator :: Prism' MsgFromServer (Identifier, ByteString) _RplWhoisServer :: Prism' MsgFromServer (Identifier, ByteString, ByteString) _RplWhoisUser :: Prism' MsgFromServer (Identifier, ByteString, ByteString, ByteString) _RplNowAway :: Prism' MsgFromServer () _RplUnAway :: Prism' MsgFromServer () _RplSyntax :: Prism' MsgFromServer ByteString _RplIsOn :: Prism' MsgFromServer [Identifier] _RplUserHost :: Prism' MsgFromServer [ByteString] _RplAway :: Prism' MsgFromServer (Identifier, ByteString) _RplEndOfAccept :: Prism' MsgFromServer () _RplAcceptList :: Prism' MsgFromServer Identifier _RplWhoisCertFp :: Prism' MsgFromServer (Identifier, ByteString) _RplPrivs :: Prism' MsgFromServer ByteString _RplGlobalUsers :: Prism' MsgFromServer [ByteString] _RplLocalUsers :: Prism' MsgFromServer [ByteString] _RplLoadTooHigh :: Prism' MsgFromServer ByteString _RplLuserAdminEmail :: Prism' MsgFromServer ByteString _RplLuserAdminLoc2 :: Prism' MsgFromServer ByteString _RplLuserAdminLoc1 :: Prism' MsgFromServer ByteString _RplLuserAdminMe :: Prism' MsgFromServer ByteString _RplLuserMe :: Prism' MsgFromServer ByteString _RplLuserChannels :: Prism' MsgFromServer ByteString _RplLuserUnknown :: Prism' MsgFromServer ByteString _RplLuserOp :: Prism' MsgFromServer ByteString _RplLuserClient :: Prism' MsgFromServer ByteString _RplStatsConn :: Prism' MsgFromServer ByteString _RplStatsDebug :: Prism' MsgFromServer [ByteString] _RplStatsULine :: Prism' MsgFromServer [ByteString] _RplStatsXLine :: Prism' MsgFromServer [ByteString] _RplStatsPing :: Prism' MsgFromServer [ByteString] _RplStatsSLine :: Prism' MsgFromServer [ByteString] _RplStatsHLine :: Prism' MsgFromServer [ByteString] _RplStatsOLine :: Prism' MsgFromServer [ByteString] _RplStatsUptime :: Prism' MsgFromServer ByteString _RplStatsLLine :: Prism' MsgFromServer [ByteString] _RplStatsVLine :: Prism' MsgFromServer [ByteString] _RplStatsDLine :: Prism' MsgFromServer [ByteString] _RplUmodeIs :: Prism' MsgFromServer (ByteString, [ByteString]) _RplStatsPLine :: Prism' MsgFromServer [ByteString] _RplEndOfStats :: Prism' MsgFromServer Char _RplStatsYLine :: Prism' MsgFromServer [ByteString] _RplStatsQLine :: Prism' MsgFromServer [ByteString] _RplStatsKLine :: Prism' MsgFromServer [ByteString] _RplStatsILine :: Prism' MsgFromServer [ByteString] _RplStatsNLine :: Prism' MsgFromServer [ByteString] _RplStatsCLine :: Prism' MsgFromServer [ByteString] _RplStatsCommands :: Prism' MsgFromServer [ByteString] _RplStatsLinkInfo :: Prism' MsgFromServer [ByteString] _RplYourId :: Prism' MsgFromServer ByteString _RplSnoMask :: Prism' MsgFromServer ByteString _RplISupport :: Prism' MsgFromServer [(ByteString, ByteString)] _RplMyInfo :: Prism' MsgFromServer (ByteString, ByteString, [ByteString]) _RplCreated :: Prism' MsgFromServer ByteString _RplYourHost :: Prism' MsgFromServer ByteString _RplWelcome :: Prism' MsgFromServer ByteString module Irc.Message -- | IrcMessage represents a high-level event to be communicated out -- to the library user when something changes on a connection. data IrcMessage [IrcMessage] :: !IrcMessageType -> !UserInfo -> !UTCTime -> !Bool -> String -> String -> IrcMessage [_mesgType] :: IrcMessage -> !IrcMessageType [_mesgSender] :: IrcMessage -> !UserInfo [_mesgStamp] :: IrcMessage -> !UTCTime [_mesgMe] :: IrcMessage -> !Bool [_mesgModes] :: IrcMessage -> String [_mesgStatus] :: IrcMessage -> String -- | Event types and associated fields used by IrcMessage. data IrcMessageType [PrivMsgType] :: Text -> IrcMessageType [NoticeMsgType] :: Text -> IrcMessageType [ActionMsgType] :: Text -> IrcMessageType [AwayMsgType] :: Text -> IrcMessageType [JoinMsgType] :: IrcMessageType [KickMsgType] :: Identifier -> Text -> IrcMessageType [PartMsgType] :: Text -> IrcMessageType [QuitMsgType] :: Text -> IrcMessageType [NickMsgType] :: Identifier -> IrcMessageType [TopicMsgType] :: Text -> IrcMessageType [ErrorMsgType] :: Text -> IrcMessageType [ErrMsgType] :: IrcError -> IrcMessageType [ModeMsgType] :: Bool -> Char -> ByteString -> IrcMessageType [InviteMsgType] :: IrcMessageType [KnockMsgType] :: IrcMessageType [CallerIdMsgType] :: IrcMessageType [CallerIdDeliveredMsgType] :: IrcMessageType -- | ctcp command and arguments [CtcpReqMsgType] :: ByteString -> ByteString -> IrcMessageType -- | ctcp command and arguments [CtcpRspMsgType] :: ByteString -> ByteString -> IrcMessageType mesgType :: Lens' IrcMessage IrcMessageType mesgSender :: Lens' IrcMessage UserInfo mesgStamp :: Lens' IrcMessage UTCTime mesgStatus :: Lens' IrcMessage String mesgMe :: Lens' IrcMessage Bool mesgModes :: Lens' IrcMessage String defaultIrcMessage :: IrcMessage _PrivMsgType :: Prism' IrcMessageType Text _NoticeMsgType :: Prism' IrcMessageType Text _ActionMsgType :: Prism' IrcMessageType Text _AwayMsgType :: Prism' IrcMessageType Text _JoinMsgType :: Prism' IrcMessageType () _KickMsgType :: Prism' IrcMessageType (Identifier, Text) _PartMsgType :: Prism' IrcMessageType Text _QuitMsgType :: Prism' IrcMessageType Text _NickMsgType :: Prism' IrcMessageType Identifier _TopicMsgType :: Prism' IrcMessageType Text _ErrorMsgType :: Prism' IrcMessageType Text _ErrMsgType :: Prism' IrcMessageType IrcError _ModeMsgType :: Prism' IrcMessageType (Bool, Char, ByteString) _InviteMsgType :: Prism' IrcMessageType () _KnockMsgType :: Prism' IrcMessageType () _CallerIdMsgType :: Prism' IrcMessageType () _CallerIdDeliveredMsgType :: Prism' IrcMessageType () _CtcpReqMsgType :: Prism' IrcMessageType (ByteString, ByteString) _CtcpRspMsgType :: Prism' IrcMessageType (ByteString, ByteString) instance Show IrcMessage instance Read IrcMessage instance Show IrcMessageType instance Read IrcMessageType -- | This module implements a high-level view of the state of the IRC -- connection. The library user calls advanceModel to step the -- IrcConnection as new messages arrive. module Irc.Model -- | IrcConnection is the state of an IRC connection. It maintains -- channel membership, user and channel modes, and other connection -- state. data IrcConnection [IrcConnection] :: !Identifier -> !(Map Identifier IrcChannel) -> Maybe ByteString -> [Char] -> [Char] -> !Bool -> !Int -> Maybe Char -> Maybe Char -> !(Map Identifier IrcUser) -> !ModeTypes -> !ModeTypes -> !Int -> !Int -> Maybe (ByteString, ByteString) -> Maybe (ByteString, ByteString) -> !ByteString -> !ByteString -> !Phase -> IrcConnection [_connNick] :: IrcConnection -> !Identifier [_connChannels] :: IrcConnection -> !(Map Identifier IrcChannel) [_connId] :: IrcConnection -> Maybe ByteString [_connChanTypes] :: IrcConnection -> [Char] [_connStatusMsg] :: IrcConnection -> [Char] [_connKnock] :: IrcConnection -> !Bool [_connNickLen] :: IrcConnection -> !Int [_connExcepts] :: IrcConnection -> Maybe Char [_connInvex] :: IrcConnection -> Maybe Char [_connUsers] :: IrcConnection -> !(Map Identifier IrcUser) [_connChanModeTypes] :: IrcConnection -> !ModeTypes [_connUserModeTypes] :: IrcConnection -> !ModeTypes [_connModes] :: IrcConnection -> !Int [_connTopicLen] :: IrcConnection -> !Int [_connMyInfo] :: IrcConnection -> Maybe (ByteString, ByteString) [_connSasl] :: IrcConnection -> Maybe (ByteString, ByteString) [_connUmode] :: IrcConnection -> !ByteString [_connSnoMask] :: IrcConnection -> !ByteString [_connPhase] :: IrcConnection -> !Phase connNick :: Lens' IrcConnection Identifier connChannels :: Lens' IrcConnection (Map Identifier IrcChannel) connId :: Lens' IrcConnection (Maybe ByteString) connChanModeTypes :: Lens' IrcConnection ModeTypes connUserModeTypes :: Lens' IrcConnection ModeTypes connKnock :: Lens' IrcConnection Bool connNickLen :: Lens' IrcConnection Int connExcepts :: Lens' IrcConnection (Maybe Char) connInvex :: Lens' IrcConnection (Maybe Char) connStatusMsg :: Lens' IrcConnection [Char] connTopicLen :: Lens' IrcConnection Int connPhase :: Lens' IrcConnection Phase connModes :: Lens' IrcConnection Int connUsers :: Lens' IrcConnection (Map Identifier IrcUser) connMyInfo :: Lens' IrcConnection (Maybe (ByteString, ByteString)) connSasl :: Lens' IrcConnection (Maybe (ByteString, ByteString)) connUmode :: Lens' IrcConnection ByteString connSnoMask :: Lens' IrcConnection ByteString -- | IrcConnection value with everything unspecified defaultIrcConnection :: IrcConnection data Phase [RegistrationPhase] :: Phase [ActivePhase] :: Phase [SaslPhase] :: Phase -- | IrcChannel represents the current state of a channel as seen on -- the connection. It includes all user lists, modes, and other metadata -- about a channel. data IrcChannel [IrcChannel] :: Maybe (Maybe (Text, ByteString, UTCTime)) -> !(Map Identifier String) -> Maybe (Map Char ByteString) -> Maybe UTCTime -> Map Char [IrcMaskEntry] -> Maybe ByteString -> IrcChannel [_chanTopic] :: IrcChannel -> Maybe (Maybe (Text, ByteString, UTCTime)) [_chanUsers] :: IrcChannel -> !(Map Identifier String) [_chanModes] :: IrcChannel -> Maybe (Map Char ByteString) [_chanCreation] :: IrcChannel -> Maybe UTCTime [_chanMaskLists] :: IrcChannel -> Map Char [IrcMaskEntry] [_chanUrl] :: IrcChannel -> Maybe ByteString chanTopic :: Lens' IrcChannel (Maybe (Maybe (Text, ByteString, UTCTime))) chanUsers :: Lens' IrcChannel (Map Identifier String) chanModes :: Lens' IrcChannel (Maybe (Map Char ByteString)) chanCreation :: Lens' IrcChannel (Maybe UTCTime) chanMaskLists :: Lens' IrcChannel (Map Char [IrcMaskEntry]) chanUrl :: Lens' IrcChannel (Maybe ByteString) -- | Settings that describe how to interpret channel modes data ModeTypes [ModeTypes] :: String -> String -> String -> String -> [(Char, Char)] -> ModeTypes [_modesLists] :: ModeTypes -> String [_modesAlwaysArg] :: ModeTypes -> String [_modesSetArg] :: ModeTypes -> String [_modesNeverArg] :: ModeTypes -> String [_modesPrefixModes] :: ModeTypes -> [(Char, Char)] modesLists :: Lens' ModeTypes String modesAlwaysArg :: Lens' ModeTypes String modesSetArg :: Lens' ModeTypes String modesNeverArg :: Lens' ModeTypes String modesPrefixModes :: Lens' ModeTypes [(Char, Char)] -- | The channel modes used by Freenode defaultChanModeTypes :: ModeTypes -- | The default UMODE as defined by Freenode defaultUmodeTypes :: ModeTypes -- | Mask entries are used to represent an entry in a ban list for a -- channel. data IrcMaskEntry [IrcMaskEntry] :: ByteString -> ByteString -> UTCTime -> IrcMaskEntry [_maskEntryMask] :: IrcMaskEntry -> ByteString [_maskEntryWho] :: IrcMaskEntry -> ByteString [_maskEntryStamp] :: IrcMaskEntry -> UTCTime maskEntryMask :: Lens' IrcMaskEntry ByteString maskEntryWho :: Lens' IrcMaskEntry ByteString maskEntryStamp :: Lens' IrcMaskEntry UTCTime -- | IrcUser is the type of user-level metadata tracked for the -- users visible on the current IRC connection. data IrcUser [IrcUser] :: !Bool -> !(Maybe ByteString) -> !(Maybe ByteString) -> IrcUser [_usrAway] :: IrcUser -> !Bool [_usrAccount] :: IrcUser -> !(Maybe ByteString) [_usrHost] :: IrcUser -> !(Maybe ByteString) usrAway :: Lens' IrcUser Bool usrAccount :: Lens' IrcUser (Maybe ByteString) usrHost :: Lens' IrcUser (Maybe ByteString) -- | This represents the metadata of an unknown user. defaultIrcUser :: IrcUser -- | Execute the Logic value using a given operation for sending and -- recieving IRC messages. runLogic :: (Functor m, Monad m) => UTCTime -> (forall r. LogicOp r -> m r) -> Logic a -> m (Either String a) data LogicOp r [Expect] :: (MsgFromServer -> r) -> LogicOp r [Emit] :: ByteString -> r -> LogicOp r [Record] :: Identifier -> IrcMessage -> r -> LogicOp r data Logic a -- | Primary state machine step function. Call this function with a -- timestamp and a server message to update the IrcConnection -- state. If additional messages are required they will be requested via -- the Logic type. advanceModel :: MsgFromServer -> IrcConnection -> Logic IrcConnection -- | Predicate for identifiers to identify which represent channel names. -- Channel prefixes are configurable, but the most common is # isChannelName :: Identifier -> IrcConnection -> Bool -- | Predicate for identifiers to identify which represent nicknames isNickName :: Identifier -> IrcConnection -> Bool -- | Predicate to determine if a given identifier is the primary nick for -- the given connection. isMyNick :: Identifier -> IrcConnection -> Bool splitStatusMsg :: Identifier -> IrcConnection -> (String, Identifier) -- | Split up a mode change command and arguments into individual changes -- given a configuration. splitModes :: ModeTypes -> ByteString -> [ByteString] -> Maybe [(Bool, Char, ByteString)] unsplitModes :: [(Bool, Char, ByteString)] -> [ByteString] nickHasModeInChannel :: Identifier -> Char -> Identifier -> IrcConnection -> Bool channelHasMode :: Identifier -> Char -> IrcConnection -> Bool instance Monad Logic instance Applicative Logic instance Functor Logic instance Functor LogicOp instance Show a => Show (Fuzzy a) instance Read a => Read (Fuzzy a) instance Show IrcConnection instance Read IrcConnection instance Show IrcUser instance Read IrcUser instance Show IrcChannel instance Read IrcChannel instance Show IrcMaskEntry instance Read IrcMaskEntry instance Show ModeTypes instance Read ModeTypes instance Eq Phase instance Show Phase instance Read Phase