Basically my question is: what happens when one does
ignore (x : 'a Lwt.t)
I am writing a logging module, and I want it to be able to send messages through a Lwt_pipe and to stdout at the same time, e.g.
let pipe = Lwt_pipe.create ~max_size:1000 () in let log s = Lwt_io.write Lwt_io.stdout s <&> Lwt_pipe.write_exn pipe s
but most of the time I call the log function, I am not inside of a Lwt context, so that the returned
unit Lwt.t is ignored.
This seems to works (surprisingly) quite well, but I don’t understand why. Is there anything I am missing here ? (in the context where I have tested is, the program’s main loop is Lwt).