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.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 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 i j a b Source

Constructors

Syntax 

Fields

(>>=) :: m i a -> (a -> m j b) -> m (i <> j) b
 
(>>) :: m i a -> m j b -> m (i <> j) b
 
return :: a -> m Identity a
 

Instances

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