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

GHC 9.6.3 support #70

Open
maerten opened this issue Sep 29, 2023 · 4 comments
Open

GHC 9.6.3 support #70

maerten opened this issue Sep 29, 2023 · 4 comments

Comments

@maerten
Copy link

maerten commented Sep 29, 2023

Hello,
I've just tried compiling servant-multipart with GHC 9.6.3 and am hitting this issue:

servant-multipart-client> build
servant-multipart-client> Preprocessing executable 'server' for servant-multipart-client-0.12.1..
servant-multipart-client> Building executable 'server' for servant-multipart-client-0.12.1..
servant-multipart-client> [1 of 1] Compiling Main
servant-multipart-client> [2 of 2] Linking .stack-work/dist/aarch64-osx/Cabal-3.10.1.0/build/server/server
servant-multipart-client> ld: warning: ignoring duplicate libraries: '-lm'
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> /private/var/folders/0c/zmpjp7l568xcvnt49pkkn5p00000gn/T/stack-29e507a3bc44f1b9/servant-multipart-client-0.12.1/src/Servant/Multipart/Client.hs:77:18: error: [GHC-39999]
servant-multipart-client>     • Ambiguous type variable ‘f1’ arising from a use of ‘source’
servant-multipart-client>       prevents the constraint ‘(Foldable f1)’ from being solved.
servant-multipart-client>       Probable fix: use a type annotation to specify what ‘f1’ should be.
servant-multipart-client>       Potentially matching instances:
servant-multipart-client>         instance Foldable (Either a) -- Defined in ‘Data.Foldable’
servant-multipart-client>         instance Foldable Proxy -- Defined in ‘Data.Foldable’
servant-multipart-client>         ...plus 7 others
servant-multipart-client>         ...plus 93 instances involving out-of-scope types
servant-multipart-client>         (use -fprint-potential-instances to see them all)
servant-multipart-client>     • In the first argument of ‘(.)’, namely ‘source’
servant-multipart-client>       In the expression: source . pure
servant-multipart-client>       In an equation for ‘loadFile’: loadFile _ = source . pure
servant-multipart-client>    |
servant-multipart-client> 77 |     loadFile _ = source . pure
servant-multipart-client>    |                  ^^^^^^
servant-multipart-client>
servant-multipart-client> /private/var/folders/0c/zmpjp7l568xcvnt49pkkn5p00000gn/T/stack-29e507a3bc44f1b9/servant-multipart-client-0.12.1/src/Servant/Multipart/Client.hs:77:27: error: [GHC-39999]
servant-multipart-client>     • Ambiguous type variable ‘f1’ arising from a use of ‘pure’
servant-multipart-client>       prevents the constraint ‘(Applicative f1)’ from being solved.
servant-multipart-client>       Probable fix: use a type annotation to specify what ‘f1’ should be.
servant-multipart-client>       Potentially matching instances:
servant-multipart-client>         instance Applicative (Either e) -- Defined in ‘Data.Either’
servant-multipart-client>         instance Applicative Proxy -- Defined in ‘Data.Proxy’
servant-multipart-client>         ...plus 8 others
servant-multipart-client>         ...plus 75 instances involving out-of-scope types
servant-multipart-client>         (use -fprint-potential-instances to see them all)
servant-multipart-client>     • In the second argument of ‘(.)’, namely ‘pure’
servant-multipart-client>       In the expression: source . pure
servant-multipart-client>       In an equation for ‘loadFile’: loadFile _ = source . pure
servant-multipart-client>    |
servant-multipart-client> 77 |     loadFile _ = source . pure
servant-multipart-client>    |                           ^^^^
servant-multipart-client>
servant-multipart-client> /private/var/folders/0c/zmpjp7l568xcvnt49pkkn5p00000gn/T/stack-29e507a3bc44f1b9/servant-multipart-client-0.12.1/src/Servant/Multipart/Client.hs:135:37: error: [GHC-39999]
servant-multipart-client>     • Could not deduce ‘Foldable f0’ arising from a use of ‘source’
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>       The type variable ‘f0’ is ambiguous
servant-multipart-client>       Potentially matching instances:
servant-multipart-client>         instance Foldable (Either a) -- Defined in ‘Data.Foldable’
servant-multipart-client>         instance Foldable Proxy -- Defined in ‘Data.Foldable’
servant-multipart-client>         ...plus 7 others
servant-multipart-client>         ...plus 93 instances involving out-of-scope types
servant-multipart-client>         (use -fprint-potential-instances to see them all)
servant-multipart-client>     • In the first argument of ‘(.)’, namely ‘source’
servant-multipart-client>       In the first argument of ‘($)’, namely
servant-multipart-client>         ‘source . pure . lencode . iValue’
servant-multipart-client>       In the fourth argument of ‘renderPart’, namely
servant-multipart-client>         ‘(source . pure . lencode . iValue $ input)’
servant-multipart-client>     |
servant-multipart-client> 135 |                                    (source . pure . lencode . iValue $ input)
servant-multipart-client>     |                                     ^^^^^^
servant-multipart-client>
servant-multipart-client> /private/var/folders/0c/zmpjp7l568xcvnt49pkkn5p00000gn/T/stack-29e507a3bc44f1b9/servant-multipart-client-0.12.1/src/Servant/Multipart/Client.hs:135:46: error: [GHC-39999]
servant-multipart-client>     • Could not deduce ‘Applicative f0’ arising from a use of ‘pure’
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>       The type variable ‘f0’ is ambiguous
servant-multipart-client>       Potentially matching instances:
servant-multipart-client>         instance Applicative (Either e) -- Defined in ‘Data.Either’
servant-multipart-client>         instance Applicative Proxy -- Defined in ‘Data.Proxy’
servant-multipart-client>         ...plus 8 others
servant-multipart-client>         ...plus 75 instances involving out-of-scope types
servant-multipart-client>         (use -fprint-potential-instances to see them all)
servant-multipart-client>     • In the first argument of ‘(.)’, namely ‘pure’
servant-multipart-client>       In the second argument of ‘(.)’, namely ‘pure . lencode . iValue’
servant-multipart-client>       In the first argument of ‘($)’, namely
servant-multipart-client>         ‘source . pure . lencode . iValue’
servant-multipart-client>     |
servant-multipart-client> 135 |                                    (source . pure . lencode . iValue $ input)
servant-multipart-client>     |                                              ^^^^
@ysangkok
Copy link
Contributor

ysangkok commented Oct 23, 2023

Could you please dump your whole dep graph? You can use a tool such as cabal-plan. Probably some dependency is getting pinned to a lower version.

This looks related to:

This works for me:

cabal repl -w ghc-9.6.2 -b servant-multipart-client -c 'servant==0.20.1'

with the index-state of today.

@ysangkok
Copy link
Contributor

Oh, I see you're using 0.12.1. You should try out version 0.12.2.

@ysangkok
Copy link
Contributor

@erlandsona here is version 0.12.2: https://hackage.haskell.org/package/servant-multipart-client

I can review your patch if you send it.

@erlandsona
Copy link

Hey sorry I realized the function got moved to 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

3 participants