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.
29 lines
689 B
Text
29 lines
689 B
Text
|
||
|
||
structure ConstantFunction (α β : Type) :=
|
||
(f : α → β)
|
||
(h : ∀ a₁ a₂, f a₁ = f a₂)
|
||
|
||
instance constFunCoe {α β : Type} : CoeFun (ConstantFunction α β) (fun _ => α → β) :=
|
||
{ coe := fun c => c.f }
|
||
|
||
def myFun {α : Type} : ConstantFunction α (Option α) :=
|
||
{ f := fun a => none,
|
||
h := fun a₁ a₂ => rfl }
|
||
|
||
def myFun' (α : Type) : ConstantFunction α (Option α) :=
|
||
{ f := fun a => none,
|
||
h := fun a₁ a₂ => rfl }
|
||
|
||
set_option pp.all true
|
||
|
||
#check myFun 3 -- works
|
||
#check @myFun Nat 3 -- works
|
||
|
||
#check myFun' _ 3 -- works
|
||
#check myFun' Nat 3 -- works
|
||
|
||
variable (c : ConstantFunction Nat Nat)
|
||
#check c 3 -- works
|
||
|
||
#check (fun c => c 3) myFun -- works
|