Module Gist.Abstract

Operating on abstract types.

module Repr : sig ... end

Public representations.

type 't repr =
  1. | Repr : ('t, 'rep) Repr.t -> 't repr

    The type for existential abtract representation.

val repr : ?meta:'repr Meta.t -> version:string -> 'repr t -> ('a -> 'repr) -> ('repr -> 'a) -> 'a repr

repr ~version repr inject projet is a public representation. This is Repr.make wrapped in Repr.

Abstract types

type 'a t = 'a abstract

The type for abstract types of type 'a.

val make : ?meta:'a Meta.t -> string -> reprs:'a repr list -> 'a abstract

v ~meta name reprs represents an abstract type named name with public representations reprs.

The first representation of reprs is assumed to be the default one to use. Other representations can be used when interfacing with systems that support representation versioning. If reprs is empty, the type remains abstract.

val meta : 'a abstract -> 'a Meta.t

meta a is the metadata of a.

val name : 'a abstract -> string

name a is the name of a.

val reprs : 'a abstract -> 'a repr list

reprs a are the public representations of a. The first representation (if any) is the one to favour.