Repository navigation
Derive sexp_of - #116
Derive sexp_of#116lukepalmer wants to merge 3 commits into
Conversation
|
i don't understand how this works without ppx_deriving dependency? and i definitely wouldn't want that dependency. |
|
Thanks for looking @ygrek. My apologies for missing dependencies; my build environment is unusual. I'll revisit this with vanilla dune. Reiterating the types was what I was trying to avoid with this change. If you don't want the dependency that's entirely fair. I can pull that duplication into my client if that's the right thing (unless you have a good idea about how to do this within the bindings in an acceptable way, which I'm happy to try). |
|
Also, if it makes a difference, ppx_sexp_conv is going to be a build dependency only, with a runtime dependency on sexplib0, which is pretty compact. If there is some other way to do human readability (string?) that you'd prefer I am happy to use whatever that is. |
|
i totally understand the motivation and i would feel much easier if there was default agreed upon / expected way of doing
Regardless of approach below - I imagine it is only for error messages, then i prefer plain strings not sexp Ideas (not sure if good) :
|
|
How about doing this with ppx_string_conv? The only runtime dependency is 'base' which is hopefully uncontroversial. There are some small build-time dependencies. If it's important to avoid build-time dependencies I could probably come up with a way to do code generation as part of a release build and then commit it. I don't understand why this would be helpful but happy to give it a try if you prefer. |
To paraphrase what @ygrek said: it is controversial because it would mean that everyone using |
|
Got it! I will see what I can come up with here as an alternative. I do appreciate the context. |
|
I was able to take a different approach in my client using Curl.strerror and similar. This seems fine for clients of my library, but maybe isn't quite as nice for me because it requires a little thought to go from the nicely formatted error message back to exactly which variant constructor it refers to. Anyhow thanks for the feedback. I have a new perspective on how others think about dependencies. Closing. |
Using
[@@deriving sexp_of]on exposed types is helpful for formatting good errors and other messages that can contain curl types.I realize that this is possibly controversial because it's just one opinion on how to format such things (other people may prefer string over sexp, etc).
My direct application here is that I'd like to open source an curl client that works with Async. Having these derivations in the source means I don't need a bunch of boilerplate inside that client to do formatting. I can probably come up with something else if this isn't acceptable.