web-routes-0.27.14.2: portable, type-safe URL routing

Copyright(c) 2010 Jeremy Shaw
LicenseBSD-style (see the file LICENSE)
Maintainerpartners@seereason.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Web.Routes.RouteT

Contents

Description

Declaration of the RouteT monad transformer

Synopsis

RouteT Monad Transformer

newtype RouteT url m a Source #

monad transformer for generating URLs

Constructors

RouteT 

Fields

Instances

MonadRWS r w s m => MonadRWS r w s (RouteT url m) Source # 
MonadWriter w m => MonadWriter w (RouteT url m) Source # 

Methods

writer :: (a, w) -> RouteT url m a #

tell :: w -> RouteT url m () #

listen :: RouteT url m a -> RouteT url m (a, w) #

pass :: RouteT url m (a, w -> w) -> RouteT url m a #

MonadState s m => MonadState s (RouteT url m) Source # 

Methods

get :: RouteT url m s #

put :: s -> RouteT url m () #

state :: (s -> (a, s)) -> RouteT url m a #

MonadReader r m => MonadReader r (RouteT url m) Source # 

Methods

ask :: RouteT url m r #

local :: (r -> r) -> RouteT url m a -> RouteT url m a #

reader :: (r -> a) -> RouteT url m a #

MonadError e m => MonadError e (RouteT url m) Source # 

Methods

throwError :: e -> RouteT url m a #

catchError :: RouteT url m a -> (e -> RouteT url m a) -> RouteT url m a #

MonadTrans (RouteT url) Source # 

Methods

lift :: Monad m => m a -> RouteT url m a #

Monad m => Monad (RouteT url m) Source # 

Methods

(>>=) :: RouteT url m a -> (a -> RouteT url m b) -> RouteT url m b #

(>>) :: RouteT url m a -> RouteT url m b -> RouteT url m b #

return :: a -> RouteT url m a #

fail :: String -> RouteT url m a #

Functor m => Functor (RouteT url m) Source # 

Methods

fmap :: (a -> b) -> RouteT url m a -> RouteT url m b #

(<$) :: a -> RouteT url m b -> RouteT url m a #

MonadFix m => MonadFix (RouteT url m) Source # 

Methods

mfix :: (a -> RouteT url m a) -> RouteT url m a #

Applicative m => Applicative (RouteT url m) Source # 

Methods

pure :: a -> RouteT url m a #

(<*>) :: RouteT url m (a -> b) -> RouteT url m a -> RouteT url m b #

liftA2 :: (a -> b -> c) -> RouteT url m a -> RouteT url m b -> RouteT url m c #

(*>) :: RouteT url m a -> RouteT url m b -> RouteT url m b #

(<*) :: RouteT url m a -> RouteT url m b -> RouteT url m a #

MonadIO m => MonadIO (RouteT url m) Source # 

Methods

liftIO :: IO a -> RouteT url m a #

Alternative m => Alternative (RouteT url m) Source # 

Methods

empty :: RouteT url m a #

(<|>) :: RouteT url m a -> RouteT url m a -> RouteT url m a #

some :: RouteT url m a -> RouteT url m [a] #

many :: RouteT url m a -> RouteT url m [a] #

(MonadPlus m, Monad (RouteT url m)) => MonadPlus (RouteT url m) Source # 

Methods

mzero :: RouteT url m a #

mplus :: RouteT url m a -> RouteT url m a -> RouteT url m a #

MonadThrow m => MonadThrow (RouteT url m) Source # 

Methods

throwM :: Exception e => e -> RouteT url m a #

MonadCatch m => MonadCatch (RouteT url m) Source # 

Methods

catch :: Exception e => RouteT url m a -> (e -> RouteT url m a) -> RouteT url m a #

MonadCont m => MonadCont (RouteT url m) Source # 

Methods

callCC :: ((a -> RouteT url m b) -> RouteT url m a) -> RouteT url m a #

Monad m => MonadRoute (RouteT url m) Source # 

Associated Types

type URL (RouteT url m :: * -> *) :: * Source #

Methods

askRouteFn :: RouteT url m (URL (RouteT url m) -> [(Text, Maybe Text)] -> Text) Source #

type URL (RouteT url m) Source # 
type URL (RouteT url m) = url

class Monad m => MonadRoute m where Source #

Minimal complete definition

askRouteFn

Associated Types

type URL m Source #

Methods

askRouteFn :: m (URL m -> [(Text, Maybe Text)] -> Text) Source #

Instances

Monad m => MonadRoute (RouteT url m) Source # 

Associated Types

type URL (RouteT url m :: * -> *) :: * Source #

Methods

askRouteFn :: RouteT url m (URL (RouteT url m) -> [(Text, Maybe Text)] -> Text) Source #

runRouteT :: (url -> RouteT url m a) -> (url -> [(Text, Maybe Text)] -> Text) -> url -> m a Source #

convert a RouteT based route handler to a handler that can be used with the Site type

NOTE: this function used to be the same as unRouteT. If you want the old behavior, just call unRouteT.

mapRouteT :: (m a -> n b) -> RouteT url m a -> RouteT url n b Source #

Transform the computation inside a RouteT.

withRouteT :: ((url' -> [(Text, Maybe Text)] -> Text) -> url -> [(Text, Maybe Text)] -> Text) -> RouteT url m a -> RouteT url' m a Source #

Execute a computation in a modified environment

liftRouteT :: m a -> RouteT url m a Source #

askRouteT :: Monad m => RouteT url m (url -> [(Text, Maybe Text)] -> Text) Source #

nestURL :: (url1 -> url2) -> RouteT url1 m a -> RouteT url2 m a Source #