What are the reasons that protocols and multimethods in Clojure are less powerful for polymorphism than typeclasses in Haskell?
问题 More broadly this question is about various approaches to the expression problem. The idea is that your program is a combination of a datatype and operations over it. We want to be able to add new cases without recompiling the old classes. Now Haskell has some really awesome solutions to the expression problem with the TypeClass. In particular - we can do: class Eq a where (==) :: a -> a -> Bool (/=) :: a -> a -> Bool member :: (Eq a) => a -> [a] -> Bool member y [] = False member y (x:xs) =