uri-template-0.2: URI template library for Haskell

Portabilityportable
Stabilityprovisional
Maintainersof@forkio.com

Network.URI.Template

Description

URI templates and their expansion. For details (and up-to-date specs), see http:bitworking.orgprojects

Also implements the OpenSearch 1.1 style with ? suffix chars + support for namespace prefixes {xmlns:foo?} => xmlns:bar

Synopsis

Documentation

data TemplateEnv Source

TemplateEnv holds the key,value mapping for the expansion context for a URI template.

newEnv :: TemplateEnvSource

Construct a new, empty TemplateEnv.

addToEnv :: String -> String -> TemplateEnv -> TemplateEnvSource

addToEnv key value env augments env with a new key,value pair.

addListToEnv :: String -> [String] -> TemplateEnv -> TemplateEnvSource

addListToEnv key vals env expands the template environment env with a list-valued key,value(s) pair.

expand :: TemplateEnv -> URITemplate -> URIStringSource

expand tenv tpl performs template expansion on URL template tpl wrt tenv. The result contains the expansion, _but_ leaving unbound template variables intact.