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

Not compatible with aeson > 2.0.0.0 #519

Open
bogdan-manole opened this issue Oct 15, 2023 · 1 comment
Open

Not compatible with aeson > 2.0.0.0 #519

bogdan-manole opened this issue Oct 15, 2023 · 1 comment

Comments

@bogdan-manole
Copy link

bogdan-manole commented Oct 15, 2023

There is no more Data.Aeson.Parser module starting with version aeson-2.0.0.0 and no json' either.
When the library is built with aeson flag and aeson > 2.0.0.0 the building will fail with:

 > Network/HTTP/Simple.hs:106:1: error:
 >     Could not find module Data.Aeson.Parser
 >     Use -v (or `:set -v` in ghci) to see a list of the files searched for.
 >     |
 > 106 | import Data.Aeson.Parser (json')

https://github.com/snoyberg/http-client/blob/f4f76f4fd72f227074d8635c244ea0b3b61c7163/http-conduit/Network/HTTP/Simple.hs#L106C1-L106C1

UPDATE: I see there is the dependency of attoparsec-aeson which has that implementation of Data.Aeson.Parser module, though I don't know why is not taken into consideration in my build set

@bogdan-manole
Copy link
Author

It seems I used an older/intermediate version from hackage (>= 2.2.0 && <2.3.7) . Now I referenced it directly from github and it works. Anyway, I guess these newer versions won't work anymore with aeson <2.x.x (though the dependency constraint of the aeson specifies that it is allowed ) since there will be an ambiguity on which Data.Aeson.Parsec to be used (from aeson or attoparsec-aeson).

maybe PackageImports extension should be used instead

{-# LANGUAGE PackageImports      #-}
.....
#ifdef VERSION_aeson
import Data.Aeson (FromJSON (..), Value)
import "attoparsec-aeson"Data.Aeson.Parser (json')
.....
#endif

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