Export tweakResponse from non-internal module; better haddock comment.
This commit is contained in:
parent
dd1d30843b
commit
8f01efd599
2 changed files with 2 additions and 4 deletions
|
@ -33,7 +33,7 @@ module Servant.Server
|
|||
, embedNat
|
||||
, squashNat
|
||||
, generalizeNat
|
||||
|
||||
, tweakResponse
|
||||
|
||||
-- * Default error type
|
||||
, ServantErr(..)
|
||||
|
|
|
@ -26,9 +26,7 @@ data Router' a =
|
|||
-- ^ left-biased choice between two routers
|
||||
deriving Functor
|
||||
|
||||
-- | Apply a function to the result of a router in functor style. The result contains the failure
|
||||
-- cases so one use case is to turn failures into middleware response values with appropriate status
|
||||
-- codes, message bodies, etc.
|
||||
-- | Apply a transformation to the response of a `Router`.
|
||||
tweakResponse :: (RouteResult Response -> RouteResult Response) -> Router -> Router
|
||||
tweakResponse f = fmap (\a -> \req cont -> a req (cont . f))
|
||||
|
||||
|
|
Loading…
Reference in a new issue