package GT

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

Module ViewSource

Viewing values of various types.

Combinatorial interface

Sourcetype er = Buffer.t -> unit

Type of the printer (to be referenced as View.er).

Sourcetype viewer = er

Synonym for unqualified reference.

Sourceval toString : viewer -> string

String conversion.

Primitive viewers

Sourceval empty : viewer

empty viewer

Sourceval concat : viewer -> viewer -> viewer

composition (one afer another)

Viewers for built-in types

Sourceval unit : unit -> viewer

unit viewer.

Sourceval string : string -> viewer

string viewer.

Sourceval int : int -> viewer

int viewer.

Sourceval float : float -> viewer

float viewer.

Sourceval bool : bool -> viewer

bool viewer.

Sourceval char : char -> viewer

char viewer.

Some predefined string viewers

Sourceval semicolon : viewer

Semicolon ";".

Sourceval comma : viewer

Comma ",".

Sourceval space : viewer

Space " ".

Sourceval break : viewer

Break "\n".

Sequence combinators

Sourceval seq : viewer list -> viewer

List viewer.

Sourceval seqa : viewer array -> viewer

Array viewer.

Sourceval listBy : viewer -> viewer list -> viewer

List by delimiter.

Sourceval list : viewer list -> viewer

List by comma.

Sourceval arrayBy : viewer -> viewer array -> viewer

Array by delimiter.

Sourceval array : viewer array -> viewer

Array by comma.

Sourceval inbr : viewer -> viewer -> viewer -> viewer

inbr l r b prints b in brackets l, r.

Bracketing combinators

Sourceval inrbr : viewer -> viewer

inrbr b prints b in round brackets.

Sourceval insqbr : viewer -> viewer

insqbr b prints b in square brackets.

Sourceval incvbr : viewer -> viewer

incvbr b prints b in curved brackets.

Functorial interface

Sourcemodule type Viewable = sig ... end

Signature to provide viewing function.

Sourcemodule type Concat = sig ... end

Signature to supply concatenation function.

Sourcemodule ListC (C : Concat) (X : Viewable) : Viewable with type t = X.t list

Viewing lists of Viewable types with explicit concatenation function.

Sourcemodule ArrayC (C : Concat) (X : Viewable) : Viewable with type t = X.t array

Viewing arrays of Viewable types with explicit concatenation function.

Sourcemodule SetC (C : Concat) (S : Set.S) (V : Viewable with type t = S.elt) : Viewable with type t = S.t

Viewing sets of Viewable types with explicit concatenation function. Set items are ordered in according to their <b>string representations</b>.

Sourcemodule MapC (C : Concat) (M : Map.S) (K : Viewable with type t = M.key) (V : Viewable) : Viewable with type t = V.t M.t

Viewing maps of Viewable types with explicit concatenation function. Set items are ordered in according to their <b>string representations</b>.

Sourcemodule HashtblC (C : Concat) (M : Hashtbl.S) (K : Viewable with type t = M.key) (V : Viewable) : Viewable with type t = V.t M.t

Viewing hash tables of Viewable types with explicit concatenation function. Set items are ordered in according to their <b>string representations</b>.

Sourcemodule List (X : Viewable) : Viewable with type t = X.t list

Viewing lists of Viewable types with concatenation with comma.

Sourcemodule Array (X : Viewable) : Viewable with type t = X.t array

Viewing arrays of Viewable types with concatenation with comma.

Sourcemodule Set (S : Set.S) (V : Viewable with type t = S.elt) : Viewable with type t = S.t

Viewing sets of Viewable types with concatenation with comma. Set items are ordered in according to their <b>string representations</b>.

Sourcemodule Map (M : Map.S) (K : Viewable with type t = M.key) (V : Viewable) : Viewable with type t = V.t M.t

Viewing maps of Viewable types with concatenation with comma. Set items are ordered in according to their <b>string representations</b>.

Sourcemodule Hashtbl (M : Hashtbl.S) (K : Viewable with type t = M.key) (V : Viewable) : Viewable with type t = V.t M.t

Viewing has htables of Viewable types with concatenation with comma. Set items are ordered in according to their <b>string representations</b>.

Sourcemodule NamedPair (N : sig ... end) (F : Viewable) (S : Viewable) : Viewable with type t = F.t * S.t

Viewing named pairs. The first parameter supplies components names.

Sourcemodule Pair (F : Viewable) (S : Viewable) : Viewable with type t = F.t * S.t

Viewing unnamed pairs.

Wrappers to make builtin types viewable

Sourcemodule String : Viewable with type t = string
Sourcemodule Integer : Viewable with type t = int
Sourcemodule Float : Viewable with type t = float
Sourcemodule Bool : Viewable with type t = bool
Sourcemodule Char : Viewable with type t = char
Sourcemodule Unit : Viewable with type t = unit
Sourcemodule Exn : Viewable with type t = exn
Sourcemodule Int32 : Viewable with type t = int32
Sourcemodule Int64 : Viewable with type t = int64
Sourcemodule Nativeint : Viewable with type t = nativeint

Viewing helpers

Sourceval concatWithDelimiter : string -> string -> string -> string

Concatenation function: concatWithDelimiter x y delim returns x ^ delim ^ y if x is not empty and y otherwise.

Sourceval concatWithComma : string -> string -> string

Concatenation with comma.

Sourceval concatWithSemicolon : string -> string -> string

Concatenation with semicolon.

OCaml

Innovation. Community. Security.