package core_kernel

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

Source file or_error.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
open! Import
include Base.Or_error

type 'a t = ('a, Error.t) Result.t [@@deriving bin_io]

module Expect_test_config = struct
  module IO = Base.Or_error
  module IO_run = IO

  module IO_flush = struct
    include IO

    let to_run t = t
  end

  let flush () = return ()
  let run f = ok_exn (f ())
  let flushed () = true
  let upon_unreleasable_issue = Expect_test_config.upon_unreleasable_issue
end

module Stable = struct
  module V1 = struct
    type 'a t = ('a, Error.Stable.V1.t) Result.Stable.V1.t
    [@@deriving bin_io, compare, sexp]

    let map x ~f = Result.Stable.V1.map x ~f1:f ~f2:Fn.id
  end

  module V2 = struct
    type 'a t = ('a, Error.Stable.V2.t) Result.Stable.V1.t
    [@@deriving bin_io, compare, sexp]

    let map x ~f = Result.Stable.V1.map x ~f1:f ~f2:Fn.id
  end
end