package ppx_deriving

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

Source file ppx_deriving_runtime.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# 1 "ppx_deriving_runtime.cppo.ml"
type nonrec int = int
type nonrec char = char
type nonrec string = string
type nonrec float = float
type nonrec bool = bool
type nonrec unit = unit
type nonrec exn = exn
type nonrec 'a array = 'a array
type nonrec 'a list = 'a list
type nonrec 'a option = 'a option
type nonrec nativeint = nativeint
type nonrec int32 = int32
type nonrec int64 = int64
type nonrec 'a lazy_t = 'a lazy_t
type nonrec bytes = bytes

# 18 "ppx_deriving_runtime.cppo.ml"
module Stdlib = Stdlib

include Stdlib

module Result = struct
  (* Type manifest shoud be [('a, 'b) result]:
     - it can't be [Result.t] because [Result] is not defined in 4.07 std-lib
       and the result package just exposes [Result.t] as an alias to [result]
       without re-exporting the constructors
     - it can't be [Result.result] because the [include Stdlib] above makes
       [Result] be [Stdlib.Result] (shadowing the [Result] module from the
       result package), and [Stdlib.Result] does not define [result] (that's
       why we override the [Result] module as the first place. *)
  type ('a, 'b) t = ('a, 'b) result =
    | Ok of 'a
    | Error of 'b

  type ('a, 'b) result = ('a, 'b) t =
    | Ok of 'a
    | Error of 'b
end

OCaml

Innovation. Community. Security.