package ppx_show

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

Install

Dune Dependency

Authors

Maintainers

Sources

v0.2.0.tar.gz
sha512=0e46da5ff86fb9ac765e9d611665e8668199d1930a5ec95c4cdd509aeda2e8b3577b0a6185215ee5ee75a284a19a5626e2c73dfbeafcd67184b21b86e35a2df1

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 ()
OCaml

Innovation. Community. Security.