A thrown exception is invisible in a function's type - nothing at the
call site says it can fail, and catch (e) just hands you unknown.
Result<T, E> moves the failure into the return type instead: the
caller gets { ok: true, value } or { ok: false, error }, and can't
reach value without checking ok first.
@itsnas usage.ts
codeusage.ts
main
Nas (@itsnas)
main
Nas (@itsnas)