AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
Is Type Classes Ad Hoc Polymorphism?
type classes allow you to have the same external behavior for many different data types. You can compose a new data structure that's array plus a type class or something like that. But inheritance ultimately is just fancy composition. Yeah. Or dangerous composition depending on your. So, but is type classes generally the way to kind of add behavior to, to data structures? Yes. And then someone can extend their data structure, implement your interface as well.