servant
servant copied to clipboard
return an `MonadUnliftIO m => ApplicationT m` from `serve`
This would be useful to provide alternative handlers for effects that are accessed by all handlers in a server; e.g. say we have a Logging effect with some lock, we don't want to have this per handler buy ideally per application, currently that's not possible because the hoist function in the available APIs goes to Handler a; I would like something like:
genericServeTT
:: forall routes m n.
( {- snip -}
, MonadUnliftIO n
)
=> (forall a. m a -> ExceptT ServerError n a)
-> routes (AsServerT m)
-> ApplicationT n
does that make sense?
Thanks in advance!
possibly related: https://github.com/haskell-servant/servant/issues/1544
It would basically be similar to RawM except it would not be on a per route basis.