From a0734174704312d882561597e930463d912ec7ef Mon Sep 17 00:00:00 2001
From: Philipp Balzarek
Date: Thu, 19 Dec 2013 23:28:02 +0100
Subject: [PATCH] add jid QuasiQuoter (synonym to jidQ)
---
source/Network/Xmpp.hs | 1 +
source/Network/Xmpp/Types.hs | 8 ++++++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/source/Network/Xmpp.hs b/source/Network/Xmpp.hs
index 3b68c13..4f62822 100644
--- a/source/Network/Xmpp.hs
+++ b/source/Network/Xmpp.hs
@@ -51,6 +51,7 @@ module Network.Xmpp
, Jid
#if WITH_TEMPLATE_HASKELL
, jidQ
+ , jid
#endif
, isBare
, isFull
diff --git a/source/Network/Xmpp/Types.hs b/source/Network/Xmpp/Types.hs
index 2550e0c..8ca4545 100644
--- a/source/Network/Xmpp/Types.hs
+++ b/source/Network/Xmpp/Types.hs
@@ -55,6 +55,7 @@ module Network.Xmpp.Types
, Jid(..)
#if WITH_TEMPLATE_HASKELL
, jidQ
+ , jid
#endif
, isBare
, isFull
@@ -817,8 +818,8 @@ instance TH.Lift Jid where
-- @
-- [jidQ|localpart\@domainpart/resourcepart|]
-- @
-jidQ :: QuasiQuoter
-jidQ = QuasiQuoter { quoteExp = \s -> do
+jid :: QuasiQuoter
+jid = QuasiQuoter { quoteExp = \s -> do
when (head s == ' ') . fail $ "Leading whitespaces in JID" ++ show s
let t = Text.pack s
when (Text.last t == ' ') . reportWarning $ "Trailing whitespace in JID " ++ show s
@@ -830,6 +831,9 @@ jidQ = QuasiQuoter { quoteExp = \s -> do
, quoteDec = fail "jid QQ can't be used in declaration context"
}
+-- | synonym for 'jid'
+jidQ :: QuasiQuoter
+jidQ = jidQ
#endif
-- Produces a LangTag value in the format "parseLangTag \"\"".