From 3b688e03804389169a09adefbe30ba43b8c13685 Mon Sep 17 00:00:00 2001 From: Jon Kristensen Date: Sat, 17 Nov 2012 23:41:35 +0100 Subject: [PATCH] minor documentation and formatting changes --- source/Network/Xmpp.hs | 19 ++++++++----------- source/Network/Xmpp/Concurrent/Monad.hs | 2 +- source/Network/Xmpp/Concurrent/Threads.hs | 2 +- source/Network/Xmpp/Jid.hs | 7 +++++-- source/Network/Xmpp/Stream.hs | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/source/Network/Xmpp.hs b/source/Network/Xmpp.hs index 37b819b..8b6e9b2 100644 --- a/source/Network/Xmpp.hs +++ b/source/Network/Xmpp.hs @@ -4,7 +4,7 @@ -- Core). -- License: Apache License 2.0 -- --- Maintainer: jon.kristensen@nejla.com +-- Maintainer: info@jonkri.com -- Stability: unstable -- Portability: portable -- @@ -41,9 +41,6 @@ module Network.Xmpp , endSession , setConnectionClosedHandler -- * JID - -- | A JID (historically: Jabber ID) is XMPPs native format - -- for addressing entities in the network. It is somewhat similar to an e-mail - -- address but contains three parts instead of two: , Jid(..) , isBare , isFull @@ -86,11 +83,11 @@ module Network.Xmpp , Message(..) , MessageError(..) , MessageType(..) - -- *** creating + -- *** Creating , answerMessage - -- *** sending + -- *** Sending , sendMessage - -- *** receiving + -- *** Receiving , pullMessage , waitForMessage , waitForMessageError @@ -102,9 +99,9 @@ module Network.Xmpp -- communication primitive: the presence stanza. , Presence(..) , PresenceError(..) - -- *** creating + -- *** Creating , module Network.Xmpp.Presence - -- *** sending + -- *** Sending -- | Sends a presence stanza. In general, the presence stanza should have no -- 'to' attribute, in which case the server to which the client is connected -- will broadcast that stanza to all subscribed entities. However, a @@ -112,7 +109,7 @@ module Network.Xmpp -- which case the server will route or deliver that stanza to the intended -- recipient. , sendPresence - -- *** receiving + -- *** Receiving , pullPresence , waitForPresence -- ** IQ @@ -142,7 +139,7 @@ module Network.Xmpp , iqResultPayload -- * Threads , forkSession - -- * Misc + -- * Miscellaneous , LangTag(..) , exampleParams ) where diff --git a/source/Network/Xmpp/Concurrent/Monad.hs b/source/Network/Xmpp/Concurrent/Monad.hs index 29c1019..8c6980f 100644 --- a/source/Network/Xmpp/Concurrent/Monad.hs +++ b/source/Network/Xmpp/Concurrent/Monad.hs @@ -152,7 +152,7 @@ waitForPresence f session = do -- TODO: Wait for presence error? --- | Run an XmppMonad action in isolation. Reader and writer workers will be +-- | Run an XmppConMonad action in isolation. Reader and writer workers will be -- temporarily stopped and resumed with the new session details once the action -- returns. The action will run in the calling thread. Any uncaught exceptions -- will be interpreted as connection failure. diff --git a/source/Network/Xmpp/Concurrent/Threads.hs b/source/Network/Xmpp/Concurrent/Threads.hs index 8788996..c438bc6 100644 --- a/source/Network/Xmpp/Concurrent/Threads.hs +++ b/source/Network/Xmpp/Concurrent/Threads.hs @@ -199,7 +199,7 @@ startThreads = do { connectionClosedHandler = \_ -> return () } --- | Creates and initializes a new concurrent session. +-- | Initializes a new XMPP session. newSession :: IO Session newSession = do (mC, pC, sC, hand, outC, stopThreads', writeR, conS, rdr, eh) <- startThreads diff --git a/source/Network/Xmpp/Jid.hs b/source/Network/Xmpp/Jid.hs index df1b889..bb80884 100644 --- a/source/Network/Xmpp/Jid.hs +++ b/source/Network/Xmpp/Jid.hs @@ -23,6 +23,9 @@ import qualified Data.Text as Text import qualified Text.NamePrep as SP import qualified Text.StringPrep as SP +-- | A JID is XMPP\'s native format for addressing entities in the network. It +-- is somewhat similar to an e-mail address but contains three parts instead of +-- two. data Jid = Jid { -- | The @localpart@ of a JID is an optional identifier placed -- before the domainpart and separated from the latter by a -- \'\@\' character. Typically a localpart uniquely identifies @@ -105,12 +108,12 @@ fromStrings l d r = do validPartLength :: Text -> Bool validPartLength p = Text.length p > 0 && Text.length p < 1024 --- | Returns True if the JID is /bare/, and False otherwise. +-- | Returns 'True' if the JID is /bare/, and 'False' otherwise. isBare :: Jid -> Bool isBare j | resourcepart j == Nothing = True | otherwise = False --- | Returns True if the JID is 'full', and False otherwise. +-- | Returns 'True' if the JID is /full/, and 'False' otherwise. isFull :: Jid -> Bool isFull = not . isBare diff --git a/source/Network/Xmpp/Stream.hs b/source/Network/Xmpp/Stream.hs index 2ead3b6..6fb1dd6 100644 --- a/source/Network/Xmpp/Stream.hs +++ b/source/Network/Xmpp/Stream.hs @@ -15,7 +15,7 @@ import Data.Maybe (fromJust, isJust, isNothing) import Data.Text as Text import Data.XML.Pickle import Data.XML.Types -import Data.Void(Void) +import Data.Void (Void) import Network.Xmpp.Monad import Network.Xmpp.Pickle