Is it possible to have Ad-Hoc polymorphism with runtime dispatch?
As I did understand, and as it’s described here, ad-hoc polymorphism is limited to compile-time dispatch. That is, if we have a function that expects an argument that belongs to a typeclass, we must know the concrete type of the argument at compile time to be able to use this function.
Proper use of typeclasses
I’m trying Haskell’s Gloss module, and I found a a pattern of things required to properly display an object: Its position, dimensions, scale and Picture representation. This seemed like a good use case of typeclasses, so I wrote this up:
Using Haskell type classes to enforce commutativity
I want to define a type class for geometric objects that can be intersected together:
Using Haskell type classes to enforce commutativity
I want to define a type class for geometric objects that can be intersected together:
Using Haskell type classes to enforce commutativity
I want to define a type class for geometric objects that can be intersected together: