We have two stages for converting TOML to Haskell types:
Parsing
Decoding
Decoding works with a generic TOML representation. But this representation doesn't record the source positions of TOML entries from file. If we can come up with a way to track positions of TOML entries in files, we can improve the quality of error messages and instead of:
tomland decode error: Type for key name doesn't match.
Expected: Text
Actual: Integer
we can output something like this
tomland decode error: Type for key name doesn't match.
Expected: Text
Actual: Integer
example.toml
3 |
4 | name = 42
5 | ^^^^^^^^^
We have two stages for converting TOML to Haskell types:
Decoding works with a generic TOML representation. But this representation doesn't record the source positions of TOML entries from file. If we can come up with a way to track positions of TOML entries in files, we can improve the quality of error messages and instead of:
we can output something like this