mirror of
https://github.com/leanprover/lean4.git
synced 2026-03-17 18:34:06 +00:00
This PR sets up the new integrated test/bench suite. It then migrates all benchmarks and some related tests to the new suite. There's also some documentation and some linting. For now, a lot of the old tests are left alone so this PR doesn't become even larger than it already is. Eventually, all tests should be migrated to the new suite though so there isn't a confusing mix of two systems.
30 lines
666 B
Lean4
30 lines
666 B
Lean4
/-!
|
|
# Validation of `Repr Empty` instance
|
|
|
|
While it may seem unnecessary to have Repr, it prevents the automatic derivation
|
|
of Repr for other types when `Empty` is used as a type parameter.
|
|
|
|
This is a simplified version of an example from the "Functional Programming in Lean" book.
|
|
The Empty type is used to exclude the `other` constructor from the `Prim` type.
|
|
-/
|
|
|
|
inductive Prim (special : Type) where
|
|
| plus
|
|
| minus
|
|
| other : special → Prim special
|
|
deriving Repr
|
|
|
|
/-!
|
|
Check that both Repr's work
|
|
-/
|
|
|
|
/-- info: Prim.plus -/
|
|
#guard_msgs in
|
|
open Prim in
|
|
#eval (plus : Prim Int)
|
|
|
|
/-- info: Prim.minus -/
|
|
#guard_msgs in
|
|
open Prim in
|
|
#eval (minus : Prim Empty)
|