Browse Source

minor documentation and formatting changes

master
Jon Kristensen 13 years ago
parent
commit
3b688e0380
  1. 19
      source/Network/Xmpp.hs
  2. 2
      source/Network/Xmpp/Concurrent/Monad.hs
  3. 2
      source/Network/Xmpp/Concurrent/Threads.hs
  4. 7
      source/Network/Xmpp/Jid.hs
  5. 2
      source/Network/Xmpp/Stream.hs

19
source/Network/Xmpp.hs

@ -4,7 +4,7 @@
-- Core). -- Core).
-- License: Apache License 2.0 -- License: Apache License 2.0
-- --
-- Maintainer: jon.kristensen@nejla.com -- Maintainer: info@jonkri.com
-- Stability: unstable -- Stability: unstable
-- Portability: portable -- Portability: portable
-- --
@ -41,9 +41,6 @@ module Network.Xmpp
, endSession , endSession
, setConnectionClosedHandler , setConnectionClosedHandler
-- * JID -- * 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(..) , Jid(..)
, isBare , isBare
, isFull , isFull
@ -86,11 +83,11 @@ module Network.Xmpp
, Message(..) , Message(..)
, MessageError(..) , MessageError(..)
, MessageType(..) , MessageType(..)
-- *** creating -- *** Creating
, answerMessage , answerMessage
-- *** sending -- *** Sending
, sendMessage , sendMessage
-- *** receiving -- *** Receiving
, pullMessage , pullMessage
, waitForMessage , waitForMessage
, waitForMessageError , waitForMessageError
@ -102,9 +99,9 @@ module Network.Xmpp
-- communication primitive: the presence stanza. -- communication primitive: the presence stanza.
, Presence(..) , Presence(..)
, PresenceError(..) , PresenceError(..)
-- *** creating -- *** Creating
, module Network.Xmpp.Presence , module Network.Xmpp.Presence
-- *** sending -- *** Sending
-- | Sends a presence stanza. In general, the presence stanza should have no -- | 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 -- 'to' attribute, in which case the server to which the client is connected
-- will broadcast that stanza to all subscribed entities. However, a -- 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 -- which case the server will route or deliver that stanza to the intended
-- recipient. -- recipient.
, sendPresence , sendPresence
-- *** receiving -- *** Receiving
, pullPresence , pullPresence
, waitForPresence , waitForPresence
-- ** IQ -- ** IQ
@ -142,7 +139,7 @@ module Network.Xmpp
, iqResultPayload , iqResultPayload
-- * Threads -- * Threads
, forkSession , forkSession
-- * Misc -- * Miscellaneous
, LangTag(..) , LangTag(..)
, exampleParams , exampleParams
) where ) where

2
source/Network/Xmpp/Concurrent/Monad.hs

@ -152,7 +152,7 @@ waitForPresence f session = do
-- TODO: Wait for presence error? -- 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 -- temporarily stopped and resumed with the new session details once the action
-- returns. The action will run in the calling thread. Any uncaught exceptions -- returns. The action will run in the calling thread. Any uncaught exceptions
-- will be interpreted as connection failure. -- will be interpreted as connection failure.

2
source/Network/Xmpp/Concurrent/Threads.hs

@ -199,7 +199,7 @@ startThreads = do
{ connectionClosedHandler = \_ -> return () { connectionClosedHandler = \_ -> return ()
} }
-- | Creates and initializes a new concurrent session. -- | Initializes a new XMPP session.
newSession :: IO Session newSession :: IO Session
newSession = do newSession = do
(mC, pC, sC, hand, outC, stopThreads', writeR, conS, rdr, eh) <- startThreads (mC, pC, sC, hand, outC, stopThreads', writeR, conS, rdr, eh) <- startThreads

7
source/Network/Xmpp/Jid.hs

@ -23,6 +23,9 @@ import qualified Data.Text as Text
import qualified Text.NamePrep as SP import qualified Text.NamePrep as SP
import qualified Text.StringPrep 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 data Jid = Jid { -- | The @localpart@ of a JID is an optional identifier placed
-- before the domainpart and separated from the latter by a -- before the domainpart and separated from the latter by a
-- \'\@\' character. Typically a localpart uniquely identifies -- \'\@\' character. Typically a localpart uniquely identifies
@ -105,12 +108,12 @@ fromStrings l d r = do
validPartLength :: Text -> Bool validPartLength :: Text -> Bool
validPartLength p = Text.length p > 0 && Text.length p < 1024 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 :: Jid -> Bool
isBare j | resourcepart j == Nothing = True isBare j | resourcepart j == Nothing = True
| otherwise = False | 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 :: Jid -> Bool
isFull = not . isBare isFull = not . isBare

2
source/Network/Xmpp/Stream.hs

@ -15,7 +15,7 @@ import Data.Maybe (fromJust, isJust, isNothing)
import Data.Text as Text import Data.Text as Text
import Data.XML.Pickle import Data.XML.Pickle
import Data.XML.Types import Data.XML.Types
import Data.Void(Void) import Data.Void (Void)
import Network.Xmpp.Monad import Network.Xmpp.Monad
import Network.Xmpp.Pickle import Network.Xmpp.Pickle

Loading…
Cancel
Save