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

Safe HaskellNone
LanguageHaskell98

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 -> String Source

Retrieves the path component from the URI

query :: SURI -> String Source

Retrieves the query component from the URI

scheme :: SURI -> String Source

Retrieves the scheme component from the URI

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

Modifies the scheme component of the URI using the provided function

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

Modifies the path component of the URI using the provided function

a_scheme :: String -> SURI -> SURI Source

Sets the scheme component of the URI

a_path :: String -> SURI -> SURI Source

Sets the path component of the URI

percentDecode :: String -> String Source

percent decode a String

e.g. "hello%2Fworld" -> "hello/world"

isAbs :: SURI -> Bool Source

Returns true if the URI is absolute

newtype SURI Source

Constructors

SURI 

Fields

suri :: URI
 

render :: ToSURI a => a -> String Source

Render should be used for prettyprinting URIs.

parse :: String -> Maybe SURI Source

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

class ToSURI x where Source

Convenience class for converting data types to URIs

Methods

toSURI :: x -> SURI Source

class FromPath x where Source

Methods

fromPath :: String -> x Source