let slice first last t = if first < 1 || last > String.length t || first > last then failwith "requesting invalid slice from sequence" else String.slice t (first - 1) last