Reputation: 53763
In Python I can use import somemodule as foo
in order to use custom names for external modules in your scripts.
How can this be done in ReasonML, for example if I want to import ReasonReact
as React
?
Upvotes: 2
Views: 446
Reputation: 29106
Module aliases are handy for this:
module React = ReasonReact;
This differs subtly from import
in that it will not just bind the module to a new name for internal use, but also export it unless you restrict what's exported with an interface file (or a module signature if used in a submodule).
Upvotes: 6