| Portability | portable |
|---|---|
| Stability | provisional |
| Maintainer | sof@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
- data TemplateEnv
- newEnv :: TemplateEnv
- addToEnv :: String -> String -> TemplateEnv -> TemplateEnv
- addListToEnv :: String -> [String] -> TemplateEnv -> TemplateEnv
- type URITemplate = String
- type URIString = String
- expand :: TemplateEnv -> URITemplate -> URIString
Documentation
data TemplateEnv Source
TemplateEnv holds the key,value mapping for the expansion
context for a URI template.
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.
type URITemplate = StringSource
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.