You could simplify it like this:
```
suspend fun fetchSomethingWithSecret(
secret: String,
): Result<Something> =
withContext(Dispatchers.IO) {
cache.get(secret)
?: database.get(secret)
?: network.get(secret)
}
```
and return success or null for the cache and database cases.