(* type packed_exception = exists 'x.{contents : 'x} *) type unpacked_exception 'x = {content : 'x}; type exception_scope 't = {bind_exception: !'x.unpacked_exception 'x -> 't }; type packed_exception = {open_exception: !'t.exception_scope 't -> 't }; exception PolymorphicException of packed_exception; value pack impl = { open_exception = fun scope -> scope.bind_exception impl } ; value exn_impl v = { content = v }; value test v = raise (PolymorphicException (pack (exn_impl v)));