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

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.

主站蜘蛛池模板: 长阳| 措美县| 山东省| 铜陵市| 海伦市| 图们市| 冕宁县| 阆中市| 榆林市| 梁平县| 茂名市| 治多县| 永顺县| 巨野县| 铜梁县| 博白县| 上饶市| 浙江省| 宁远县| 韶关市| 卓资县| 柳州市| 莱州市| 松溪县| 宁强县| 潮安县| 安阳市| 修水县| 津市市| 任丘市| 原阳县| 迭部县| 伊金霍洛旗| 商南县| 翼城县| 茌平县| 呼图壁县| 玉山县| 长子县| 武汉市| 鞍山市|