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

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.

主站蜘蛛池模板: 福安市| 洛扎县| 衡东县| 韶关市| 伊春市| 肇庆市| 平凉市| 永寿县| 商丘市| 邵阳市| 建宁县| 博爱县| 宣汉县| 阿城市| 太谷县| 进贤县| 杂多县| 大竹县| 龙游县| 松桃| 曲靖市| 阿拉善右旗| 珠海市| 元氏县| 达拉特旗| 故城县| 来宾市| 都兰县| 古交市| 田林县| 出国| 汾西县| 吉安市| 兰州市| 永年县| 五常市| 秦安县| 措美县| 全椒县| 抚顺县| 凤山县|