Add GHC 9.6+ and aeson 2.2 compatibility for socket-io #47
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