let to_char ?(offset=`Offset33) t =
let offset' = int_of_offset offset in
let x = t + offset' in
if offset' <= x && x <= max_as_char then
Ok (Char.of_int_exn x)
else
error
"cannot convert PHRED score with requested offset to a visible ASCII character"
(t, offset)
<:sexp_of< t * offset >>