Skip to content

Commit

Permalink
feat: add the ability to access the uncurried base
Browse files Browse the repository at this point in the history
  • Loading branch information
William Sørensen committed Aug 16, 2024
1 parent 393d5e2 commit 3a2949e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Qpf/Macro/Data.lean
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ def isPolynomial (view : DataView) (F: Term) : CommandElabM (Option Term) := do
def mkType (view : DataView) (base : Term × Term × Term) : CommandElabM Unit := do
trace[QPF] "mkType"
let uncurriedIdent ← addSuffixToDeclIdent view.declId "Uncurried"
let baseIdent ← addSuffixToDeclIdent view.declId "Base"
let baseIdExt ← addSuffixToDeclIdent view.declId "Base"
let baseIdent ← addSuffixToDeclIdent baseIdExt "Uncurried"
let baseFunctorIdent ← addSuffixToDeclIdent baseIdent "instMvFunctor"
let baseQPFIdent ← addSuffixToDeclIdent baseIdent "instQPF"

Expand All @@ -430,6 +431,9 @@ def mkType (view : DataView) (base : Term × Term × Term) : CommandElabM Unit :
abbrev $baseIdent:ident $view.deadBinders:bracketedBinder* : TypeFun $(quote <| arity + 1) :=
$base

abbrev $baseIdExt $view.deadBinders:bracketedBinder*
:= TypeFun.curried $baseApplied

instance $baseFunctorIdent:ident : MvFunctor ($baseApplied) := $functor
instance $baseQPFIdent:ident : MvQPF ($baseApplied) := $q

Expand Down

0 comments on commit 3a2949e

Please sign in to comment.