network-uri-static-0.1.1.0: A small utility to declare type-safe static URIs

Safe HaskellNone
LanguageHaskell2010

Network.URI.Static

Contents

Synopsis

Absolute URIs

uri :: QuasiQuoter Source #

uri is a quasi quoter for staticURI.

>>> [uri|http://www.google.com/|]
http://www.google.com/
>>> [uri|http://www.google.com/##|]

<interactive>...
... Invalid URI: http://www.google.com/##
...

staticURI Source #

Arguments

:: String

String representation of a URI

-> TExpQ URI

URI

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 #

Arguments

:: String

String representation of a reference

-> TExpQ URI

Refererence

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/
...

Orphan instances

Lift URI Source # 
Instance details

Methods

lift :: URI -> Q Exp #

Lift URIAuth Source # 
Instance details

Methods

lift :: URIAuth -> Q Exp #