haskell-servant / haskell-servant/servant-multipart

GHC 9.6.3 support

Open
#70 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
40
Forks
42
PR merge metrics
No merged PRs in 30d

Description

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> | ^^^^
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/Servant/Multipart/Client.hs, especially the loadFile definition at line 77 and multipartToBody around line 135. Reproduce the failure by building servant-multipart-client with GHC 9.6.3, then verify that the package builds successfully without the reported ambiguous Foldable and Applicative errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.