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

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.

主站蜘蛛池模板: 伊宁市| 武冈市| 师宗县| 巢湖市| 华亭县| 新安县| 石台县| 麦盖提县| 临江市| 彭州市| 久治县| 塘沽区| 集安市| 长垣县| 青川县| 马山县| 银川市| 武川县| 翁牛特旗| 南京市| 东丰县| 吴桥县| 古交市| 新竹市| 彭阳县| 香港| 盱眙县| 青龙| 馆陶县| 靖边县| 洮南市| 新和县| 全州县| 商河县| 大洼县| 措勤县| 乌苏市| 即墨市| 甘谷县| 绥滨县| 和平县|