Description
Use MonadUnliftIO on servant APIs.
Description
unliftio-servant-server provides convenience functions for running servant APIs whose monads have a MonadUnliftIO instance.
README.md
UnliftIO Support for servant-server
Servant APIs written in any MonadUnliftIO m can be converted to wai Applications without writing the natural transformation by hand. These functions will return m Application which means that either:
- You will have to serve from inside your
MonadUnliftIO mmonad, or - You will have to unwrap your application monad to
IO, bind theApplication, and then serve it inIO.
If you choose the second option, beware ResourceT --- trying to use the returned Application outside of a containing ResourceT risks attempting to interact with closed resources.