.TH "Build_path_prefix_map" 3o 2020-01-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
.B Compiler_libs
\&.

.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

.B rewrite_opt map path
tries to find a source in 
.B map
that is a prefix of the input 
.B path
\&. If it succeeds,
it replaces this prefix with the corresponding target\&.
If it fails, it just returns 
.B None
\&.

.sp

.I val rewrite 
: 
.B map ->
.B   path -> path
.sp

.sp
