Skip to content

Conversation

@Profpatsch
Copy link

This is a small update I made so we can use superrecord with GHC 9 and aeson 2.

See commit messages, might not be up to standard with this project’s guidelines (e.g. CI needs to be adjusted I guess, and older GHCs might not like the Type change).

This adds a bit more ifdef zoo to be compatible with the breaking
change in aeson. Tested manually against GHC 8.10.7 and GHC 9.0.2.

Might want to update the CI as well, but I don’t have the time to
touch CircleCI yaml.
GHC 9 warns that `*` will be removed soon.

Tested against 8.10.7 and 9, might not work with some old `base`
versions.
@Profpatsch
Copy link
Author

Profpatsch commented May 18, 2022

Beware that there is a regression in the Variant tests:

Failures:

  test/Spec.hs:151:15:
  1) Variants parses from JSON
superrecord-test: Prelude.undefined
CallStack (from HasCallStack):
  error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err
  undefined, called at src/SuperRecord/Variant.hs:126:26 in superrecord-0.5.1.0-inplace:SuperRecord.Variant

We are not using Variants, so I’m ignoring that for now.

@Profpatsch
Copy link
Author

Oh, I also think the second commit is not valid, simply replacing every * with Type will make Has not work anymore:

     Rec.Has "firstDay" req Time.Day

leads to the error

• Expected kind ‘[*]’,
    but ‘"firstDay"’ has kind ‘ghc-prim-0.7.0:GHC.Types.Symbol’
…

So I’m guessing it is less generic than *, I guess it has to be kind-polymorphic to work.

@Profpatsch
Copy link
Author

Nvm, apparently the Has constraint flipped the second and third argument, which is why I got this error.

@Profpatsch
Copy link
Author

Superseded by #35

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

Successfully merging this pull request may close these issues.

1 participant