JJ: Description from the destination commit:

better config: parse file + crunch

JJ: Description from source commit:
rm taler_config_type.ml
This commit is contained in:
swrup 2025-11-20 18:38:01 +01:00
parent e2d3986989
commit 26a1c0f835
12 changed files with 481 additions and 409 deletions

View file

@ -35,19 +35,15 @@ let make ~sign ~currency ~value ~fraction =
in
Ok { sign; currency; value; fraction }
let to_string =
let pp =
let open Fmt in
let pp_sign ppf = function
| `Plus -> char ppf '+'
| `Minus -> char ppf '-'
in
let pp_currency ppf = function `Eur -> string ppf "EUR" in
fun ppf { sign; currency; value; fraction } ->
pf ppf "%a%a:%Ld.%02ld" (Fmt.option pp_sign) sign pp_currency currency
value fraction
in
Fmt.str "%a" pp
let pp =
let open Fmt in
let pp_sign ppf = function `Plus -> char ppf '+' | `Minus -> char ppf '-' in
let pp_currency ppf = function `Eur -> string ppf "EUR" in
fun ppf { sign; currency; value; fraction } ->
pf ppf "%a%a:%Ld.%02ld" (Fmt.option pp_sign) sign pp_currency currency value
fraction
let to_string = Fmt.str "%a" pp
let of_string =
let open Angstrom in