package GT

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

Viewing values of various types.

Combinatorial interface

type er = Stdlib.Buffer.t -> unit

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

type viewer = er

Synonym for unqualified reference.

val toString : viewer -> string

String conversion.

Primitive viewers

val empty : viewer

empty viewer

val concat : viewer -> viewer -> viewer

composition (one afer another)

Viewers for built-in types

val unit : unit -> viewer

unit viewer.

val string : string -> viewer

string viewer.

val int : int -> viewer

int viewer.

val float : float -> viewer

float viewer.

val bool : bool -> viewer

bool viewer.

val char : char -> viewer

char viewer.

Some predefined string viewers

val semicolon : viewer

Semicolon ";".

val comma : viewer

Comma ",".

val space : viewer

Space " ".

val break : viewer

Break "\n".

Sequence combinators

val seq : viewer list -> viewer

List viewer.

val seqa : viewer array -> viewer

Array viewer.

val listBy : viewer -> viewer list -> viewer

List by delimiter.

val list : viewer list -> viewer

List by comma.

val arrayBy : viewer -> viewer array -> viewer

Array by delimiter.

val array : viewer array -> viewer

Array by comma.

val inbr : viewer -> viewer -> viewer -> viewer

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

Bracketing combinators

val inrbr : viewer -> viewer

inrbr b prints b in round brackets.

val insqbr : viewer -> viewer

insqbr b prints b in square brackets.

val incvbr : viewer -> viewer

incvbr b prints b in curved brackets.

Functorial interface

module type Viewable = sig ... end

Signature to provide viewing function.

module type Concat = sig ... end

Signature to supply concatenation function.

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

Viewing lists of Viewable types with explicit concatenation function.

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

Viewing arrays of Viewable types with explicit concatenation function.

module SetC (C : Concat) (S : Stdlib.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>.

module MapC (C : Concat) (M : Stdlib.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>.

module HashtblC (C : Concat) (M : Stdlib.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>.

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

Viewing lists of Viewable types with concatenation with comma.

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

Viewing arrays of Viewable types with concatenation with comma.

module Set (S : Stdlib.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>.

module Map (M : Stdlib.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>.

module Hashtbl (M : Stdlib.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>.

module 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.

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

Viewing unnamed pairs.

Wrappers to make builtin types viewable

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

Viewing helpers

val concatWithDelimiter : string -> string -> string -> string

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

val concatWithComma : string -> string -> string

Concatenation with comma.

val concatWithSemicolon : string -> string -> string

Concatenation with semicolon.

OCaml

Innovation. Community. Security.