From 46169ec3eb38e177cafd7faf6338d36c6a9e3971 Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Thu, 27 Nov 2025 23:35:08 +0100 Subject: Whatever all of this is --- lib/iban.ml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/iban.ml') diff --git a/lib/iban.ml b/lib/iban.ml index fbea774..9b516c4 100644 --- a/lib/iban.ml +++ b/lib/iban.ml @@ -82,7 +82,16 @@ let to_string = Fn.id let of_string s = match make s with | Some iban -> iban - | None -> Printf.failwithf "Iban.of_string: %S" s () + | None -> Printf.failwithf "Iban.of_string: invalid IBAN %S" s () let sexp_of_t iban = Sexp.Atom iban + +let t_of_sexp sexp = + match sexp with + | Sexp.Atom s -> ( + match make s with + | Some iban -> iban + | None -> of_sexp_error "Iban.t_of_sexp: invalid IBAN" sexp) + | Sexp.List _ -> of_sexp_error "Iban.t_of_sexp: expected a list" sexp + let equal = String.equal -- cgit v1.2.3