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

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
主站蜘蛛池模板: 瓮安县| 津南区| 桃园县| 无棣县| 古蔺县| 通山县| 兰溪市| 温泉县| 宁蒗| 琼海市| 建湖县| 仲巴县| 黑河市| 子洲县| 溧阳市| 石门县| 湖州市| 水城县| 正镶白旗| 布尔津县| 阳谷县| 潼关县| 南开区| 呼玛县| 监利县| 西林县| 米林县| 兴安盟| 邓州市| 广汉市| 莱西市| 昂仁县| 浦县| 临桂县| 渭南市| 柳江县| 虹口区| 墨江| 志丹县| 新密市| 邳州市|