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

Understanding Types in Scala

The strong type system is one of the most important parts of the Scala language. Like a double-edged sword, it helps the compiler to verify and optimize the code on one side, while at the same time guiding developers toward possible correct implementations and preventing them from making programming mistakes on another side. As with any sharp tool, it requires some skill so that it can be used for carving beautiful source code without cutting the user in the process.

In this chapter, we will improve this skill by recapping and summarizing basic type-related knowledge, taking a look at a new type that was introduced in Scala 2.13, and finally looking at some advanced usages of types.

The following topics will be covered in this chapter:

  • Different ways to create a type
  • Different ways to parameterize a type
  • Kinds of types
  • Using types to express domain constraints
主站蜘蛛池模板: 沁源县| 衡水市| 稷山县| 河东区| 崇明县| 凤凰县| 收藏| 盱眙县| 涡阳县| 永新县| 大英县| 毕节市| 林芝县| 阳原县| 惠安县| 吉水县| 淅川县| 洞口县| 淮南市| 长兴县| 孟州市| 湛江市| 亳州市| 顺平县| 女性| 青铜峡市| 海安县| 孙吴县| 怀来县| 辽宁省| 麻城市| 镶黄旗| 寿宁县| 西青区| 宝兴县| 勃利县| 汕头市| 个旧市| 左权县| 定远县| 望城县|