~singpolyma/network-protocol-xmpp

009531107dcb319d1de77ca4c781adc3ec5a900f — John Millikin 14 years ago 480217e
Add type signatures for ``mkAttr`` and ``mkQName``, and fixed a typo in ``mkQName``.
1 files changed, 3 insertions(+), 1 deletions(-)

M Network/Protocol/XMPP/Util.hs
M Network/Protocol/XMPP/Util.hs => Network/Protocol/XMPP/Util.hs +3 -1
@@ 76,8 76,10 @@ mkElement (ns, localpart) attrs children = let
	attrs' = [mkAttr ans alp text | (ans, alp, text) <- attrs]
	in XN.mkElement qname attrs' children

mkAttr :: String -> String -> String -> XmlTree
mkAttr ns localpart text = XN.mkAttr (mkQName ns localpart) [XN.mkText text]

mkQName :: String -> String -> QN.QName
mkQName ns localpart = case ns of
	"" -> QN.mkName localpart
	otherwise -> QN.mkNsName ns localpart
	otherwise -> QN.mkNsName localpart ns