ppxはpreprocessor的なもの。 opam install ppx_deriving field.ml type point2d = float * float [@@deriving show] type person = { name: string; age: int; } [@@deriving show] type student = { name: string; (* 最近はレコードに同名のkeyを付けてもokになったっぽい *) age: int; grade: int; } [@@deriving show] (* val pp_student : Format.formatter -> student -> unit val show_student : student -> string が生成される *) let () = let s = {name =