Comments (1)
The proposed solution has some serious problems and I would like to retract it.
Also, I've found a solution that involves no modification to Servant.
The main line is this one which hoists a ReaderT _ IO
to Handler
server <- withRunInIO $ \toIo -> pure $ hoistServer counterAPI (Handler . ExceptT . try . toIo) server_rio
-- `toIO` converts from (ReaderT (IORef Int) IO) to IO
-- `Handler. ExceptT . try` converts Servant exceptions in IO back to ExceptT
That of course will work with anything that is MonadUnliftIO
such as the cleff and effectful Eff
monad.
Closing this issue.
from servant.
Related Issues (20)
- Docs on "Record-based APIs: the nested records case" not in main branch HOT 3
- servant-auth-server: Too strict bounds on lens-aeson HOT 2
- servant-foreign: too strict bounds on hspec HOT 2
- Question: How to restrict an API to a particular virtual host (value of the request "Host:" header)? HOT 1
- Make JWKSettings signingKey optional HOT 1
- link broke on read me HOT 1
- Get '[JSON] does not imply a header Accept: application/json HOT 5
- Discuss support for JWTs with additional claims in light of jose deprecations
- return an `MonadUnliftIO m => ApplicationT m` from `serve` HOT 1
- Split up HasServer, HasClient HOT 2
- Export a function of type `IO (Either ServerError a) -> Handler a` from `Servant.Server` HOT 3
- Recommend argon2 in JWT cookbook
- Clarify documentation for `Servant.Links.allLinks`
- Cookie sets the JWT-Cookie to http only but doesn't readd from the Cookie header
- servant-server: Revise `warp <3.5` on Hackage? HOT 1
- Prepare servant-quickcheck 1.0 release HOT 1
- servant-client-core-0.20.1 issue with DeepQuery and QueryString HOT 9
- Release v0.21 HOT 2
- servant-auth doesn't build with new js backend HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from servant.