Advanced Types
Motoko has a modern type system that allows us to write powerful, yet concise code. In this chapter we will look at several features of Motoko's type system.
Understanding Motoko's type system is essential when we write code that is more sophisticated than what we have done up to this point.
- Generic types are widely used in types declarations, functions and classes inside modules of the Base Library.
- Subtyping is useful when we want to develop actor interfaces that remain backwards compatible with older versions.
- Recursive types are powerful when defining core data structures.