Skip to content

Eta conversion for functions#60

Merged
diode-lang merged 34 commits intomainfrom
eta-equality
Feb 3, 2026
Merged

Eta conversion for functions#60
diode-lang merged 34 commits intomainfrom
eta-equality

Conversation

@diode-lang
Copy link
Collaborator

@diode-lang diode-lang commented Jan 26, 2026

This pull request adds eta-equality for functions to Agda Core and is partial work for #34.

It adds:

  • A bugfix in ToCore.hs which meant that any .agda programs with TData or TDef would previously crash. I'm still looking for a fix such that parameter lists and indices are correctly translated for TData
  • Untyped eta-conversion for functions in Conversion.agda and Converter.agda
  • Examples which require eta-conversion in the checker and which typecheck successfully EtaFunctionsChurch.agda

…d two more counterexamples for eta-functions ; spelling fixes
Copy link
Owner

@jespercockx jespercockx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! I have some small-ish formatting and style remarks but otherwise this looks good.

conversionProof <- convertCheck newScope b term
return (CEtaFunctions x functionTerm b conversionProof)
convertWhnf r a b = do
conversionProof <- convertCheck r b a
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't calling convertCheck here go into an infinite loop in case the two sides are not convertible? (Or at least, loop until the fuel is exhausted.) I don't think it's possible to have a generic catch-all case for symmetry like this in the conversion checker, we have to manually apply symmetry in the cases where it's needed.

eta-higher = λ A B C → λ f → refl

eta-counterexample-simple : addOne ≡ (λ x → (suc (const Nat x x)))
eta-counterexample-simple = refl No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again Github indicates there's a missing newline here.

@diode-lang diode-lang merged commit d5db732 into main Feb 3, 2026
4 checks passed
@diode-lang diode-lang deleted the eta-equality branch February 3, 2026 10:07
@jespercockx
Copy link
Owner

@diode-lang could you please not merge PRs when there are still open comments on it? In this case they were minor but in general it's better to wait. Also, I prefer rebases over merges. (I guess I should change the settings of this repo for both these things.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants