Skip to content

Instantly share code, notes, and snippets.

View hg1112's full-sized avatar
🎯
Focusing

Harish Gontu hg1112

🎯
Focusing
View GitHub Profile
@BalmungSan
BalmungSan / Polymorphism.md
Last active January 7, 2024 18:41
Polymorphism in Scala.

Polymorphism in Scala.

This document aims to show and compare three alternatives for achieving polymorphism in Scala.

  • Subtyping, common in object-oriented languages like Java.
  • Duck typing, common in dynamically typed languages like Python.
  • Typeclasses, common in functional languages like Haskell.

Additionally, when implementing the typeclass pattern in Scala,