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 @@ @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -142,7 +139,7 @@ module Network.Xmpp
, iqResultPayload
-- * Threads
, forkSession
-- * Misc
-- * Miscellaneous
, LangTag(..)
, exampleParams
) where

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

@ -152,7 +152,7 @@ waitForPresence f session = do @@ -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.

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

@ -199,7 +199,7 @@ startThreads = do @@ -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

7
source/Network/Xmpp/Jid.hs

@ -23,6 +23,9 @@ import qualified Data.Text as Text @@ -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 @@ -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

2
source/Network/Xmpp/Stream.hs

@ -15,7 +15,7 @@ import Data.Maybe (fromJust, isJust, isNothing) @@ -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

Loading…
Cancel
Save