package ppx_make

  1. Overview
  2. Docs
Ppxlib based make deriver

Install

Dune Dependency

Authors

Maintainers

Sources

v0.3.0.tar.gz
md5=7517e7f7ea82ba4d04a834b8a8c95cd2
sha512=8be282a395ef73b6bd66ac756c5b4f1e7af3abc695d58e9635248a33082b812fff8fa68fd40546137d678d1d1a532144e5c8869ad19244bf1a37337c504b79a8

Description

Published: 24 Aug 2021

README

ppx_make

ppxlib based make deriver

Installation

ppx_make can be installed via OCaml Package Manager.

$ opam install ppx_make

Usage

To use this library, add (preprocess (pps ppx_make)) to the library/executable configuration in dune file.

Syntax

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

Please check the test for more examples.

Dependencies (2)

  1. ppxlib >= "0.10.0"
  2. dune >= "2.7"

Dev Dependencies (2)

  1. odoc with-doc
  2. ounit2 with-test

Conflicts

None

OCaml

Innovation. Community. Security.