Definition getchar_spec :=
WITH k : int -> IO_itree
PRE [ ]
PROP ()
LOCAL ()
SEP (ITREE (r <- read ;; k r))
POST [ tint ]
EX i : int,
PROP (- two_p 7 <= Int.signed i <= two_p 7 - 1)
LOCAL (temp ret_temp (Vint i))
SEP (ITREE (k i)).
Fixpoint write_list l : IO_itree :=
match l with
| nil => Ret tt
| c :: rest => write c ;; write_list rest
end.

Lemma ITREE_ext : forall tr tr', eq_utt tr tr' ->
ITREE tr = ITREE tr'.