in this piece of code:
let rec write_from_exactly out s offs len =
Lwt_unix.write out s offs len >>= fun n ->
if n = len then Lwt.return ()
else write_from_exactly out s (offs + n) (len - n)
in ...
Although I can more or less guess what it does, I couldn't find any official definition on what ">>=" means and how it works.
The symbol >>= is defined by Lwt, not by OCaml itself. It's an infix operator equivalent to bind. You can see the definition of bind in Lwt's documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With