File: main.v

package info (click to toggle)
coq-simple-io 1.11.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 380 kB
  • sloc: ml: 273; makefile: 66
file content (14 lines) | stat: -rw-r--r-- 268 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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.