# Semi optional deriving arguments using ppxlib

**URL:** <https://discuss.ocaml.org/t/semi-optional-deriving-arguments-using-ppxlib/1817>\
**Category:** Community\
**Created:** [April 6, 2018, 12:13pm UTC](https://discuss.ocaml.org/t/semi-optional-deriving-arguments-using-ppxlib/1817 "2018-04-06T12:13:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kakadu](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/kakadu/32/1204_2.png) [@Kakadu](https://discuss.ocaml.org/u/Kakadu)\
**Post date:** [April 6, 2018, 12:13pm UTC](https://discuss.ocaml.org/t/semi-optional-deriving-arguments-using-ppxlib/1817/1 "2018-04-06T12:13:53Z")

</div>

I’m trying to use `ppxlib` (actually, `ppx_type_conv` which now is a part of `ppxlib`) and my goal is to specify plugin arguments as I want. More precisely, `ppxlib` currently [supports](https://github.com/ocaml-ppx/ppxlib/blob/0.2.0/src/deriving.ml#L64) arguments like  
`[@@deriving plugin_name ~flag1 ~flag2 ...]` where presence of labeled argument translates to `true` and absence to `false`.

Another way to declare arguments is to replace `bool` type by `expression` type, i.e. `[@@deriving plugin_name ~arg1:e1 ~arg2:e2 ...]` where the user **obliged** to [specify](https://github.com/ocaml-ppx/ppxlib/blob/0.2.0/src/deriving.ml#L57) expression for the labeled argument.

I want to specify plugin arguments that have type `expression option` and make **specifying** expressions **optional**. Can you help me to do it?

---

<div class="post-metadata">

**Author:** ![jeremiedimino](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jeremiedimino/32/699_2.png) [@jeremiedimino](https://discuss.ocaml.org/u/jeremiedimino)\
**Post date:** [April 24, 2018, 4:47pm UTC](https://discuss.ocaml.org/t/semi-optional-deriving-arguments-using-ppxlib/1817/2 "2018-04-24T16:47:33Z")

</div>

Sure. If you look at the implementation of `Ppxlib.Deriving.Args.arg`, you just need to set the `detault` field.

BTW, i just saw your post by chance, I think it is best to post such questions on the project directly
