Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- uri :: QuasiQuoter
- staticURI :: String -> TExpQ URI
- relativeReference :: QuasiQuoter
- staticRelativeReference :: String -> TExpQ URI
Absolute URIs
uri :: QuasiQuoter Source #
staticURI
parses a specified string at compile time
and return an expression representing the URI when it's a valid URI.
Otherwise, it emits an error.
>>>
$$(staticURI "http://www.google.com/")
http://www.google.com/
>>>
$$(staticURI "http://www.google.com/##")
<interactive>... ... Invalid URI: http://www.google.com/## ...
Relative URIs
relativeReference :: QuasiQuoter Source #
relativeReference
is a quasi quoter for staticRelativeReference
.
>>>
[relativeReference|/foo?bar=baz#quux|]
/foo?bar=baz#quux
>>>
[relativeReference|http://www.google.com/|]
<interactive>... ... Invalid relative reference: http://www.google.com/ ...
staticRelativeReference Source #
staticRelativeReference
parses a specified string at compile time and
return an expression representing the URI when it's a valid relative
reference. Otherwise, it emits an error.
>>>
$$(staticRelativeReference "/foo?bar=baz#quux")
/foo?bar=baz#quux
>>>
$$(staticRelativeReference "http://www.google.com/")
<interactive>... ... Invalid relative reference: http://www.google.com/ ...