kowainik / tomland

🏝 Bidirectional TOML serialization
https://kowainik.github.io/posts/2019-01-14-tomland
Mozilla Public License 2.0
120 stars 39 forks source link

Simpler module structure #256

Closed chshersh closed 4 years ago

chshersh commented 4 years ago

After working with the tomland code for a while, it was discovered that its codebase is not optimal, and sometimes confusing to navigate. Its is a proposal to change the existing module structure. This is a breaking change, but since we recommend to import the top-level module qualified, almost all users of tomland shouldn't even notice the change.

My current proposal is the following:

Open questions:

  1. The core polymorphic monad is called Codec. Wouldn't it be confusing to have Toml.Monad have the Codec type and the Toml.Codec module to contain all combinators? Maybe names should be Toml.Codec and Toml.Combinators instead?
  2. Maybe we can even remove the Toml.Type prefix and remove the .Type part from all Toml.Type.* modules?
  3. What to do with Toml.Bi.Code? :slightly_smiling_face:

Any ideas of other improvements are appreciated :slightly_smiling_face:

chshersh commented 4 years ago

New structure after discussion with @vrom911: