@hackage / unliftio-servant-server

Use MonadUnliftIO on servant APIs

Latest0.1.0.2

About

Metadata

  • Last updated , by LukeWorth
  • License BSD-3-Clause
  • Categories Web Development
  • Maintained by: Bellroy Tech Team <haskell@bellroy.com>

  • Lottery factor: 3

Links

Installation

Tested Compilers

  1. 9.12.2
  2. 9.10.3
  3. 9.8.4
  4. 9.6.7
  5. 9.4.8
  6. 9.2.4
  7. 9.0.2
  8. 8.10.7

Readme

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:

  1. You will have to serve from inside your MonadUnliftIO m monad, or
  2. You will have to unwrap your application monad to IO, bind the Application, and then serve it in IO.

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.