From a3ef5a00c184e08904e1e15da83f48a99c6082cd Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Sun, 27 Oct 2024 11:19:21 +0100 Subject: [PATCH 1/4] Re-export [Int.hash] for earlier ocaml versions --- src/import.ml | 6 ++++++ src/import.mli | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/import.ml b/src/import.ml index 3a4ca63..d09145e 100644 --- a/src/import.ml +++ b/src/import.ml @@ -11,6 +11,12 @@ module Array = struct ;; end +module Int = struct + include Int + + let hash = (Hashtbl.hash : int -> int) +end + module List = struct include ListLabels diff --git a/src/import.mli b/src/import.mli index e0e4118..0910041 100644 --- a/src/import.mli +++ b/src/import.mli @@ -6,6 +6,14 @@ module Array : sig val for_alli : 'a array -> f:(int -> 'a -> bool) -> bool end +module Int : sig + include module type of Int + + (** We re-export hash functions here to make the code compatible with earlier + ocaml versions. [Stdlib.Int.hash] is available since [ocaml.5.1]. *) + val hash : int -> int +end + module List : sig include module type of ListLabels From a8e2dc8ec929fdf5bfbb904de32ecbc4c586910a Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Sun, 27 Oct 2024 11:21:42 +0100 Subject: [PATCH 2/4] Update ocaml bound for provider package --- dune-project | 2 +- provider.opam | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dune-project b/dune-project index d735388..cb39510 100644 --- a/dune-project +++ b/dune-project @@ -22,7 +22,7 @@ (synopsis "Dynamic Dispatch with Traits") (depends (ocaml - (>= 5.2)) + (>= 4.14)) (sexplib0 (and (>= v0.17) diff --git a/provider.opam b/provider.opam index 365696d..75d2d81 100644 --- a/provider.opam +++ b/provider.opam @@ -9,7 +9,7 @@ doc: "https://mbarbin.github.io/provider/" bug-reports: "https://github.com/mbarbin/provider/issues" depends: [ "dune" {>= "3.16"} - "ocaml" {>= "5.2"} + "ocaml" {>= "4.14"} "sexplib0" {>= "v0.17" & < "v0.18"} "odoc" {with-doc} ] From c0cb153015318e79ce9e0f0c993ebc96b6ce77c3 Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Sun, 27 Oct 2024 11:20:07 +0100 Subject: [PATCH 3/4] Enable 4.14 in more-ci --- .github/workflows/more-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/more-ci.yml b/.github/workflows/more-ci.yml index 8cf51b4..25d8fb1 100644 --- a/.github/workflows/more-ci.yml +++ b/.github/workflows/more-ci.yml @@ -30,6 +30,7 @@ jobs: - windows-latest ocaml-compiler: - 5.2.x + - 4.14.x exclude: # We exclude the combination already tested in the 'ci' workflow. - os: ubuntu-latest From 5d11e37b8e8893a3cbbadf439911fe535b0038af Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Sun, 27 Oct 2024 11:23:20 +0100 Subject: [PATCH 4/4] Update changelog --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index cfc4e6d..361d7be 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ### Added +- Make the library build with `ocaml.4.14` (#22, @jonahbeckford, @mbarbin). - Added new checks in CI (build checks on windows and macos) (#21, @mbarbin). - Added a tutorial with new examples of handler-based polymorphism (#13, @mbarbin).