package dune

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file fmt.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

(* CR-someday diml: we should define a GADT for this:

   {[
     type 'a t =
       | Int : int t
       | Box : ...
           | Colored : ...
   ]}

   This way we could separate the creation of messages from the
   actual rendering.
*)
type 'a t = Format.formatter -> 'a -> unit

let list = Format.pp_print_list
let text = Format.pp_print_text

let nl = Format.pp_print_newline

let ocaml_list pp fmt = function
  | [] -> Format.pp_print_string fmt "[]"
  | l ->
    Format.fprintf fmt "@[<hv>[ %a@ ]@]"
      (list ~pp_sep:(fun fmt () -> Format.fprintf fmt "@,; ")
         pp) l
OCaml

Innovation. Community. Security.