You see, a monad is like a burrito…
It’s super useful for
TryStream
s withnext()
. I often want to?
the result up, so that I can have a clean item in mywhile let
loop@Ephera you have to be a connoisseur to understand this one 🙂
Care to explain for the uninitiated like me? It feels like a meme, but conceptually an Option<Result> is very different from a Result<Option>, maybe I’m overthinking but to me an Option<Result> None means no action was taken (e.g. a function that runs every loop to take an action every second will return None most times and Some when it executes), whereas an Ok(None) means an action was taken and it has nothing to return (e.g. a function that safely reads a value from a JSON file, it didn’t failed reading the file so it’s an Ok, but the value wasn’t there so it’s None).
You can use
transpose()
to go fromOption<Result<T>>
toResult<Option<T>>
and vice versa.The “meme” is a trans pride flag and a human pose.
Ah, so a trans pose.
Nice.
It’s just a “joke” about the method name.