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 a lazy IO sequencing function (#1772) #1773

Closed
jonaprieto opened this issue Jan 27, 2023 · 0 comments · Fixed by #1812
Closed

Add a lazy IO sequencing function (#1772) #1773

jonaprieto opened this issue Jan 27, 2023 · 0 comments · Fixed by #1812
Assignees
Labels
enhancement New feature or request priority:low

Comments

@jonaprieto
Copy link
Collaborator

jonaprieto commented Jan 27, 2023

It would be beneficial in some cases to consider a lazy version of the sequencing operator (>>) to not lose some output/precomputations in case the program crashes. For example, assuming there exists a "fail" function (PR #1771 ). Currently, we only get the error message "Something's wrong", where one could have been interested in seeing the output "Answer" as well.

module builtinFail;
  open import Stdlib.Prelude;

  builtin fail axiom fail : {A : Type}  String  A;

  main : IO;
  main := printStringLn "Answer"
    >> fail "Something's wrong";
end;
@jonaprieto jonaprieto added the enhancement New feature or request label Jan 27, 2023
@jonaprieto jonaprieto added this to the 0.3 - Valencia milestone Jan 27, 2023
@lukaszcz lukaszcz self-assigned this Feb 7, 2023
lukaszcz added a commit that referenced this issue Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:low
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants