Appendix D. Type classes
D.1 Polymorphism
Object-oriented languages use the type system to represent inheritance hierarchies by subtyping classes or interfaces. The use of subtypes is a technique that brings a level of flexibility when we design our programs. Subtyping also goes by the name polymorphism. The word polymorphic implies that something may take on multiple forms. In the context of computer science, it can be defined as follows:
Polymorphism provides a single interface to entities of different types or a single symbol to represent multiple different types.
Functional programming also has a concept called polymorphism, but we are less concerned with classes to bring flexibility to our design. Instead of classic polymorphism, we use ...
Get Functional Programming in Kotlin now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.