package epictetus

  1. Overview
  2. Docs

Source file std_aligners.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
30
31
32
33
34
35
36
[@@@warning "+A"]
module Sized_pp_contents
  : Aligner_sig.CONTENTS
    with type contents = (Format.formatter -> unit) * int
  =
  (struct
    type contents = (Format.formatter -> unit) * int
    let contents_length : contents -> int = snd
    let pp (fmt: Format.formatter) (pp, _: contents) : unit = pp fmt
  end)

module SizedPPAligner = Generic_aligner.GenericAligner(Sized_pp_contents)

module Pp_contents
  : Aligner_sig.CONTENTS
    with type contents = Format.formatter -> unit
  =
  (struct
    type contents = Format.formatter -> unit
    let contents_length (c: contents) : int = Format.kasprintf String.length "%t" c
    let pp (fmt: Format.formatter) (pp: contents) : unit = pp fmt
  end)

module PPAligner = Generic_aligner.GenericAligner(Pp_contents)

module String_contents
  : Aligner_sig.CONTENTS
    with type contents = string
  =
  (struct
    type contents = string
    let contents_length : string -> int = String.length
    let pp (fmt: Format.formatter) (c : contents) : unit = Format.pp_print_string fmt c
  end)

module StringAligner = Generic_aligner.GenericAligner(String_contents)
OCaml

Innovation. Community. Security.