Skip to content
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

use named arguments in all sub-commands thanks to cmdliner monadic syntax #461

Merged
merged 4 commits into from
Dec 4, 2024

Conversation

zapashcanon
Copy link
Member

No description provided.

@zapashcanon
Copy link
Member Author

cc @filipeom, you may be interested by this in other projects :-)

@filipeom
Copy link
Collaborator

filipeom commented Dec 4, 2024

cc @filipeom, you may be interested by this in other projects :-)

I was just looking at this, and after reviewing the code, I can't understand why it's better this way (other than the fact that it looks more declarative and satisfying ☺️).

Could you briefly explain if there are any functional improvements to using the monadic syntax?

I'm going to do this on smtml 😅

@zapashcanon
Copy link
Member Author

It allows named arguments, so you don't have to worry about the order anymore, which is nice when you have a lot of them! :)

@filipeom
Copy link
Collaborator

filipeom commented Dec 4, 2024

It allows named arguments, so you don't have to worry about the order anymore, which is nice when you have a lot of them! :)

Ah yes, this is so cool! Thanks!! I'm using this everywhere moving forward 😅

@zapashcanon zapashcanon merged commit c534856 into OCamlPro:main Dec 4, 2024
4 checks passed
filipeom added a commit to filipeom/smtml that referenced this pull request Dec 4, 2024
As inspired by OCamlPro/owi#461:

- use cmdliner's monadic syntax to build cmd terms;
- use named arguments in the cmds functions.

Other changes include:

- Moving sub-commands into respective `cmd_<command_name>.ml` modules;
- Creating a `Solver_mode` module;
- Moving most functions from `Solver_dispatcher` into a more appropriate
  `Solver_type` module
- Explicit exit codes for Term, Parse, and Exn error outputs in
  cmdliner.
filipeom added a commit to formalsec/smtml that referenced this pull request Dec 4, 2024
As inspired by OCamlPro/owi#461:

- use cmdliner's monadic syntax to build cmd terms;
- use named arguments in the cmds functions.

Other changes include:

- Moving sub-commands into respective `cmd_<command_name>.ml` modules;
- Creating a `Solver_mode` module;
- Moving most functions from `Solver_dispatcher` into a more appropriate
  `Solver_type` module
- Explicit exit codes for Term, Parse, and Exn error outputs in
  cmdliner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants