ppx_deriving
ppx_deriving copied to clipboard
Support exceptions
One of the uses of sexplib is to be able to pretty-print exceptions, e.g. on stack traces. Previously via the with sexp
syntax one could attach these to exceptions, to achieve this. But ppx_deriving does not support exceptions, so [@@deriving sexp]
annotations have no effect - e.g. see janestreet/ppx_sexp_conv#11. It would be good if this could work.
I don't really understand the issue, and we're using [@@deriving sexp]
on exceptions in Jane Street, so presumably the issue is solved in the modern world. I'm closing the issue. Feel free to re-open if it's not, actually, solved.
Oh, well, I don't have permissions to close an issue here.
I'm not sure how @@deriving
is supposed to work on exception declarations. For example, if you use type t = Foo [@@deriving show]
, you will get a show_t
function generated "for free". But on exception Foo [@@deriving show]
, morally there should be an extensible show_exception
function to which a case would be added for Foo
. I suspect that this is not supported by ppx_deriving today, as reported earlier by @infinity0. @aalekseyev, you may be observing a feature implemented in ppx_type_conv? (Do you have a pointer to some documentation on the feature?)