let chop_suffix_exn t ~suffix = let len = A.length suffix and lt = A.length t in if sub_same_tl t ~comp:suffix ~len ~off:(lt - len) then A.sub_exn t ~index:0 ~length:(lt - len) else raise (Invalid_argument "not a suffix")