Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_Correct_ trying to be too clever when upgrading switches from opam 2.0 #5176

Merged
merged 7 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
compat: add Lazy.map
  • Loading branch information
dra27 authored and rjbou committed Jul 25, 2022
commit b6077bc90813a2f2a740b597ccef71d1fcef5d16
12 changes: 12 additions & 0 deletions src/core/opamCompat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,15 @@ module Stdlib = Pervasives
#else
module Stdlib = Stdlib
#endif

module Lazy =
#if OCAML_VERSION >= (4, 13, 0)
Lazy
#else
struct
include Lazy

let map f x =
lazy (f (force x))
end
#endif
11 changes: 11 additions & 0 deletions src/core/opamCompat.mli
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,14 @@ module Stdlib = Pervasives
#else
module Stdlib = Stdlib
#endif

module Lazy
#if OCAML_VERSION >= (4, 13, 0)
= Lazy
#else
: sig
include module type of struct include Lazy end

val map : ('a -> 'b) -> 'a t -> 'b t
end
#endif