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

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
主站蜘蛛池模板: 剑河县| 龙海市| 汉源县| 龙陵县| 长乐市| 霍城县| 响水县| 嵩明县| 景宁| 和平区| 长汀县| 西贡区| 嘉峪关市| 南木林县| 新晃| 琼中| 庆云县| 通州区| 叙永县| 鄂托克前旗| 秭归县| 鹿邑县| 昭平县| 定陶县| 福建省| 郴州市| 咸宁市| 民权县| 瑞丽市| 青冈县| 鄂伦春自治旗| 于都县| 南皮县| 鱼台县| 濉溪县| 连江县| 娄烦县| 灵台县| 江口县| 云龙县| 衢州市|