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

feat: implement To/FromJSON Empty #5421

Merged
merged 7 commits into from
Sep 24, 2024
Merged

Conversation

TomasPuverle
Copy link
Contributor

Resolve cases when the To/FromJSON type classes are used with Empty, e.g. in the following motivating example.

import Lean

structure Foo (α : Type) where
  y : Option α
deriving Lean.ToJson

#eval Lean.toJson (⟨none⟩ : Foo Empty) -- fails

This is a follow-up to this PR #5415, as suggested by @eric-wieser. It expands on the original suggestion by also handling FromJSON.

@TomasPuverle
Copy link
Contributor Author

CC: @kmill in case interested/relevant.

@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Sep 23, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Sep 23, 2024

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 738435b90aaa251a731cc463d6e49560f2037df9 --onto a6830f90ab365e14ccb7ca31201de37f8c1e978c. (2024-09-23 03:47:18)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 738435b90aaa251a731cc463d6e49560f2037df9 --onto e551a366a0bbb27d5f853cc8e87cbd381a76ffc0. (2024-09-23 20:32:15)

@kim-em kim-em added this pull request to the merge queue Sep 24, 2024
Merged via the queue into leanprover:master with commit a108644 Sep 24, 2024
13 checks passed
@TomasPuverle
Copy link
Contributor Author

🎉

@TomasPuverle TomasPuverle deleted the empty_json branch September 24, 2024 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants