haskell-servant / haskell-servant/servant
Servant client for a streaming end-point with a custom monad via generics
- Dominant language
- Haskell
- Stars
- 2k
- Forks
- 427
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 5
Description
I might be missing something, but I couldn't figure out how to implement this one, so help would be very much appreciated!
Here's a fully-buildable stack project in question: https://github.com/k-bx/servant-generic-custommonad-streaming/blob/streaming-endpoint/src/Main.hs Please note: **the branch is streaming-endpoint, not master**. You need to uncomment the broken code to put instead of undefined to see compilation error.
You can build and run it via `stack run server` and `stack run client` (latter one will fail because of `undefined`).
Here's what I've failed to reimplement as I've added an endpoint which has streaming in it:
```haskell
cliRoutes :: ClientEnv -> APIG (Servant.Client.Generic.AsClientT AppM)
cliRoutes _env =
undefined -- ?
-- Servant.Client.Generic.genericClientHoist
-- (\x -> liftIO (runClientM x env >>= either throwIO return))
```
Unfortunately, the documentation doesn't mention a scenario when you have simultaneously a custom monad, generics, and streaming combined.
Again, help is appreciated. Thank you!
Contributor guide
Assessment
This issue has not been assessed yet.