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)
- GHC 9.6 has less ticks HOT 4
- Support using the names from named routes in `servant-foreign`
- Making query parameters optionals in allLinks/safeLink with `NamedRoute`s
- Build without warnings? HOT 3
- servant-client is working fine when hitting http2 calls locally but when we try to hit it for external calls it's giving 505 HTTP Version Not Supported
- Text-2.0 support HOT 1
- Building a project fails - missing module Data.Aeson.Parser HOT 3
- servant-auth-client test fails on the 248th call to getIntClient on Mac HOT 3
- 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 4
- 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 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.