web-routes-0.27.9: Library for maintaining correctness and composability of URLs within an application.

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

unRouteT :: (url -> [(Text, Maybe Text)] -> Text) -> m a
 

Instances

MonadRWS r w s m => MonadRWS r w s (RouteT url m) 
MonadError e m => MonadError e (RouteT url m) 
MonadReader r m => MonadReader r (RouteT url m) 
MonadState s m => MonadState s (RouteT url m) 
MonadWriter w m => MonadWriter w (RouteT url m) 
MonadTrans (RouteT url) 
Alternative m => Alternative (RouteT url m) 
Monad m => Monad (RouteT url m) 
Functor m => Functor (RouteT url m) 
MonadFix m => MonadFix (RouteT url m) 
(MonadPlus m, Monad (RouteT url m)) => MonadPlus (RouteT url m) 
Applicative m => Applicative (RouteT url m) 
MonadThrow m => MonadThrow (RouteT url m) 
MonadCatch m => MonadCatch (RouteT url m) 
MonadIO m => MonadIO (RouteT url m) 
MonadCont m => MonadCont (RouteT url m) 
Monad m => MonadRoute (RouteT url m) 
type URL (RouteT url m) = url 

class Monad m => MonadRoute m where Source

Associated Types

type URL m Source

Methods

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

Instances

Monad m => MonadRoute (RouteT url m) 

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