在 ReasonML 中为导入的模块使用自定义名称

Use custom name for imported module in ReasonML

在 Python 中,我可以使用 import somemodule as foo 以便在您的脚本中为外部模块使用自定义名称。

如何在 ReasonML 中完成此操作,例如,如果我想将 ReasonReact 导入为 React

模块别名对此很方便:

module React = ReasonReact;

这与 import 的细微差别在于它不仅会将模块绑定到一个新名称供内部使用,还会将其导出,除非您限制使用接口文件(或模块签名,如果在子模块中使用)。

Documentation