0

I have the following code in OCaml:

open Lwt
open Lwt_term

let () = Lwt_main.run (
  lwt l = Lwt_read_line.read_line ~prompt:[text "foo> "] ())

when I try to compile using

ocamlfind ocamlc -package lwt cli.ml - o cli.byte

it I get the following error:

File "cli.ml", line 2, characters 0-13:
Error: Unbound module Lwt_term

I know it's unrelated to the problem above, but from utop I can open Lwt but I still can't open Lwt_term. What am I doing wrong?

Sergi Mansilla
  • 12,495
  • 10
  • 39
  • 48

2 Answers2

0

Source file is located there so I bet that you need lwt.text package

Kakadu
  • 2,837
  • 19
  • 29
0

Not really a real answer to the original question, but I have ended up using Core to accomplish it. The enlightenment came from finding the readline_test.ml file in a tests folder in the Core library (https://github.com/janestreet/core_extended/blob/master/lib_test/readline_test.ml).

Following that example it was really easy to implement readline-like functionality.

Sergi Mansilla
  • 12,495
  • 10
  • 39
  • 48