The __repr__ method in Joke was calling unwrap internally, which is fine since we're calling it within a @safe method. However, what happens if we don't call it within a safe method? It throws an unwrap exception if the inner joke doesn't exist. This is unlikely to happen, but can happen.
The
__repr__
method inJoke
was callingunwrap
internally, which is fine since we're calling it within a@safe
method. However, what happens if we don't call it within a safe method? It throws an unwrap exception if the inner joke doesn't exist. This is unlikely to happen, but can happen.Maybe
bind
on the type to try to get the inner joke from the dictionary, otherwise returns the error as normal