unliftio-servant-server: Use MonadUnliftIO on servant APIs

[ bsd3, library, servant, server ] [ Propose Tags ] [ Report a vulnerability ]

unliftio-servant-server provides convenience functions for running servant APIs whose monads have a MonadUnliftIO instance.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1
Change log CHANGELOG.md
Dependencies base (>=4.14 && <4.20), mtl (>=2.2.2 && <2.4), servant (>=0.19 && <0.21), servant-server (>=0.19 && <0.21), unliftio-core (>=0.1.0.0 && <0.3.0.0) [details]
Tested with ghc ==8.10.7 || ==9.0.2 || ==9.2.4 || ==9.4.5 || ==9.6.4 || ==9.8.2
License BSD-3-Clause
Copyright Copyright (C) 2024 Bellroy Pty Ltd
Author Bellroy Tech Team <haskell@bellroy.com>
Maintainer Bellroy Tech Team <haskell@bellroy.com>
Category Servant, Server
Home page https://github.com/bellroy/unliftio-servant-server
Bug tracker https://github.com/bellroy/unliftio-servant-server/issues
Source repo head: git clone https://github.com/bellroy/unliftio-servant-server.git
Uploaded by jack at 2024-08-06T23:46:07Z
Distributions NixOS:0.1.0.1
Downloads 71 total (0 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-08-07 [all 1 reports]

Readme for unliftio-servant-server-0.1.0.1

[back to package description]

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.