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

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
主站蜘蛛池模板: 天门市| 阿拉善左旗| 丰镇市| 蒙阴县| 饶阳县| 布拖县| 安阳市| 烟台市| 无锡市| 庆城县| 醴陵市| 汤阴县| 庆安县| 临猗县| 宁远县| 丰镇市| 陇西县| 辉县市| 如皋市| 大洼县| 武强县| 江陵县| 永胜县| 八宿县| 泾阳县| 木里| 河北区| 曲水县| 沧源| 金川县| 蕲春县| 永丰县| 永泰县| 白山市| 定襄县| 崇州市| 彭泽县| 正蓝旗| 堆龙德庆县| 陆丰市| 修水县|