-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TOML encoding #712
Add TOML encoding #712
Conversation
9aa289b
to
d86de8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an excellent PR! I <3 the error messages. The code in clerk_config
is maybe too type-safe with heavy use of combinators that might be hard to read for OCaml newbies, but let's assume clerk
will be maintained by seasoned OCaml devs :)
d86de8f
to
b796a4f
Compare
@@ -0,0 +1,536 @@ | |||
(* This file is part of the Catala build system, a specification language for | |||
tax and social benefits computation rules. Copyright (C) 2024 Inria, | |||
contributors: Louis Gesbert <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This very nice!
This PR cleans the clerk's TOML config ad hoc reader/writer by adding a generic type-safe encoder/decoder.
This allows to properly describe and update config files without much boilerplate. C.f. the second commit that replaces the existing parsing with this encoder.
The PR adds new fields to the config file (related to #692) that are currently unused but are retro-compatible with the existing TOML configuration files (in particular, the one present in https://github.com/CatalaLang/catala-examples).
It also displays proper error messages, for example:


or