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

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.

主站蜘蛛池模板: 台中市| 楚雄市| 曲阳县| 朝阳区| 曲麻莱县| 宣汉县| 高唐县| 阜阳市| 隆化县| 康定县| 和平区| 府谷县| 德庆县| 西丰县| 彰化县| 郸城县| 河北区| 闸北区| 会东县| 乡宁县| 固阳县| 罗源县| 莱西市| 贞丰县| 万全县| 肥东县| 黑水县| 柯坪县| 大城县| 黑河市| 建平县| 定陶县| 从化市| 丰都县| 营山县| 连云港市| 开平市| 洞口县| 甘南县| 兴山县| 磴口县|