This script simulates IO (print and input) in a pure functional manner using a coinductive data structure.
Python-compatible generator:
Generator yield send return = βstate . state Γ (state β return + yield Γ (send β state))
With the point functor: