© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
D. YangIntroducing ReScripthttps://doi.org/10.1007/978-1-4842-8888-7_7

7. Modules

Danny Yang1  
(1)
Mountain View, CA, USA
 

Modules are groupings of functions and type definitions that allow us to organize and reuse code in complex programs. Every file in ReScript is its own module, but we can also define our own modules inside of files.

Modules and module signatures are very important for writing software in ReScript, because they serve several key purposes:
  • Namespacing – Modules allow the programmer to differentiate between functions/bindings with the same name declared in different places (e.g., Belt.Array.map, Js.Array2.map, Js.Array.map). This allows the ...

Get Introducing ReScript: Functional Programming for Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.