lean4-htt/src/Lean/Data/Json
TomasPuverle a108644461
feat: implement To/FromJSON Empty (#5421)
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
https://github.com/leanprover/lean4/pull/5415, as suggested by
@eric-wieser. It expands on the original suggestion by also handling
`FromJSON`.

---------

Co-authored-by: Kyle Miller <kmill31415@gmail.com>
2024-09-24 03:27:23 +00:00
..
Basic.lean chore: avoid importing List.Basic without List.Impl (#5245) 2024-09-04 01:25:50 +00:00
Elab.lean chore: add missing copyright headers (#3411) 2024-02-20 01:49:55 +00:00
FromToJson.lean feat: implement To/FromJSON Empty (#5421) 2024-09-24 03:27:23 +00:00
Parser.lean fix: ilean loading performance (#4900) 2024-08-29 11:51:48 +00:00
Printer.lean perf: reduce allocations in Json.compress (#5222) 2024-09-04 19:52:10 +00:00
Stream.lean feat: UTF-8 string validation (#3958) 2024-04-20 18:36:37 +00:00