13 ms·
> modules are worst I think the opposite, modules are vastly superior to typeclasses in regards to, well, modularity. > In Haskell, the type class database is
by ernst_klim 3y ago
> modules are worst
I think the opposite, modules are vastly superior to typeclasses in regards to, well, modularity.
> In Haskell, the type class database is global and there is no duplication.
That's not a bug, but a feature of module system.
> This lets you naturally compose implementations: for example, you can make it so that if a type A implements the equality type class Eq, and a type B also implements Eq, then the tuple (A, B) implements Eq in the obvious way.
Unless you want a totally different ordering for A, which happens a lot in programming and even in math, where you can define many groups for the same set.
https://existentialtype.wordpress.com/2011/04/16/modules-matter-most/ https://existentialtype.wordpress.com/2011/04/16/modules-mat...