Skip to content

Commit

Permalink
expose OpamCudf.to_json/of_json
Browse files Browse the repository at this point in the history
  • Loading branch information
gasche committed Mar 9, 2019
1 parent d77ba0b commit 5f3bfff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/solver/opamCudf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ let to_json = CudfJson.package_to_json
let of_json = CudfJson.package_of_json

(* Graph of cudf packages *)
module Pkg = struct
module Package = struct
type t = Cudf.package
include Common.CudfAdd
let to_string = string_of_package
Expand All @@ -387,7 +387,7 @@ module Pkg = struct
let of_json = of_json
end

module Action = OpamActionGraph.MakeAction(Pkg)
module Action = OpamActionGraph.MakeAction(Package)
module ActionGraph = OpamActionGraph.Make(Action)

let string_of_action = Action.to_string
Expand All @@ -404,8 +404,8 @@ type conflict_case =
type conflict =
Cudf.universe * int package_map * conflict_case

module Map = OpamStd.Map.Make(Pkg)
module Set = OpamStd.Set.Make(Pkg)
module Map = OpamStd.Map.Make(Package)
module Set = OpamStd.Set.Make(Package)
module Graph = struct

module PG = struct
Expand Down
12 changes: 10 additions & 2 deletions src/solver/opamCudf.mli
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@

open OpamTypes

module Package : sig
type t = Cudf.package
val equal : t -> t -> bool
val compare : t -> t -> int
val to_json : t -> OpamJson.t
val of_json : OpamJson.t -> t option
end

(** Cudf sets *)
module Set: OpamStd.SET with type elt = Cudf.package
module Set: OpamStd.SET with type elt = Package.t

(** Cudf maps *)
module Map: OpamStd.MAP with type key = Cudf.package
module Map: OpamStd.MAP with type key = Package.t

(** Cudf graph *)
module Graph: sig
Expand Down

0 comments on commit 5f3bfff

Please sign in to comment.