There is no with sexp_of on purpose as it could only print the 'a value as an integer. Use <:sexp_of< Int.t >> or <:sexp_of< Unit.t >>.
with sexp_of
'a
<:sexp_of< Int.t >>
<:sexp_of< Unit.t >>
Keep only the error.