Post B0RGdPYBVEWoTOFP72 by mcc@mastodon.social
 (DIR) More posts by mcc@mastodon.social
 (DIR) Post #B0RGdNI9tqWLT6jZr6 by mcc@mastodon.social
       0 likes, 0 repeats
       
       Bit of a "subtoot" but:My biggest single frustration with Rust is that Result<> and Option<> are two things of fundamentally different kind. I wish Option<T> were literally just an alias for Result<T, ()>.What Hurts about writing error-safe Rust is converting between kinds of errors. Rust needs better ergonomics for that. But the problem goes nuclear when you consider the entire extra layer of complexity needed to intraconvert Options and Results. ? has two different meanings and I hate it!
       
 (DIR) Post #B0RGdPYBVEWoTOFP72 by mcc@mastodon.social
       0 likes, 0 repeats
       
       (Yes, there's a subtle human-level semantic difference between an Option and a Result<T, ()>. That does not justify the incredible level of syntactic complexity needed to keep them categorically separate in the Rust API.)
       
 (DIR) Post #B0RGdPleh9It9AYA6q by snowkitty@mastodon.social
       0 likes, 0 repeats
       
       @mcc i actually had to use a Result<Option<T>> the other day :x
       
 (DIR) Post #B0RGdQV1yRbFPtmOps by pitbuster@lile.cl
       0 likes, 0 repeats
       
       @snowkitty talking about silly functions, I like that `transpose` exists to convert between `Result<Option<T>,E>` and `Option<Result<T,E>>` @mcc