let of_char ?(offset=`Offset33) x =
let offset' = int_of_offset offset in
let c = Char.to_int x in
if offset' <= c && c <= max_as_char then
Ok (c - offset')
else
error
"character with given offset is not a valid PHRED score"
(x, offset)
<:sexp_of< char * offset >>