bn-d / ppx_make

[@@ deriving] plugin to generate make functions.
https://boni.ng/ppx_make/ppx_make/index.html
MIT License
14 stars 1 forks source link
ocaml ppxlib

[@@deriving make]

OCaml CI GitHub release status Coverage Status

[@@deriving] plugin to generate make functions.

Installation

ppx_make can be installed via OCaml Package Manager.

$ opam install ppx_make

Usage

Please see the documentation.

Example

type my_type = {
  my_field : int;
  my_option : int option;
  my_list : int list;
  my_string : string;
  my_default : int; [@default 1024]
}
[@@deriving make]

(* the deriver will automatically generate the function below *)
val make_my_type :
  my_field:int ->
  ?my_option:int ->
  ?my_list:int list ->
  ?my_string:string ->
  ?my_default:int ->
  unit ->
  my_type