happstack-server-6.1.6: Web related tools and services.

Happstack.Server.SURI

Description

A wrapper and type class so that functions like seeOther can take a URI which is represented by a String, URI, or other instance of ToSURI.

Synopsis

Documentation

path :: SURI -> StringSource

Retrieves the path component from the URI

query :: SURI -> StringSource

Retrieves the query component from the URI

scheme :: SURI -> StringSource

Retrieves the scheme component from the URI

u_scheme :: (String -> String) -> SURI -> SURISource

Modifies the scheme component of the URI using the provided function

u_path :: (String -> String) -> SURI -> SURISource

Modifies the path component of the URI using the provided function

a_scheme :: String -> SURI -> SURISource

Sets the scheme component of the URI

a_path :: String -> SURI -> SURISource

Sets the path component of the URI

isAbs :: SURI -> BoolSource

Returns true if the URI is absolute

newtype SURI Source

Constructors

SURI 

Fields

suri :: URI
 

render :: ToSURI a => a -> StringSource

Render should be used for prettyprinting URIs.

parse :: String -> Maybe SURISource

Parses a URI from a String. Returns Nothing on failure.

class ToSURI x whereSource

Convenience class for converting data types to URIs

Methods

toSURI :: x -> SURISource

class FromPath x whereSource

Methods

fromPath :: String -> xSource