gpt4 book ai didi

ocaml - 尝试通过 Lwt 教程,但似乎存在库问题

转载 作者:行者123 更新时间:2023-12-02 07:10:58 31 4
gpt4 key购买 nike

我在通过 Godi 安装的 Ubuntu 上运行 Ocaml 3.12。

我正在浏览 Lwt tutorial .我已经启动了顶层并完成了(按照指示):

# #use "topfind";;
# #require "lwt";;

“lwt”的要求似乎是成功的(没有关于找不到它的提示)。然后稍后我尝试:

# Lwt_io.read_char;;

顶层提示:

# Error: Reference to undefined global `Lwt_io'

当我查看 ~/godi-3.12/lib/ocaml/pkg-lib/lwt 时,我看到存在 lwt_io.cmi 和 lwt_io.mli 文件。 godi 说我安装了 2.2.1 版的 lwt。

我也试过运行 lwt-toplevel,但无法输入任何内容...

最佳答案

Lwt_io 模块属于 lwt.unix 子包。使用它:

#require "lwt.unix";;

关于ocaml - 尝试通过 Lwt 教程,但似乎存在库问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5923788/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com