package opam-core

  1. Overview
  2. Docs

Module OpamConsole.TreeSource

Tree printing

Sourcetype 'elt t
Sourceval value : 'elt t -> 'elt
Sourceval children : 'elt t -> 'elt t list
Sourceval create : ?children:'a t list -> 'a -> 'a t

Creates a tree node.

Sourcetype symbols = {
  1. vert : string;
    (*

    |

    *)
  2. hor : string;
    (*
    *)
  3. tee : string;
    (*

    |-

    *)
  4. hook : string;
    (*

    '-

    *)
}

The symbols to be used in the tree printer.

Sourceval get_default_symbols : unit -> symbols

Returns UTF8 or ASCII tree symbols depending on utf8 ().

Sourceval print : ?symbols:symbols -> printer:('a -> string) -> 'a t -> unit

Prints the given tree as a Unicode/ASCII art.

  • parameter printer

    may return a multi-line string, but should not return an empty string.

OCaml

Innovation. Community. Security.