Unbound module Lwt.Infix

I am completely baffled by this error:

 rm -rf _build; dune build; echo "==============="; cat lib/dune ; echo "=========="; head -n 5 lib/h_client.ml 
File "lib/h_client.ml", line 3, characters 5-14:
3 | open Lwt.Infix;;
         ^^^^^^^^^
Error: Unbound module Lwt.Infix
===============                     
(library
  (name my_web)
  (modes byte)
  (preprocess (pps ppx_jane))
  (libraries 
    httpaf httpaf-lwt-unix 
    re stdio base 
    lwt lwt.unix 
    core core_unix core_unix.sys_unix 
    ))


==========
open Base;;
open Lwt;;
open Lwt.Infix;;

open Httpaf

I don’t understand why it can’t open Lwt.Infix, when I clearly have lwt installed.

which version of Lwt do you have?

I created a file lib/lwt.ml . It was meant to contain code snippets as I work through the lwt documentation. Guess what “open Lwt.Infix” tried to refer to :slight_smile:

1 Like