You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Rename:Toml.Bi.Combinators to Toml.Codec
This module contains all codecs , so it name could help find them
Rename:Toml.Bi.Monad to Toml.Monad
Rename:Toml.Bi.Map to Toml.BiMap
Rename:Toml.Bi.Code to Toml.Decoding
It has both functions encode and decode, so Decoding is not precise enough... Maybe we should have two modules: Toml.Encode and Toml.Decode? Or maybe we can even combine Encode with Toml.Printer?
Delete:Toml.Bi
Module structure is becoming flatter
New: Toml.Key
This data is inside the Toml.PrefixTree module, and keep forgetting about that. Probably we can move it out to help navigation
Open questions:
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?
Maybe we can even remove the Toml.Type prefix and remove the .Type part from all Toml.Type.* modules?
What to do with Toml.Bi.Code? 🙂
Any ideas of other improvements are appreciated 🙂
The text was updated successfully, but these errors were encountered:
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 modulequalified
, almost all users oftomland
shouldn't even notice the change.My current proposal is the following:
Toml.Bi.Combinators
toToml.Codec
Toml.Bi.Monad
toToml.Monad
Toml.Bi.Map
toToml.BiMap
Toml.Bi.Code
toToml.Decoding
encode
anddecode
, soDecoding
is not precise enough... Maybe we should have two modules:Toml.Encode
andToml.Decode
? Or maybe we can even combineEncode
withToml.Printer
?Toml.Bi
Toml.Key
Toml.PrefixTree
module, and keep forgetting about that. Probably we can move it out to help navigationOpen questions:
Codec
. Wouldn't it be confusing to haveToml.Monad
have theCodec
type and theToml.Codec
module to contain all combinators? Maybe names should beToml.Codec
andToml.Combinators
instead?Toml.Type
prefix and remove the.Type
part from allToml.Type.*
modules?Toml.Bi.Code
? 🙂Any ideas of other improvements are appreciated 🙂
The text was updated successfully, but these errors were encountered: