官术网_书友最值得收藏!

Packaging Types and Values Together

ReasonML has fantastic support for the software engineering practice of dividing programs into small, modular components that can be swapped out for each other.

In this chapter, we will cover:

  • Modules and how they can be used to package types and values together
  • The difference between file modules and syntactic modules
  • Module signatures (both file and syntactic)
  • Using signatures to achieve information hiding
  • Using signatures to achieve type abstraction
  • Achieving zero-cost abstraction

Modules are groups of types and values accessible under a single name. This can be incredibly useful when you want to associate some types and operations together to make them easier to find and use together. They are kind of like namespaces in other languages, but more powerful because they can be composed in various ways.

Let's look at how to make some modules.

主站蜘蛛池模板: 富阳市| 莱芜市| 大余县| 璧山县| 资兴市| 黄山市| 全椒县| 富平县| 绵阳市| 三明市| 长武县| 石城县| 南和县| 旌德县| 西宁市| 鄢陵县| 石屏县| 宜州市| 兴安盟| 南乐县| 齐河县| 通许县| 岑溪市| 读书| 中牟县| 眉山市| 大方县| 墨竹工卡县| 微山县| 儋州市| 汝城县| 汝阳县| 英德市| 隆昌县| 邵东县| 鄄城县| 冀州市| 枣强县| 禄丰县| 赣榆县| 安新县|