twiml-0.2.1.0: TwiML library for Haskell

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

Text.XML.Twiml.Syntax

Description

This module, in combination with the RebindableSyntax and RecordWilCards extensions, allows you to write TwiML using do-notation. For example,

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

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

example :: VoiceTwiml
example =
  response $ do
    say "Hello World" def
    end
  where Twiml.Syntax{..} = def

This pattern is due to a suggestion from Adam Bergmark on Haskell-Cafe.

Documentation

data Syntax (m :: [k] -> * -> *) (i :: [k]) (j :: [k]) (a :: *) (b :: *) Source #

Constructors

Syntax 

Fields

Instances

IxMonad [k] m => Default (Syntax k m i j a b) Source # 

Methods

def :: Syntax k m i j a b #