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