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 do notation #2937

Merged
merged 7 commits into from
Aug 21, 2024
Merged

Add do notation #2937

merged 7 commits into from
Aug 21, 2024

Conversation

janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Aug 6, 2024

Example:

minusOne : Nat -> Maybe Nat
  | zero := nothing
  | (suc n) := just n;


minusThree (n : Nat) : Maybe Nat :=
  do {
    x1 <- minusOne n;
    x2 <- minusOne x1;
    let
      x2' : Nat := x2;
    in
    x3 <- minusOne x2';
    pure x3;
  };

@janmasrovira janmasrovira added enhancement New feature or request syntax labels Aug 6, 2024
@janmasrovira janmasrovira self-assigned this Aug 6, 2024
@janmasrovira janmasrovira linked an issue Aug 6, 2024 that may be closed by this pull request
@janmasrovira janmasrovira force-pushed the 2355-add-do-notation branch 4 times, most recently from 59b2da2 to 1bb0aa5 Compare August 9, 2024 16:10
@janmasrovira janmasrovira force-pushed the 2355-add-do-notation branch 2 times, most recently from d5bf5bc to 44466e9 Compare August 14, 2024 21:21
@janmasrovira janmasrovira marked this pull request as ready for review August 14, 2024 21:30
Copy link
Collaborator

@paulcadman paulcadman left a comment

Choose a reason for hiding this comment

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

🌯

@janmasrovira janmasrovira merged commit eb0922a into main Aug 21, 2024
4 checks passed
@janmasrovira janmasrovira deleted the 2355-add-do-notation branch August 21, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request syntax
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add do-notation
2 participants