lean4-htt/tests/lean/run/Reid1.lean
Leonardo de Moura e4a3b434d7 chore: moving tests to new frontend
@Kha The transition has begun :)
I found and fixed a few bugs, but it is going well so far.
2020-09-10 18:00:34 -07:00

29 lines
701 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

new_frontend
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