Dotty Type classes

I would like to add that I think it would be very very nice to support what Rust calls “trait objects” which are basically the typeclass version of dynamic dispatch. That is, I think we should have the ability to deal with collections of data which all have a typeclass instance, where each element may have a different underlying typeclass instance (rather than all elements having the same typeclass instance). See this discussion for further motivation.

3 Likes