A Simpler Way to See Results
YouTube Viewers YouTube Viewers
26.3K subscribers
92,712 views
0

 Published On Jul 27, 2023

Result is Rust's error handling type that is often discussed in the same (or similar) breath as Option, but it feels... scarier. But in this video, I'll argue that that relationship with Option is a useful piece to focus on; they are isomorphic in certain circumstances, and even when they're not, you can think of them as coexisting on a continuum. Then we'll talk about the dreaded/beloved question mark, FromIterator/collect, and some Error stuff.

Special guest appearances from anyhow, thiserror, derive_more, and boxed Error trait objects; Haskell do-notation, applicative functors, and the first official time I've ever said 'monad' on this channel; and more.

Links I promised:
Study of std::io::Error - https://matklad.github.io/2020/10/15/...
thiserror - https://docs.rs/thiserror/latest/this...

Other stuff:
Result module docs - https://doc.rust-lang.org/std/result/
Result chapter in the book - https://doc.rust-lang.org/book/ch09-0...
! - https://doc.rust-lang.org/std/primiti...
Haskell do notation - https://en.wikibooks.org/wiki/Haskell...
Sum type - https://en.wikipedia.org/wiki/Tagged_...
Isomorphism - https://en.wikipedia.org/wiki/Isomorp...
Bottom type - https://en.wikipedia.org/wiki/Bottom_...

I use the amazing Manim library for animating these videos, and I edit them with Blender and Audacity.
https://www.manim.community/
https://www.blender.org/
https://www.audacityteam.org/

show more

Share/Embed