{-# OPTIONS_GHC -cpp -optP -P -Itest/examples #-} {-# LANGUAGE FlexibleContexts #-} ------------------------------------------------------------------------------- -- | -- Module : Text.XML.Twiml.Verbs.Message -- Copyright : (C) 2018 Mark Andrus Roberts -- License : BSD-style (see the file LICENSE) -- Maintainer : Mark Andrus Roberts -- Stability : provisional -- -- The example in this file assumes -- -- @ -- {-\# LANGUAGE RebindableSyntax \#-} -- {-\# LANGUAGE RecordWildCards \#-} -- -- import Prelude -- import Data.Default -- import Text.XML.Twiml -- import qualified Text.XML.Twiml.Syntax as Twiml -- @ -- -- For more information, refer to Twilio's -- >. ------------------------------------------------------------------------------- module Text.XML.Twiml.Verbs.Message ( message , Message , MessageF , MessageAttributes ) where import Text.XML.Twiml.Internal import Text.XML.Twiml.Internal.Twiml -- $setup -- >>> :set -XRebindableSyntax -- >>> :set -XRecordWildCards -- >>> import Prelude -- >>> import Data.Default -- >>> import Text.XML.Twiml -- >>> import qualified Text.XML.Twiml.Syntax as Twiml {- | Example: >>> :{ let example :: MessagingTwiml example = messagingResponse $ do message "Store Location: 123 Easy St." def end where Twiml.Syntax{..} = def :} >>> putStr $ show example Store Location: 123 Easy St. -} message :: IsTwimlLike f Message => String -> MessageAttributes -> TwimlLike f Message () message a b = iliftF . inj $ MessageF a b ()