An important principle of good code design is to avoid repetition and it is known as do not repeat yourself (DRY).
Ad Hoc Polymorphism:
Ad Hoc Polymorphism is utilizing a possibly different implementations based on Types.
- Implement Type Class Pattern using Scala.
- Implement Type Class Pattern using Simulacrum.