eved-0.0.3.0: A value level web framework
Safe HaskellNone
LanguageHaskell2010

Web.Eved

Synopsis

Documentation

class Eved api m | api -> m Source #

Minimal complete definition

(.<|>), lit, capture, reqBody, queryParam, header, verb

Instances

Instances details
Eved EvedClient ClientM Source # 
Instance details

Defined in Web.Eved.Client

Eved (EvedServerT m) m Source # 
Instance details

Defined in Web.Eved.Server

Methods

(.<|>) :: EvedServerT m a -> EvedServerT m b -> EvedServerT m (a :<|> b) Source #

lit :: Text -> EvedServerT m a -> EvedServerT m a Source #

capture :: Text -> UrlElement a -> EvedServerT m b -> EvedServerT m (a -> b) Source #

reqBody :: NonEmpty (ContentType a) -> EvedServerT m b -> EvedServerT m (a -> b) Source #

queryParam :: Text -> QueryParam a -> EvedServerT m b -> EvedServerT m (a -> b) Source #

header :: Text -> Header a -> EvedServerT m b -> EvedServerT m (a -> b) Source #

verb :: StdMethod -> Status -> NonEmpty (ContentType a) -> EvedServerT m (m a) Source #

Eved (EvedOptions m) m Source # 
Instance details

Defined in Web.Eved.Options

Methods

(.<|>) :: EvedOptions m a -> EvedOptions m b -> EvedOptions m (a :<|> b) Source #

lit :: Text -> EvedOptions m a -> EvedOptions m a Source #

capture :: Text -> UrlElement a -> EvedOptions m b -> EvedOptions m (a -> b) Source #

reqBody :: NonEmpty (ContentType a) -> EvedOptions m b -> EvedOptions m (a -> b) Source #

queryParam :: Text -> QueryParam a -> EvedOptions m b -> EvedOptions m (a -> b) Source #

header :: Text -> Header a -> EvedOptions m b -> EvedOptions m (a -> b) Source #

verb :: StdMethod -> Status -> NonEmpty (ContentType a) -> EvedOptions m (m a) Source #

data a :<|> b infixl 4 Source #

Constructors

a :<|> b infixl 4 

(.</>) :: (Applicative f, Eved api m) => (f (api a) -> f (api b)) -> f (api a) -> f (api b) infixr 5 Source #

A Segment seperator to be used between path segments akin to / in a url e.g. lit "hello" ./ capture "name" UE.text ./ get [CT.json @Text]

(.<|>) :: (Eved api m, Applicative f) => f (api a) -> f (api b) -> f (api (a :<|> b)) Source #

Combine two sub-api's by trying the left api first and then the right api second.

lit :: (Eved api m, Applicative f) => Text -> f (api a) -> f (api a) Source #

Add a Literal string to the path of the api

capture :: (Eved api m, Applicative f) => Text -> f (UrlElement a) -> f (api b) -> f (api (a -> b)) Source #

Add a url capture with a given name and UrlElement decoder/encoder

reqBody :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api b) -> f (api (a -> b)) Source #

Add a request body parser for the given content types The Content-Type header will be examined to assist in content negotiation.

queryParam :: (Eved api m, Applicative f) => Text -> f (QueryParam a) -> f (api b) -> f (api (a -> b)) Source #

A single query param that is required to exist. If the argument is not required use QP.maybe

verb :: (Eved api m, Applicative f) => StdMethod -> Status -> NonEmpty (f (ContentType a)) -> f (api (m a)) Source #

The leaf node of most routes, this will specify the HTTP Verb and Status along with a list of ContentType encoder/decoders. The Allow header in the request will be examined to determine a suitable response Content-Type

get :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a)) Source #

HTTP GET -- see verb for more info

post :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a)) Source #

HTTP POST -- see verb for more info

put :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a)) Source #

HTTP PUT -- see verb for more info

patch :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a)) Source #

HTTP PATCH -- see verb for more info

delete :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a)) Source #

HTTP DELETE -- see verb for more info

runClient :: (MonadIO m, MonadReader env m, HasHttpManager env) => ClientM a -> m a Source #

noContext :: Eved api m => Identity (api a) -> api a Source #

Unwrap an api that requires no context. If none of the combinators that were used required any context use this function to unwrap the api

withContext :: Eved api m => ctx -> (ctx -> api a) -> api a Source #

data ClientM a Source #

Instances

Instances details
Eved EvedClient ClientM Source # 
Instance details

Defined in Web.Eved.Client

data EvedServerT m a Source #

Instances

Instances details
EvedAuth (EvedServerT m) Source # 
Instance details

Defined in Web.Eved.Auth

Methods

auth_ :: NonEmpty (AuthScheme a) -> EvedServerT m b -> EvedServerT m (a -> b) Source #

Eved (EvedServerT m) m Source # 
Instance details

Defined in Web.Eved.Server

Methods

(.<|>) :: EvedServerT m a -> EvedServerT m b -> EvedServerT m (a :<|> b) Source #

lit :: Text -> EvedServerT m a -> EvedServerT m a Source #

capture :: Text -> UrlElement a -> EvedServerT m b -> EvedServerT m (a -> b) Source #

reqBody :: NonEmpty (ContentType a) -> EvedServerT m b -> EvedServerT m (a -> b) Source #

queryParam :: Text -> QueryParam a -> EvedServerT m b -> EvedServerT m (a -> b) Source #

header :: Text -> Header a -> EvedServerT m b -> EvedServerT m (a -> b) Source #

verb :: StdMethod -> Status -> NonEmpty (ContentType a) -> EvedServerT m (m a) Source #

server :: (forall a. m a -> IO a) -> a -> EvedServerT m a -> Application Source #