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

Irrefutable Lambda #1283

Merged
merged 17 commits into from
Jan 20, 2025
Merged

Irrefutable Lambda #1283

merged 17 commits into from
Jan 20, 2025

Conversation

HoshinoTented
Copy link
Contributor

@HoshinoTented HoshinoTented commented Jan 16, 2025

This PR fixes #94 by:

  • AyaProducer producing Expr.IrrefutableLam
  • Desugar Expr.IrrefutableLam to Expr.Lambda

TODO:

  • producer
  • question: should we resolve Expr.Lambda even if it is a desugar output?

@ice1000
Copy link
Member

ice1000 commented Jan 16, 2025

  • question: should we resolve Expr.Lambda even if it is a desugar output?

Desugar happens after resolving so this should be not applicable

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 14 lines in your changes missing coverage. Please review.

Project coverage is 83.38%. Comparing base (858c1d6) to head (bbf7086).
Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
...ax/src/main/java/org/aya/syntax/concrete/Expr.java 50.00% 5 Missing and 1 partial ⚠️
...ase/src/main/java/org/aya/resolve/salt/Desalt.java 80.00% 2 Missing and 1 partial ⚠️
...ain/java/org/aya/resolve/visitor/ExprResolver.java 50.00% 1 Missing ⚠️
...er/src/main/java/org/aya/producer/AyaProducer.java 93.33% 0 Missing and 1 partial ⚠️
...src/main/java/org/aya/syntax/concrete/Pattern.java 66.66% 1 Missing ⚠️
...tax/src/main/java/org/aya/syntax/ref/LocalVar.java 0.00% 1 Missing ⚠️
...in/java/org/aya/util/error/PosedUnaryOperator.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1283      +/-   ##
============================================
- Coverage     83.41%   83.38%   -0.04%     
- Complexity     4228     4239      +11     
============================================
  Files           385      385              
  Lines         12243    12289      +46     
  Branches       1411     1418       +7     
============================================
+ Hits          10213    10247      +34     
- Misses         1282     1291       +9     
- Partials        748      751       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HoshinoTented
Copy link
Contributor Author

HoshinoTented commented Jan 17, 2025

How about the interaction with pushing pattern from lambda in pattern matching? i.e.:

def what (A : Type) (n : Nat)
| A => fn zero => ...
| A => fn suc n => ...

becomes

def what (A : Type) (n : Nat)
| A, zero => ...
| A, suc n => ...

This may require the desugar in tyck rather than just after resolving.

@HoshinoTented HoshinoTented marked this pull request as ready for review January 17, 2025 12:42
@ice1000
Copy link
Member

ice1000 commented Jan 20, 2025

How about the interaction with pushing pattern from lambda in pattern matching? i.e.:

def what (A : Type) (n : Nat)
| A => fn zero => ...
| A => fn suc n => ...

becomes

def what (A : Type) (n : Nat)
| A, zero => ...
| A, suc n => ...

This may require the desugar in tyck rather than just after resolving.

🤯🤯🤯.... I think it's ok to not implement this feature. It's unreasonably complicated. Pushing lambda was meant to be a simple feature

@ice1000 ice1000 added this to the v0.38 milestone Jan 20, 2025
@ice1000 ice1000 merged commit 32ac332 into main Jan 20, 2025
4 of 6 checks passed
@ice1000 ice1000 deleted the irrefutable-pat branch January 20, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Irrefutable patterns in lambda
2 participants