Pontarius XMPP is a work in progress implementation of RFC 6120
("XMPP CORE"), RFC 6121 ("XMPP IM"), and RFC 6122 ("XMPP ADDR").
While in alpha, Pontarius XMPP works quite well and fulfills most
requirements of the RFCs.

While in alpha, Pontarius XMPP works quite well and fulfills most requirements
of the RFCs.

Prerequisites

Pontarius XMPP requires GHC 7.0, or later.

You will need the ICU Unicode library and it's header files in order to be able
to build Pontarius XMPP. On Debian, you will need to install the libicu-dev
package. In Fedora, the package is called libicu-devel.

Note to users of GHC 7.0 and GHC 7.2: You will need cabal-install, version
0.14.0 or higher, or the build will fail with an "unrecognized option:
--disable-benchmarks" error. The versions 1.16.0 and higher might not build on
your system; if so, install 0.14.0 with "cabal install cabal-install-0.14.0".

Note to users of GHC 7.2.1: Due to a bug, recent versions of the binary
package wont build without running "ghc-pkg trust base".

Note to users of GHC 7.0.1: You will want to configure your Cabal environment
(including cabal-install) for version 0.9.2.1 of bytestring.

The three parameters above are the XMPP server realm, a SASL handler (for
authentication), and the session configuration settings (set to the default
settings). <code>session</code> will perform the necessary DNS queries to find
the address of the realm, connect, establish the XMPP stream, attempt to secure
the stream with TLS, authenticate, establish a concurrent interface for
interacting with the stream, and return the <code>Session</code> object.

The return type of <code>session</code> is <code>IO (Either XmppFailure
Session)</code>. As <code>XmppFailure</code> is an
<code>Control.Monad.Error</code> instance, you can utilize the
<code>ErrorT</code> monad transformer for error handling. A more simple way of
doing it could be doing something like this: