unsafeTransformSource
inline fun <Source : Any, Target : Any, Source2 : Any> Codec<Source, Target>.unsafeTransformSource(crossinline from: (Source) -> Source2, crossinline to: (Source2) -> Source): Codec<Source2, Target>(source)
Adapts a codec to a different source type while reusing the original target representation.
Decoding still starts with the receiver, then maps the decoded value through from. Encoding goes the other way by converting Source2 back to Source through to before delegating.
The transformation is unsafe because neither mapping is validated or wrapped; exceptions from from or to escape to the caller.