Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error for servant-multipart-client-0.12.1 against servant-0.16.1 #56

Open
flhorizon opened this issue Jun 30, 2021 · 0 comments

Comments

@flhorizon
Copy link

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 >     |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant