rest-core-0.39: Rest API library.

Safe HaskellNone
LanguageHaskell98

Rest.Driver.Routing.Internal

Contents

Synopsis

Documentation

apiError :: MonadError (Reason e) m => Reason e -> m a Source #

data RouterData m Source #

Constructors

RouterData 

Fields

Instances

MonadReader (RouterData m) (Router m) Source # 

Methods

ask :: Router m (RouterData m) #

local :: (RouterData m -> RouterData m) -> Router m a -> Router m a #

reader :: (RouterData m -> a) -> Router m a #

newtype Router m a Source #

Instances

MonadError Reason_ (Router m) Source # 

Methods

throwError :: Reason_ -> Router m a #

catchError :: Router m a -> (Reason_ -> Router m a) -> Router m a #

MonadState UriParts (Router m) Source # 

Methods

get :: Router m UriParts #

put :: UriParts -> Router m () #

state :: (UriParts -> (a, UriParts)) -> Router m a #

Monad (Router m) Source # 

Methods

(>>=) :: Router m a -> (a -> Router m b) -> Router m b #

(>>) :: Router m a -> Router m b -> Router m b #

return :: a -> Router m a #

fail :: String -> Router m a #

Functor (Router m) Source # 

Methods

fmap :: (a -> b) -> Router m a -> Router m b #

(<$) :: a -> Router m b -> Router m a #

Applicative (Router m) Source # 

Methods

pure :: a -> Router m a #

(<*>) :: Router m (a -> b) -> Router m a -> Router m b #

(*>) :: Router m a -> Router m b -> Router m b #

(<*) :: Router m a -> Router m b -> Router m a #

MonadReader (RouterData m) (Router m) Source # 

Methods

ask :: Router m (RouterData m) #

local :: (RouterData m -> RouterData m) -> Router m a -> Router m a #

reader :: (RouterData m -> a) -> Router m a #

routeToplevel :: Resource m s sid mid aid -> [Some1 (Router s)] -> Maybe (Cardinality sid mid) -> MaybeT (Router n) (RunnableHandler m) Source #

routeCreate :: Resource m s sid mid aid -> MaybeT (Router n) (RunnableHandler m) Source #

routeStep :: Resource m s sid mid aid -> [Some1 (Router s)] -> Step sid mid aid -> Router n (RunnableHandler m) Source #

routeNamed :: Resource m s sid mid aid -> [Some1 (Router s)] -> Endpoint sid mid aid -> Router n (RunnableHandler m) Source #

routeUnnamed :: Resource m s sid mid aid -> [Some1 (Router s)] -> Cardinality (Id sid) (Id mid) -> Router n (RunnableHandler m) Source #

routeGetter :: Getter sid -> Resource m s sid mid aid -> [Some1 (Router s)] -> Router n (RunnableHandler m) Source #

multi :: Resource m s sid mid aid -> Id sid -> Router n (RunnableHandler m) Source #

withSubresource :: sid -> Resource m s sid mid aid -> [Some1 (Router s)] -> Router n (RunnableHandler m) Source #

routeSingle :: sid -> Resource m s sid mid aid -> Router n (RunnableHandler m) Source #

parseIdent :: MonadError (Reason e) m => Id id -> String -> m id Source #

withSegment :: Router n a -> (String -> Router n a) -> Router n a Source #

mkListAction :: Monad m => (Env h p i -> ExceptT (Reason e) m [a]) -> Env h (Range, p) i -> ExceptT (Reason e) m (List a) Source #

mkMultiHandler :: Monad m => Id id -> (id -> Run s m) -> Handler s -> Maybe (Handler m) Source #

mkMultiGetHandler :: forall m s. (Applicative m, Monad m) => Config m -> Router m s -> Handler m Source #

Utilities

fromMaybeT :: Monad m => m a -> MaybeT m a -> m a Source #