~singpolyma/network-protocol-xmpp

d4a781fd2c1e389fc723657f068aa9e11edc3adf — John Millikin 12 years ago 31e363e
Use lazy instead of strict bytestrings.
M Network/Protocol/XMPP/Connections.hs => Network/Protocol/XMPP/Connections.hs +3 -3
@@ 21,7 21,7 @@ module Network.Protocol.XMPP.Connections
	, qnameStream
	) where
import Network (HostName, PortID)
import Data.ByteString (ByteString)
import qualified Data.ByteString.Lazy as B
import qualified Data.Text as T
import Data.Text.Encoding (encodeUtf8)
import qualified Text.XML.HXT.DOM.Interface as DOM


@@ 39,8 39,8 @@ data Server = Server
-- Since only the opening tag should be written, normal XML
-- serialization cannot be used. Be careful to escape any embedded
-- attributes.
xmlHeader :: T.Text -> JID -> ByteString
xmlHeader ns jid = encodeUtf8 header where
xmlHeader :: T.Text -> JID -> B.ByteString
xmlHeader ns jid = B.fromChunks [encodeUtf8 header] where
	escape = T.pack . DOM.attrEscapeXml . T.unpack
	attr x = T.concat ["\"", escape x, "\""]
	header = T.concat

M Network/Protocol/XMPP/Handle.hs => Network/Protocol/XMPP/Handle.hs +1 -1
@@ 24,7 24,7 @@ module Network.Protocol.XMPP.Handle
import Control.Monad (when)
import qualified Control.Monad.Error as E
import Control.Monad.Trans (liftIO)
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy.Char8 as B
import qualified Data.Text as T
import qualified System.IO as IO
import qualified Network.Protocol.TLS.GNU as TLS

M Network/Protocol/XMPP/Monad.hs => Network/Protocol/XMPP/Monad.hs +1 -1
@@ 38,7 38,7 @@ import Prelude hiding (getChar)
import Control.Monad.Trans (MonadIO, liftIO)
import qualified Control.Monad.Error as E
import qualified Control.Monad.Reader as R
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy.Char8 as B
import Data.Text (Text)

import Text.XML.HXT.Arrow ((>>>))