haskell-servant / haskell-servant/servant
return an `MonadUnliftIO m => ApplicationT m` from `serve`
Open
- Dominant language
- Haskell
- Stars
- 2k
- Forks
- 427
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 5
Description
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:
```haskell
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!
Contributor guide
Assessment
This issue has not been assessed yet.