Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
unreleased
----------

* Fix the unintentional removal of `Ppx_deriving_runtime.Result` in #279
#282
(@NathanReb)

6.0.0 (15/04/2024) (aborted, not on opam)
----------------------------

Expand Down
18 changes: 18 additions & 0 deletions src/runtime/ppx_deriving_runtime.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ module Stdlib = Stdlib

include Stdlib

module Result = struct
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
#else
module Pervasives = Pervasives
module Stdlib = Pervasives
Expand All @@ -49,6 +58,15 @@ module Weak = Weak
module Printf = Printf
module Format = Format
module Buffer = Buffer
module Result = struct
type ('a, 'b) t = ('a, 'b) result =
| Ok of 'a
| Error of 'b

type nonrec ('a, 'b) result = ('a, 'b) result =
| Ok of 'a
| Error of 'b
end
module Option = struct
type 'a t = 'a option

Expand Down
23 changes: 23 additions & 0 deletions src/runtime/ppx_deriving_runtime.cppo.mli
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ include module type of struct
end

module Stdlib = Stdlib

module Result : sig
type ('a, 'b) t = ('a, 'b) result =
| Ok of 'a
| Error of 'b

(* we also expose Result.result for backward-compatibility
with the Result package! *)
type ('a, 'b) result = ('a, 'b) t =
| Ok of 'a
| Error of 'b
end
#else
module Pervasives = Pervasives

Expand Down Expand Up @@ -59,6 +71,17 @@ module Printf = Printf
module Format = Format
module Buffer = Buffer

module Result : sig
type ('a, 'b) t = ('a, 'b) result =
| Ok of 'a
| Error of 'b

(* we also expose Result.result for backward-compatibility *)
type nonrec ('a, 'b) result = ('a, 'b) result =
| Ok of 'a
| Error of 'b
end

module Option : sig
type 'a t = 'a option

Expand Down