OCaml lwt utop infix bind operator >>= is missing

625 Views Asked by At

I call require "lwt.simple-top" ;; on utop and try a simple example but it is not able to find the operator >>=.

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

The #require is a toplevel directive, that link the library code into the toplevel. It doesn't open any modules. So in order to get the infix operators >>= and >|=, you need to open Lwt.Infix or Lwt modules, the latter will also bring all definitions from Lwt module, that may be considered as a namespac pollution.