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 mode to forward stdin and stdout to RunIO scripts #78

Merged
merged 3 commits into from
Dec 11, 2024
Merged

Conversation

Lysxia
Copy link
Owner

@Lysxia Lysxia commented Dec 9, 2024

Close #76

(* cat.v *)
From SimpleIO Require Import SimpleIO.
Import IO.Notations.
RunIO IOMode Forward.
Definition cat : IO unit :=
  _ <- catch_eof
    (IO.fix_io (fun f _ =>
      input <- read_line ;;
      print_endline input ;;
      f tt :> IO unit) tt) ;;
  IO.ret tt.
RunIO cat.
echo "foo" | coqc cat.v

cc @zacque0

@liyishuai
Copy link
Collaborator

liyishuai commented Dec 10, 2024

@liyishuai liyishuai merged commit 59ca9ed into master Dec 11, 2024
11 checks passed
@liyishuai liyishuai deleted the iomode branch December 11, 2024 05:33
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.

Non-terminating read_line from the command line
2 participants