package volgo

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

Module Vcs.TraitSource

The traits that Vcs depends on to implement its functionality.

Vcs is parametrized by a list of specific interfaces and classes that constitute the low level operations needed by Vcs. We call them traits.

The intended usage for a library that requires Vcs functionality is to specify via the type of the vcs value, the exact list of traits required. Doing this in this way, allows for flexibility, as any backend supplying that list of traits or more will be compatible as a backend to be supplied to your code.

For example, consider a function that needs to list all the files under version control, and show their contents at some revision. Such functionality will require:

  val my_vcs_function
    : vcs : < Vcs.Trait.ls_files ; Vcs.Trait.show ; .. > Vcs.t
    -> ..
    -> ..
Sourceclass type add = Volgo__.Trait_add.t
Sourcemodule Add : sig ... end
Sourceclass type branch = Volgo__.Trait_branch.t
Sourcemodule Branch : sig ... end
Sourceclass type commit = Volgo__.Trait_commit.t
Sourcemodule Commit : sig ... end
Sourceclass type config = Volgo__.Trait_config.t
Sourcemodule Config : sig ... end
Sourceclass type current_branch = Volgo__.Trait_current_branch.t
Sourcemodule Current_branch : sig ... end
Sourceclass type current_revision = Volgo__.Trait_current_revision.t
Sourcemodule Current_revision : sig ... end
Sourceclass type file_system = Volgo__.Trait_file_system.t
Sourcemodule File_system : sig ... end
Sourceclass type git = Volgo__.Trait_git.t
Sourcemodule Git : sig ... end
Sourceclass type hg = Volgo__.Trait_hg.t
Sourcemodule Hg : sig ... end
Sourceclass type init = Volgo__.Trait_init.t
Sourcemodule Init : sig ... end
Sourceclass type log = Volgo__.Trait_log.t
Sourcemodule Log : sig ... end
Sourceclass type ls_files = Volgo__.Trait_ls_files.t
Sourcemodule Ls_files : sig ... end
Sourceclass type name_status = Volgo__.Trait_name_status.t
Sourcemodule Name_status : sig ... end
Sourceclass type num_status = Volgo__.Trait_num_status.t
Sourcemodule Num_status : sig ... end
Sourceclass type refs = Volgo__.Trait_refs.t
Sourcemodule Refs : sig ... end
Sourceclass type show = Volgo__.Trait_show.t
Sourcemodule Show : sig ... end
Sourceclass type t = object ... end

The union of all traits defined in Vcs.

This is a special class constructor that creates an object that satisfies the interface defined by the class type t, but where each of the actual method implementation is a function that returns an error indicating that the method is unimplemented.