.TH "Build_path_prefix_map" 3o 2020-10-30 OCamldoc "OCaml library" .SH NAME Build_path_prefix_map \- Rewrite paths for reproducible builds .SH Module Module Build_path_prefix_map .SH Documentation .sp Module .BI "Build_path_prefix_map" : .B sig end .sp Rewrite paths for reproducible builds .sp Warning: this module is unstable and part of .ft B Compiler_libs .ft R \&. .sp .sp .sp .I type path = .B string .sp .sp .I type path_prefix = .B string .sp .sp .I type error_message = .B string .sp .sp .I val encode_prefix : .B path_prefix -> string .sp .sp .I val decode_prefix : .B string -> .B (path_prefix, error_message) .B result .sp .sp .I type pair = { target : .B path_prefix ; source : .B path_prefix ; } .sp .sp .I val encode_pair : .B pair -> string .sp .sp .I val decode_pair : .B string -> .B (pair, error_message) .B result .sp .sp .I type map = .B pair option list .sp .sp .I val encode_map : .B map -> string .sp .sp .I val decode_map : .B string -> .B (map, error_message) .B result .sp .sp .I val rewrite_opt : .B map -> .B path -> path option .sp .ft B rewrite_opt map path .ft R tries to find a source in .ft B map .ft R that is a prefix of the input .ft B path .ft R \&. If it succeeds, it replaces this prefix with the corresponding target\&. If it fails, it just returns .ft B None .ft R \&. .sp .I val rewrite : .B map -> .B path -> path .sp .sp