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

Safe Haskell | None
Language | Haskell2010

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

- path :: SURI -> String
- query :: SURI -> String
- scheme :: SURI -> String
- u_scheme :: (String -> String) -> SURI -> SURI
- u_path :: (String -> String) -> SURI -> SURI
- a_scheme :: String -> SURI -> SURI
- a_path :: String -> SURI -> SURI
- percentDecode :: String -> String
- unEscape :: String -> String
- unEscapeQS :: String -> String
- isAbs :: SURI -> Bool
- newtype SURI = SURI {
  - suri :: URI
  }
- render :: ToSURI a => a -> String
- parse :: String -> Maybe SURI
- class ToSURI x where
  - toSURI :: x -> SURI
- class FromPath x where
  - fromPath :: String -> x

# 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"`

unEscape :: String -> String Source #

unEscapeQS :: String -> String Source #

isAbs :: SURI -> Bool Source #

Returns true if the URI is absolute

newtype SURI Source #

Constructors

SURI |

Fields

- suri :: URI

#### Instances

Instances details

Data SURI Source # |

Instance details

Defined in Happstack.Server.SURI

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SURI -> c SURI Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SURI Source #

toConstr :: SURI -> Constr Source #

dataTypeOf :: SURI -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SURI) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SURI) Source #

gmapT :: (forall b. Data b => b -> b) -> SURI -> SURI Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SURI -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SURI -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SURI -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SURI -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SURI -> m SURI Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SURI -> m SURI Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SURI -> m SURI Source #

Read SURI Source # |
Instance details Defined in Happstack.Server.SURI Methods readsPrec :: Int -> ReadS SURI Source # readList :: ReadS [SURI] Source # readPrec :: ReadPrec SURI Source # readListPrec :: ReadPrec [SURI] Source #
Show SURI Source # |
Instance details Defined in Happstack.Server.SURI Methods showsPrec :: Int -> SURI -> ShowS Source # show :: SURI -> String Source # showList :: [SURI] -> ShowS Source #
Eq SURI Source # |
Instance details Defined in Happstack.Server.SURI Methods (==) :: SURI -> SURI -> Bool Source # (/=) :: SURI -> SURI -> Bool Source #
Ord SURI Source # |
Instance details Defined in Happstack.Server.SURI Methods compare :: SURI -> SURI -> Ordering Source # (<) :: SURI -> SURI -> Bool Source # (<=) :: SURI -> SURI -> Bool Source # (>) :: SURI -> SURI -> Bool Source # (>=) :: SURI -> SURI -> Bool Source # max :: SURI -> SURI -> SURI Source # min :: SURI -> SURI -> SURI Source #
ToSURI SURI Source # |
Instance details Defined in Happstack.Server.SURI Methods toSURI :: SURI -> SURI Source #

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 #

#### Instances

Instances details

ToSURI SURI Source # |
Instance details Defined in Happstack.Server.SURI Methods toSURI :: SURI -> SURI Source #
ToSURI URI Source # |
Instance details Defined in Happstack.Server.SURI Methods toSURI :: URI -> SURI Source #
ToSURI Text Source # |
Instance details Defined in Happstack.Server.SURI Methods toSURI :: Text -> SURI Source #
ToSURI Text Source # |
Instance details Defined in Happstack.Server.SURI Methods toSURI :: Text -> SURI Source #
ToSURI String Source # |
Instance details Defined in Happstack.Server.SURI Methods toSURI :: String -> SURI Source #

class FromPath x where Source #

Methods

fromPath :: String -> x Source #