twiml-0.2.0.0: TwiML library for Haskell

Copyright(C) 2014-15 Mark Andrus Roberts
LicenseBSD-style (see the file LICENSE)
MaintainerMark Andrus Roberts <markandrusroberts@gmail.com>
Stabilityprovisional
Safe HaskellNone
LanguageHaskell98

Text.XML.Twiml.Verbs.Play

Description

The example in this file assumes

{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE RecordWildCards #-}

import Prelude
import Text.XML.Twiml
import qualified Text.XML.Twiml.Syntax as Twiml

For more information, refer to Twilio's TwiML Reference for <Play>.

Synopsis

Documentation

play :: IsTwimlLike f Play => URL -> PlayAttributes -> TwimlLike f Play () Source

Example:

example :: VoiceTwiml
example =
  response $ do
    play (fromJust $ parseURL "https://api.twilio.com/cowbell.mp3") def
    end
  where Twiml.Syntax{..} = def
>>> show example
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Play>https://api.twilio.com/cowbell.mp3</Play>
</Response>

play' :: IsTwimlLike f Play => Maybe URL -> PlayAttributes -> TwimlLike f Play () Source

Example:

example :: VoiceTwiml
example =
  response $ do
    play' Nothing $ def & digits .~ Just [W, W, W, W, D3]
    end
  where Twiml.Syntax{..} = def
>>> show example
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Play digits="wwww3" />
</Response>

data PlayF i a Source

Instances