3 ms·
I mean... you're right, you are using modules to do what you get from classes in other languages. So what? You say this like it's a bad thing, it's not, it's
by calambrac 18y ago
I mean... you're right, you are using modules to do what you get from classes in other languages. So what? You say this like it's a bad thing, it's not, it's just how this particular problem is solved in Haskell. Different != Horrible. I would argue it's actually a little bit more elegant, in that it takes a problem (namespacing) and solves it one way (modules), rather than having some hybrid package/class system.
I'm interested to see the examples you've seen for other languages that do address large programs. I've personally not come across many "How to write Firefox in Python"-style tutorials.
- anamax 18y ago> I mean... you're right, you are using modules to do what you get from classes in other languages. So what? My point is that languages that have classes also seem to need modules. Do haskell's modules address the problems that addressed by the combination of classes and modules in other languages? Does Haskell somehow avoid those problems? Is there some other mechanism? > I'm interested to see the examples you've seen for other languages that do address large programs. Examples of modules can be trivial yet demonstrate why modules might be useful for large programs.
- calambrac 18y agoHaskell isn't object-oriented, so there aren't any little namespaces (classes) running around that themselves need to occupy a namespace (package). So modules are enough. The Haskell wiki entry on modules is short, pretty complete, and has plenty of examples: http://en.wikibooks.org/wiki/Haskell/Modules http://en.wikibooks.org/wiki/Haskell/Modules