Converts a value of type T to type R.
the converted value
the value to convert
if the conversion fails due to invalid input