package odoc

  1. Overview
  2. Docs
OCaml documentation generator

Install

dune-project
 Dependency

Authors

Maintainers

Sources

odoc-2.1.1.tbz
sha256=f574dbd28cd0fc3a2b95525c4bb95ddf6d1f6408bb4fe12157fa537884f987fd
sha512=1c545c281a7022a167f028fff8cec6fb3f2f82da0881431be74e7a4281c5353ed83bfbdb4d9d9e08af6755dbe3505c052c5e5b58cdeb08c57aed5e89c0f15e91

doc/src/odoc.model_desc/type_desc.ml.html

Source file type_desc.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(** Runtime representation of types. It is only useful for inspecting
    values, not types, eg. it is possible to write a generic printer but
    not to deserialize. *)
type 'a t =
  | Record : 'a field list -> 'a t
  | Variant : ('a -> case) -> 'a t
  | Pair : 'a t * 'b t -> ('a * 'b) t
  | Triple : 'a t * 'b t * 'c t -> ('a * 'b * 'c) t
  | List : 'a t -> 'a list t
  | Option : 'a t -> 'a option t
  | To_string : ('a -> string) -> 'a t
  | Indirect : ('a -> 'b) * 'b t -> 'a t

and 'a field = F : string * ('a -> 'b) * 'b t -> 'a field

and case = C : string * 'b * 'b t -> case | C0 : string -> case

let bool : bool t = To_string string_of_bool

let string : string t = To_string (fun s -> s)

let int : int t = To_string string_of_int