Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return an MonadUnliftIO m => ApplicationT m from serve #1729

Open
MangoIV opened this issue Mar 17, 2024 · 1 comment
Open

return an MonadUnliftIO m => ApplicationT m from serve #1729

MangoIV opened this issue Mar 17, 2024 · 1 comment

Comments

@MangoIV
Copy link
Contributor

MangoIV commented Mar 17, 2024

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!

@MangoIV
Copy link
Contributor Author

MangoIV commented Mar 17, 2024

possibly related: #1544

It would basically be similar to RawM except it would not be on a per route basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant