Skip to content

Commit

Permalink
WIP: try to narrow down failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
monsterkrampe committed Jul 6, 2024
1 parent 35e4f2f commit f205324
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
2 changes: 2 additions & 0 deletions Qpf/Macro/Data.lean
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ def mkType (view : DataView) (base : Term × Term × Term) : CommandElabM Unit :
abbrev $baseIdent:ident $view.deadBinders:bracketedBinder* : TypeFun $(quote <| arity + 1) :=
$base

-- instance foo : MvFunctor.{0,0} ($baseApplied) := $functor
instance foo : MvFunctor.{1,1} ($baseApplied) := $functor
instance $baseFunctorIdent:ident : MvFunctor ($baseApplied) := $functor
instance $baseQPFIdent:ident : MvQPF ($baseApplied) := $q

Expand Down
35 changes: 21 additions & 14 deletions Test/Arrow.lean
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,24 @@ data Arrow (α : Type) β : Type u
/-- info: Arrow.Base : Type → TypeFun 2 -/
#guard_msgs in #check (Arrow.Base : Type → TypeFun.{u, u} 2)

#synth MvQPF (Arrow.Base _ : TypeFun.{0} 2)
-- ^^^ We know that the `Base` is a QPF for universe 0

#synth MvQPF (Arrow.Base _ : TypeFun.{1} 2)
-- ^^^ But, somehow we can't synthesize this fact for higher universes

#check (Arrow.Uncurried : Type → TypeFun.{1} 1)
-- ^^^ Which, presumably, is why `Uncurried` is *not* polymorphic



/-- info: Arrow : Type → CurriedTypeFun 1 -/
#guard_msgs in
#check (Arrow : TypeType u → Type u)
#synth MvFunctor (Arrow.Base.{0} _)
-- ^^^ This works
#synth MvFunctor (Arrow.Base.{1} _)
-- ^^^ but this already does not, which explains the issues below
-- If we add instance foo : MvFunctor.{1,1} ($baseApplied) := $functor to Qpf/Macro/Data.lean explicitely,
-- it seems to work but it produces a weird type error.

-- #synth MvQPF (Arrow.Base _ : TypeFun.{0} 2)
-- -- ^^^ We know that the `Base` is a QPF for universe 0
--
-- #synth MvQPF (Arrow.Base _ : TypeFun.{1} 2)
-- -- ^^^ But, somehow we can't synthesize this fact for higher universes
--
-- #check (Arrow.Uncurried : Type → TypeFun.{1} 1)
-- -- ^^^ Which, presumably, is why `Uncurried` is *not* polymorphic
--
--
--
-- /-- info: Arrow : Type → CurriedTypeFun 1 -/
-- #guard_msgs in
-- #check (Arrow : Type → Type u → Type u)

0 comments on commit f205324

Please sign in to comment.