- Learning Scala Programming
- Vikash Sharma
- 132字
- 2025-04-04 17:32:11
Type is the core
In the early days (great, if even in the present) you may have come across this:
f : R -> N
This is the mathematical representation of a function. This is how we denote any function f's domain and co-domains. In this case a function, f maps values from a set of real numbers to a set of natural numbers. With this deep abstraction level, you can think of Scala's rich type system. Some of the numerous types available are parameterized, structural, compound, existential, path-dependent, higher-kinded, and yes, we are discussing abstract types. An explanation of all these is beyond the scope of this book. But if you're curious, you may refer to Scala documentation at https://www.scala-lang.org/documentation/. Knowledge of these helps a lot when designing frameworks or libraries.