('a -&gt; 'b) -&gt; 'a io -&gt; 'b io = &lt;fun&gt;

# let flat_map (f: 'a -&gt; 'b io) (x: 'a io): 'b io =
  fun cb -&gt; x (fun value -&gt; (f value) (fun value2 -&gt; cb value2));;
val flat_map : ('a -&gt; 'b io) -&gt; 'a io -&gt; 'b io = &lt;fun&gt;

# let (&gt;&gt;=) a b = flat_map b a;;
val ( &gt;&gt;= ) : 'a io -&gt; ('a -&gt; 'b io) -&gt; 'b io = &lt;fun&gt;

# let (&gt;=&gt;) f g a = f a &gt;&gt;= g;;
val ( &gt;=&gt; ) : ('a -&gt; 'b io) -&gt; ('b -&gt; 'c io) -&gt; 'a -&gt; 'c io = &lt;fun&gt;

# 