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

add Bool.elim #996

Merged
merged 1 commit into from
Jun 1, 2023
Merged

add Bool.elim #996

merged 1 commit into from
Jun 1, 2023

Conversation

maxsnew
Copy link
Collaborator

@maxsnew maxsnew commented Mar 9, 2023

I.e., the dependent version of if_then_else_

@felixwellen
Copy link
Collaborator

I think a slightly better place for Bool.elim is Cubica.Data.Bool.Properties (unfortunately, we are not really consistent with this). That hopefully makes it also easier to solve name conflicts.

@maxsnew
Copy link
Collaborator Author

maxsnew commented Mar 9, 2023

Fixed now, following @felixwellen 's suggestion

@laMudri
Copy link

laMudri commented Mar 9, 2023

Is there something to be said about signalling the order of the arguments? I guess it matters less for the dependent eliminator.

@maxsnew
Copy link
Collaborator Author

maxsnew commented Mar 10, 2023

If we're going to go full bikeshed on this:

  1. Having true first matches if_then_else_ which is the non-dependent version of the same function
  2. Having false first would sort of match Nat.elim if we think false would correspond to 0 and true would correspond to 1.

I think having it match if_then_else_ is probably more intuitive and as you say the dependent type will turn most mistakes into type errors anyway. And I think calling it elim is good for consistency/discoverability because it matches Data.Sum/Data.Nat etc

@felixwellen
Copy link
Collaborator

I agree with the reasoning on the order and it looks all good to me -> merging soon.

@felixwellen felixwellen self-assigned this Jun 1, 2023
@felixwellen felixwellen merged commit f406132 into agda:master Jun 1, 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.

3 participants