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

Nat generics #54

Merged
merged 4 commits into from
Jan 30, 2025
Merged

Nat generics #54

merged 4 commits into from
Jan 30, 2025

Conversation

utkn
Copy link
Contributor

@utkn utkn commented Jan 29, 2025

This PR aims to extend the generics to support numerics. Most of the changes are in Syntax.lean.

At Lean side, generics can be declared as numeric with the # prefix, as shown in the following example:

nr_def create_arr<#N>() -> [Field; N] {
  [1 : Field ; N]
}

@utkn utkn marked this pull request as ready for review January 29, 2025 18:49
@utkn utkn requested a review from mpenciak January 29, 2025 18:49
@utkn utkn added this to the Milestone 1 milestone Jan 29, 2025
Copy link
Contributor

@mpenciak mpenciak left a comment

Choose a reason for hiding this comment

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

Looks good.

Good catch on str<N> and fmtstr<N,...>, I overlooked that strings could take const generics as length parameters.

@utkn utkn merged commit 5858efb into main Jan 30, 2025
6 checks passed
@utkn utkn deleted the us/nat-generics branch January 30, 2025 14:48
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