ocaml-community / zed

Abstract engine for text edition in OCaml
Other
121 stars 16 forks source link

Fix scoping error due to the introduction of `Result.compare` in result.1.5. #31

Closed mjambon closed 4 years ago

mjambon commented 4 years ago

Hi, we ran into this error:

# Error: The implementation src/zed_string.ml
# [...]
#          val compare_index :
#            t ->
#            ('a, 'b) result ->
#            ('a, 'b) result ->
#            ok:('a -> 'a -> int) -> error:('b -> 'b -> int) -> int
#        is not included in
#          val compare_index : t -> index -> index -> int
#        File "src/zed_string.mli", line 184, characters 0-46:
#          Expected declaration
#        File "src/zed_string.ml", line 454, characters 6-19:
#          Actual declaration

The strange signature for the compare function is from the Result module which provides its own compare since version 1.5.

Hopefully this PR fixes the build for all OCaml versions supported by zed. See also the opam-repository PR https://github.com/ocaml/opam-repository/pull/15909

kandu commented 4 years ago

Many thanks, @mjambon :)