Open konstin opened 3 weeks ago
That’s probably my fault. I wrote the initial module as if I was writing an Elm project. One module centered around one data structure. It’s one granularity I found to be easy to work with when we need to have private/public modules well separated while preventing cyclic dependencies. Elm throws a compiler error when there is a cyclic import. I realized it helped me write more modular code in rust too, so even when the rust compiler isn’t as strict, I’m still following this habit.
I’m also fine with every public thing under the same module, especially for package users. If you can figure out a way to have this, while still preventing cyclic imports with private modules, I think I could be in favor of that.
Currently, pubgrub's public api consist of a number of modules, each containing one to few symbols. Instead, all exported symbols should be in the top level module, and the module level documentation should move onto the appropriate type. Only
type_aliases
andreport
may remain their only modules. This simplifies the api and makes it easier to discover.