cdepillabout / servant-rawm

Effectful Raw handler for Servant servers.
https://hackage.haskell.org/package/servant-rawm
BSD 3-Clause "New" or "Revised" License
16 stars 7 forks source link

servant-rawm-client doesn't work with servant-client-core 0.18.2 #19

Closed jhrcek closed 3 years ago

jhrcek commented 3 years ago

I'm building an application with stack lts-17.6 This lts contains servant-client-core version 0.18.2 (https://www.stackage.org/lts-17.6/package/servant-client-core-0.18.2)

Unfortunately servant-rawm-client doesn't work with this version of servant-client-core. I'm getting the following compiler error

servant-rawm-client> configure
servant-rawm-client> Configuring servant-rawm-client-1.0.0.1...
servant-rawm-client> build
servant-rawm-client> Preprocessing library for servant-rawm-client-1.0.0.1..
servant-rawm-client> Building library for servant-rawm-client-1.0.0.1..
servant-rawm-client> [1 of 1] Compiling Servant.RawM.Client
servant-rawm-client> 
servant-rawm-client> /tmp/stack-01302dddd3f93726/servant-rawm-client-1.0.0.1/src/Servant/RawM/Client.hs:31:59: error:
servant-rawm-client>     Module ‘Servant.Client.Core’ does not export ‘runRequest’
servant-rawm-client>    |
servant-rawm-client> 31 |                             Request, Response, RunClient, runRequest)
servant-rawm-client>    |                                                           ^^^^^^^^^^
servant-rawm-client> 

It seems things have been moved around in newer versions of servant-client and runRequest now lives in Servant.Client.Core.RunClient.

Would you accept a PR with CPP-based fix for this?

jhrcek commented 3 years ago

The fix might be even simpler than that. runRequest was un-exposed from Servant.Client.Core starting from servant-client-core 0.18.1.

I looked at exact version differences between servant client and the way to fix this could be to import runRequest from Servant.Client.Core.RunClient which is the module that all servant versions from 0.16 onwards as illustrated by following gif:

runRequest

cdepillabout commented 3 years ago

Closed by @jhrcek in #20.

jhrcek commented 3 years ago

Hello @cdepillabout . Could you please release the version with this fix to hackage? This would simplify our project's stack config (depending on package from hackage is arguably simpler than depending on specific commit in 3rd party repo).

cdepillabout commented 3 years ago

@jhrcek I think this version should be on Hackage?

https://hackage.haskell.org/package/servant-rawm-client-1.0.0.2

Are you having trouble using this version?

jhrcek commented 3 years ago

Sorry, turns out it was my mistake. We had servant-rawm dependency declared in cabal since before the package was split into client/server subpackages. Removing that and adding extra-deps for these 2 new packages to stack.yaml fixed the issue.