haskell-servant / haskell-servant/servant-multipart
Compilation error for servant-multipart-client-0.12.1 against servant-0.16.1
- Dominant language
- Haskell
- Stars
- 40
- Forks
- 42
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 1
Description
Hello, I work on a project currently depending on servant-0.16.1.
It seems the `SourceT` type is lacking a Semigroup instance on which `servant-multipart-client-0.12.1` relies on.
If my understanding is correct, servant-multipart-client 0.12.1 is effectively incompatible with servant 0.16.
Details:
```
ghc-8.6.5
```
```
$ stack exec ghc-pkg list | grep servant
servant-0.16.0.1
servant-client-0.16
servant-client-core-0.16
servant-multipart-0.11.4
servant-multipart-api-0.12.1
servant-server-0.16
```
```
servant-multipart-client > Configuring servant-multipart-client-0.12.1...
servant-multipart-client > build
servant-multipart-client > Preprocessing library for servant-multipart-client-0.12.1..
servant-multipart-client > Building library for servant-multipart-client-0.12.1..
servant-multipart-client > [1 of 1] Compiling Servant.Multipart.Client
servant-multipart-client >
servant-multipart-client > /tmp/stack2910/servant-multipart-client-0.12.1/src/Servant/Multipart/Client.hs:116:51: error:
servant-multipart-client > • Could not deduce (Semigroup (SourceT IO LBS.ByteString))
servant-multipart-client > arising from a use of ‘<>’
servant-multipart-client > from the context: MultipartClient tag
servant-multipart-client > bound by the type signature for:
servant-multipart-client > multipartToBody :: forall tag.
servant-multipart-client > MultipartClient tag =>
servant-multipart-client > LBS.ByteString -> MultipartData tag -> RequestBody
servant-multipart-client > at src/Servant/Multipart/Client.hs:(111,1)-(115,30)
servant-multipart-client > • In the second argument of ‘($)’, namely
servant-multipart-client > ‘files' <> source ["--", boundary, "--"]’
servant-multipart-client > In the expression:
servant-multipart-client > RequestBodySource $ files' <> source ["--", boundary, "--"]
servant-multipart-client > In an equation for ‘multipartToBody’:
servant-multipart-client > multipartToBody boundary mp
servant-multipart-client > = RequestBodySource $ files' <> source ["--", boundary, "--"]
servant-multipart-client > where
servant-multipart-client > (SourceT l) `mappend'` (SourceT r) = SourceT $ \ k -> l $ ...
servant-multipart-client > appendStep Stop r = r
servant-multipart-client > appendStep (Error err) _ = Error err
servant-multipart-client > appendStep (Skip s) r = appendStep s r
servant-multipart-client > appendStep (Yield x s) r = Yield x (appendStep s r)
servant-multipart-client > appendStep (Effect ms) r = Effect $ (flip appendStep r <$> ms)
servant-multipart-client > mempty' = SourceT ($ Stop)
servant-multipart-client > crlf = "\r\n"
servant-multipart-client > ....
servant-multipart-client > |
servant-multipart-client > 116 | multipartToBody boundary mp = RequestBodySource $ files' <> source ["--", boundary, "--"]
servant-multipart-client > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/Servant/Multipart/Client.hs around multipartToBody and reproduce the build using servant-0.16.0.1, servant-client-0.16, and GHC 8.6.5. Trace the SourceT combination at the reported line and verify that servant-multipart-client compiles successfully with servant 0.16.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100