Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.IRC.Fun.Client.IO
- data Connection = Connection {}
- data Handle :: *
- ircConnect :: Connection -> IO Handle
- ircDisconnect :: Handle -> IO ()
- hPutIrcRaw :: Handle -> String -> IO ()
- hPutIrcGeneric :: Handle -> GenericMessage -> IO ()
- hPutIrc :: Handle -> Message -> IO ()
- hGetIrcRaw :: Handle -> IO String
- hGetIrcGenericOnce :: Handle -> IO (Maybe GenericMessage)
- hGetIrcGeneric :: Handle -> IO GenericMessage
- hGetIrcOnce :: Handle -> IO (Maybe (Either SpecificReply SpecificMessage))
- hGetIrc :: Handle -> IO (Either SpecificReply SpecificMessage)
Documentation
data Connection Source
Details of the connection to IRC.
Constructors
Connection | |
Fields
|
Instances
data Handle :: *
Haskell defines operations to read and write characters from and to files,
represented by values of type Handle
. Each value of this type is a
handle: a record used by the Haskell run-time system to manage I/O
with file system objects. A handle has at least the following properties:
- whether it manages input or output or both;
- whether it is open, closed or semi-closed;
- whether the object is seekable;
- whether buffering is disabled, or enabled on a line or block basis;
- a buffer (whose length may be zero).
Most handles will also have a current I/O position indicating where the next
input or output operation will occur. A handle is readable if it
manages only input or both input and output; likewise, it is writable if
it manages only output or both input and output. A handle is open when
first allocated.
Once it is closed it can no longer be used for either input or output,
though an implementation cannot re-use its storage while references
remain to it. Handles are in the Show
and Eq
classes. The string
produced by showing a handle is system dependent; it should include
enough information to identify the handle for debugging. A handle is
equal according to ==
only to itself; no attempt
is made to compare the internal state of different handles for equality.
ircConnect :: Connection -> IO Handle Source
Connect to an IRC server using the given connection parameters, and return a handle to the open socket. This just opens a TCP connection, without sending any IRC commands.
ircDisconnect :: Handle -> IO () Source
Disconnect from IRC by closing the client's side of the connection. This function is mainly provided for completeness. You should probably use the QUIT command of IRC to quit the network in a manner coordinated with the server.
hPutIrcRaw :: Handle -> String -> IO () Source
Send an IRC command, given in string form, to the server. The given command string shouldn't contain any newlines.
hPutIrcGeneric :: Handle -> GenericMessage -> IO () Source
Send an IRC message represented in generic form to the server.
hGetIrcRaw :: Handle -> IO String Source
Receive an IRC message, given in string form, from the server. The resulting string won't contain newlines.
hGetIrcGenericOnce :: Handle -> IO (Maybe GenericMessage) Source
Receive an IRC message in generic form from the server. If parsing the
message read from the server fails, Nothing
is returned.
hGetIrcGeneric :: Handle -> IO GenericMessage Source
Receive the next valid (successfully parsed) IRC message in generic form from the server.
hGetIrcOnce :: Handle -> IO (Maybe (Either SpecificReply SpecificMessage)) Source
Receive an IRC message from the server. If parsing the message read from
the server fails, Nothing
is returned.
hGetIrc :: Handle -> IO (Either SpecificReply SpecificMessage) Source
Receive the next valid (successfully parsed) IRC message from the server.