minion-0.1.0.0: A Haskell introspectable web router
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.Minion.Response.Body

Synopsis

Documentation

newtype RespBody cts a Source #

Constructors

RespBody a 

Instances

Instances details
AllContentTypes cts => CanRespond (RespBody cts a :: Type) Source # 
Instance details

Defined in Web.Minion.Response.Body

(EncodeBody (ct ': cts) a2, Encode ct a2, MonadIO m, ContentType ct) => ToResponse m (RespBody (ct ': cts) a2) Source # 
Instance details

Defined in Web.Minion.Response.Body

Methods

toResponse :: [ByteString] -> RespBody (ct ': cts) a2 -> m Response Source #

MonadIO m => ToResponse m (RespBody ('[] :: [k]) a) Source # 
Instance details

Defined in Web.Minion.Response.Body

Methods

toResponse :: [ByteString] -> RespBody '[] a -> m Response Source #

class EncodeBody cts a where Source #

Instances

Instances details
EncodeBody ('[] :: [k]) a Source # 
Instance details

Defined in Web.Minion.Response.Body

(ContentType ct, Encode ct a2, EncodeBody cts a2) => EncodeBody (ct ': cts :: [a1]) a2 Source # 
Instance details

Defined in Web.Minion.Response.Body

class Encode ct a where Source #

Methods

encode :: a -> Response Source #

Instances

Instances details
ToJSON a => Encode Json a Source # 
Instance details

Defined in Web.Minion.Media.Json

Methods

encode :: a -> Response Source #

Encode PlainText Text Source # 
Instance details

Defined in Web.Minion.Response.Body

Methods

encode :: Text -> Response Source #

Encode PlainText Text Source # 
Instance details

Defined in Web.Minion.Response.Body

Methods

encode :: Text -> Response Source #

Encode PlainText String Source # 
Instance details

Defined in Web.Minion.Response.Body

handleBody Source #

Arguments

:: forall cts o m ts i st. HandleArgs ts st m 
=> IsResponse m (RespBody cts o) 
=> Introspection i Response (RespBody cts o) 
=> Method

.

-> (DelayedArgs st ~> m o) 
-> Router' i ts m 

Handles request with specified HTTP method and responds with specified Content-Type

... /> handleBody GET @'[PlainText] @MyResponse someEndpoint