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

Make the library build with 4.14 #22

Merged
merged 4 commits into from
Oct 27, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/more-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(synopsis "Dynamic Dispatch with Traits")
(depends
(ocaml
(>= 5.2))
(>= 4.14))
(sexplib0
(and
(>= v0.17)
Expand Down
2 changes: 1 addition & 1 deletion provider.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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}
]
Expand Down
6 changes: 6 additions & 0 deletions src/import.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions src/import.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down