# \[ANN\] Ppx deriving decoders

**URL:** <https://discuss.ocaml.org/t/ann-ppx-deriving-decoders/15921>\
**Category:** Community\
**Tags:** ppx\
**Created:** [January 10, 2025, 3:59am UTC](https://discuss.ocaml.org/t/ann-ppx-deriving-decoders/15921 "2025-01-10T03:59:09Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![benbellick](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/benbellick/32/5261_2.png) [@benbellick](https://discuss.ocaml.org/u/benbellick)\
**Post date:** [January 10, 2025, 3:59am UTC](https://discuss.ocaml.org/t/ann-ppx-deriving-decoders/15921/1 "2025-01-10T03:59:09Z")

</div>

A little late but wanted to share a package I have released!

For those familiar with the excellent [ocaml-decoders](https://github.com/mattjbray/ocaml-decoders) package, I have written [ppx\_deriving\_decoders](http://github.com/benbellick/ppx_deriving_decoders) to automatically generate the corresponding decoders (and encoders) based off of type definitions.

In my view, this gives the best of both worlds in terms of:

1. automatically generating (e.g. JSON) serialization and deserialization based off of a type definition, and
2. having a readable and expressive language for handwriting encoders and decoders when necessary by using combinators.

The instructions in the README demonstrate how you can use the generated decoder as a base point from which to hand tweak and get your own custom decoder.

Please let me know if you find it useful or have any feedback. Thanks!

---

_[View the full topic](https://discuss.ocaml.org/t/ann-ppx-deriving-decoders/15921)._
