1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
# ppx_deriving_accessors
This folder contains an example of a very simple ppx deriver that will generate
accessors for record fields from the record type definition.
E.g. the following:
```ocaml
type t =
{ a : string
; b : int
}
[@@deriving accessors]
```
will generate the following:
```ocaml
let a x = x.a
let b x = x.b
```
It can also be used in `.mli` files to generate the corresponding signatures:
```ocaml
val a : t -> string
val b : t -> int
```
|