package ppx_show

  1. Overview
  2. Docs
OCaml PPX deriver for deriving show based on ppxlib

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.2.1.tar.gz
sha512=64e9a8c7e413cee961baae3e805cb221469f17071ba2c2593b30a68b9209112908cfc21686d12e2997ff45b1c9924e5bd80a156408f495a41b197609b85b4529

doc/src/ppx_show.runtime/ppx_show_runtime.ml.html

Source file ppx_show_runtime.ml

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
29
module Format = Format

module String = String

module Int32 = Int32

module Int64 = Int64

module Nativeint = Nativeint

module Bytes = Bytes

module Lazy = Lazy

let pp_list pp_item fmt items =
  Format.pp_open_box fmt 1;
  Format.pp_print_string fmt "[";
  begin match items with
  | [] -> ()
  | hd :: tl ->
      pp_item fmt hd;
      tl |> List.iter begin fun item ->
        Format.pp_print_string fmt ";";
        Format.pp_print_space fmt ();
        pp_item fmt item
      end
  end;
  Format.pp_print_string fmt "]";
  Format.pp_close_box fmt ()