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

ptset/ptmap are broken under 4.05 (beta) #1

Open
gasche opened this issue Feb 26, 2017 · 6 comments
Open

ptset/ptmap are broken under 4.05 (beta) #1

gasche opened this issue Feb 26, 2017 · 6 comments

Comments

@gasche
Copy link

gasche commented Feb 26, 2017

opam-builder reports:
http://opam.ocamlpro.com/builder/html/ptset/ptset.1.0.0/2df016054683ba0af52a1ddae1f33d8a
http://opam.ocamlpro.com/builder/html/ptmap/ptmap.2.0.1/37f00ce2a1b7c7371cfab67b79c734aa

Error: The implementation ptset.ml
does not match the interface dist/build/lib-ptset/opt-d/ptset.cmi:

   The value `find_last_opt' is required but not provided
   The value `find_last' is required but not provided
   The value `find_first_opt' is required but not provided
   The value `find_first' is required but not provided
   The value `find_opt' is required but not provided
   The value `choose_opt' is required but not provided
   The value `max_elt_opt' is required but not provided
   The value `min_elt_opt' is required but not provided

File "ptmap.ml", line 1:
Error: The implementation ptmap.ml
does not match the interface dist/build/lib-ptmap/ptmap.cmi:

   The value `find_last_opt' is required but not provided
   The value `find_last' is required but not provided
   The value `find_first_opt' is required but not provided
   The value `find_first' is required but not provided
   The value `choose_opt' is required but not provided
   The value `max_binding_opt' is required but not provided
   The value `min_binding_opt' is required but not provided

I suppose that you can either stop using the standard Set.S interface (by duplicating it) to not break on new releases, or implement the new functions. They come from ocaml/ocaml#869 .

@gasche gasche changed the title ptset/ptmap are broken under 4.05 ptset/ptmap are broken under 4.05 (beta) Feb 26, 2017
@UnixJunkie
Copy link
Collaborator

Duplicating anything violates a software engineering principle.

@UnixJunkie
Copy link
Collaborator

I will use cppo to handle ocaml versions >= 4.05.

@gasche
Copy link
Author

gasche commented Feb 27, 2017

I don't think you need to use a preprocessor: why not implement these functions for all OCaml versions? At worst, they will be hidden by a more restrictive signature on older versions.

(In Batteries we do need a preprocessor because some of the features we expose depend on new runtime features that cannot be re-implemented externally. This is not the case here.)

@UnixJunkie
Copy link
Collaborator

Good idea, I will try.

@UnixJunkie
Copy link
Collaborator

related to #2

@backtracking
Copy link
Owner

I prefer the idea of abandoning the compatibility with Set.S, in particular because functions such as
min_elt, max_elt, or elements make no sense with Patricia trees.
I dislike the idea of duplicating a fragment of Set.S, but I prefer this solution anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants