Skip to content
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
17 changes: 17 additions & 0 deletions src/dune_util/action.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ module Diff = struct
type t =
| Binary
| Text

let to_dyn =
let open Dyn in
function
| Binary -> variant "Binary" []
| Text -> variant "Text" []
;;
end

type ('path, 'target) t =
Expand All @@ -12,6 +19,16 @@ module Diff = struct
; file2 : 'target
}

let to_dyn path target { optional; mode; file1; file2 } =
let open Dyn in
record
[ "optional", bool optional
; "mode", Mode.to_dyn mode
; "file1", path file1
; "file2", target file2
]
;;

let map t ~path ~target = { t with file1 = path t.file1; file2 = target t.file2 }
end

Expand Down
1 change: 1 addition & 0 deletions src/dune_util/action.mli
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Diff : sig
; file2 : 'target
}

val to_dyn : ('path -> Dyn.t) -> ('target -> Dyn.t) -> ('path, 'target) t -> Dyn.t
val map : ('p, 't) t -> path:('p -> 'a) -> target:('t -> 'b) -> ('a, 'b) t
end

Expand Down
Loading