3 ms·
I actually quite like this limitation. It encourages you to separate data structures into their own modules and use qualified names to access their member data,
by p4wnc6 10y ago
I actually quite like this limitation. It encourages you to separate data structures into their own modules and use qualified names to access their member data, which I think is often the right idea.
- eru 10y agoIf only Haskell would be more like OCaml in this regard, and would allow you to eg nest module, instead of saying "One File = One Module".
- lelf 10y agoIt goes in that direction with https://ghc.haskell.org/trac/ghc/wiki/Backpack https://ghc.haskell.org/trac/ghc/wiki/Backpack
- p4wnc6 10y agoI've never encountered a situation in which the One File - One Module imposed convention was problematic. I also find it greatly helps when reading new Haskell code bases. I think it's generally a sign of good project design when there are lots and lots of small files, each with one data structure and a few associated functions.
- eru 10y agoFor most of what I want, being able to introduce additional namespaces would be good enough. Making them modules as well could open the doors to some need techniques. (I don't need multiple namespaces per file so much for the finished program, but it's handy when developing.)