Add GHC 9.6+ and aeson 2.2 compatibility for socket-io#47
Open
anpryl wants to merge 2 commits intoocharles:masterfrom
Open
Add GHC 9.6+ and aeson 2.2 compatibility for socket-io#47anpryl wants to merge 2 commits intoocharles:masterfrom
anpryl wants to merge 2 commits intoocharles:masterfrom
Conversation
- Add AllowAmbiguousTypes pragma to SocketIO.hs - Replace generic OnArgs base instance with EventHandler-specific instance to satisfy GHC 9.6+ stricter fundep checking - Add attoparsec-aeson dependency and import Data.Aeson.Parser for the json parser (moved from Data.Aeson in aeson 2.2) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update upper bounds in engine-io.cabal and socket-io.cabal to support GHC 9.8 (base 4.19, text 2.1, mtl 2.3, transformers 0.6) and aeson 2.2.x.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds compatibility with GHC 9.6+ and aeson 2.2+ to the socket-io package.
GHC 9.6+ fundep fix
GHC 9.6+ is stricter about functional dependency checking. The combination of:
class OnArgs a r | a -> rinstance OnArgs a a(generic base case)OnArgs f (EventHandler a)in theonsignature...causes GHC 9.6+ to reject the code because the fundep + base instance forces
f ~ EventHandler a, which is too restrictive.Fix: Add
AllowAmbiguousTypesand replace the generic base instance with anEventHandler-specific instance to avoid the fundep conflict.aeson 2.2 migration
aeson 2.2 moved the
jsonattoparsec parser to theattoparsec-aesonpackage. This PR adds theattoparsec-aesondependency and imports fromData.Aeson.Parserinstead ofData.Aeson.🤖 Generated with Claude Code