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

Allow patterns in function params and add hints on shape coercion #67

Merged
merged 5 commits into from
Jul 11, 2023

Conversation

fizruk
Copy link
Member

@fizruk fizruk commented Jul 11, 2023

  • Allow patterns in function types, e.g. ((x, y) : I * J) -> C x y
  • Use shape types with parentheses (instead of braces)
    • in function types, e.g. ((t, s) : I * J | psi t /\ phi s) -> X t s
    • in parameters and lambda arguments
  • Deprecate braces
    • in function types, e.g. {a : A} -> B a

    • in functions from shapes:

      [DEPRECATED]: at line 187 column 9
      the following notation is deprecated and will be removed from future version of rzk:
        { (t : I) | ϕ t \/ ψ t } → U
      instead consider using the following notation:
        (t : I | ϕ t \/ ψ t) → U
      
    • in parameters and lambda arguments

  • Hints for shape coercions
    • in function types, e.g.

      [HINT]: consider replacing
        (s : J | ζ s) → X t s [χ s |-> f (t, s)]
      with the following
        (s : ζ) → X t s [χ s |-> f (t, s)]
      
    • in params and lambdas, e.g.

      [HINT]: at line 34 column 6 consider replacing
        \ (t : 2 | Δ¹ t) → t === 0_2 \/ t === 1_2
      with the following
        \ (t : Δ¹) → t === 0_2 \/ t === 1_2
      

The fix allows arbitrary terms in function types, and converts terms to patterns.

Note that parameters are desugared before hints/deprecations are checked, so messages do not correspond well to input (yet).

@fizruk fizruk changed the title Allow patterns in dependent function types Allow patterns in function params and add hints on shape coercion Jul 11, 2023
@fizruk fizruk merged commit d34e105 into develop Jul 11, 2023
@fizruk fizruk deleted the fix-param-patterns branch July 11, 2023 21:28
@fizruk fizruk mentioned this pull request Jul 12, 2023
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.

1 participant