Write an ADT that will describe the result of parsing a JSON string. The result can either be an failure with its text or a successful value with Json.
There is already a Json class in the task space. And you also don't have to implemnt parse function.
But the following code must compile without warnings:
def parse(s: String): DecodeResult = ???
val json: Json = parse("""{"name":"Alice"}""") match
case DecodeResult.Failure(error) => throw RuntimeException(error)
case DecodeResult.Success(json) => json