Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add the ability to access the uncurried base #37

Merged
merged 3 commits into from
Aug 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading